diff --git a/.craft.yml b/.craft.yml index 94d538b336..5ff7ad5d33 100644 --- a/.craft.yml +++ b/.craft.yml @@ -11,6 +11,9 @@ targets: dio: file: sqflite: + hive: + drift: + isar: - name: github - name: registry sdks: @@ -20,3 +23,6 @@ targets: pub:sentry_dio: pub:sentry_file: pub:sentry_sqflite: + pub:sentry_drift: + pub:sentry_hive: + pub:sentry_isar: diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..adc2cfb3a7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,48 @@ +version: 2 +updates: + - package-ecosystem: pub + directory: /dart + schedule: + interval: weekly + open-pull-requests-limit: 2 + versioning-strategy: increase-if-necessary + + - package-ecosystem: pub + directory: /flutter + schedule: + interval: weekly + open-pull-requests-limit: 2 + versioning-strategy: increase-if-necessary + + - package-ecosystem: pub + directory: /dio + schedule: + interval: weekly + open-pull-requests-limit: 2 + versioning-strategy: increase-if-necessary + + - package-ecosystem: pub + directory: /file + schedule: + interval: weekly + open-pull-requests-limit: 2 + versioning-strategy: increase-if-necessary + + - package-ecosystem: pub + directory: /logging + schedule: + interval: weekly + open-pull-requests-limit: 2 + versioning-strategy: increase-if-necessary + + - package-ecosystem: pub + directory: /sqflite + schedule: + interval: weekly + open-pull-requests-limit: 2 + versioning-strategy: increase-if-necessary + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 60d8b32b21..2db1a28642 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -19,12 +19,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} analyze: - name: Format, fix & analyze Code if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} runs-on: ubuntu-latest timeout-minutes: 20 @@ -32,26 +31,17 @@ jobs: run: working-directory: ${{ inputs.package }} steps: - - uses: actions/checkout@v3 - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 if: ${{ inputs.sdk == 'dart' }} - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 if: ${{ inputs.sdk == 'flutter' }} - run: ${{ inputs.sdk }} pub get - - - run: dart format . - - - run: dart fix --apply - - # actions/checkout fetches only a single commit in a detached HEAD state. Therefore - # we need to pass the current branch, otherwise we can't commit the changes. - # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. - - run: ../scripts/commit-formatted-code.sh $GITHUB_HEAD_REF - if: env.GITHUB_HEAD_REF != null - + - run: dart format --set-exit-if-changed ./ + - name: dart analyze - uses: invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1 + uses: invertase/github-action-dart-analyzer@1cda5922c6369263b1c7e2fbe281f69704f4d63e # pin@v2.0.0 with: annotate: true fatal-infos: true @@ -69,7 +59,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Apply dependency override + if: ${{ inputs.package == 'flutter' }} + working-directory: ${{ inputs.package }} + run: | + sed -i.bak 's|sentry:.*|sentry:\n path: /github/workspace/dart|g' pubspec.yaml - uses: axel-op/dart-package-analyzer@7a6c3c66bce78d82b729a1ffef2d9458fde6c8d2 # pin@v3 id: analysis with: diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 312a573806..a8bccd8d82 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -5,18 +5,18 @@ on: - main - release/** pull_request: - paths-ignore: - - 'logging/**' - - 'dio/**' - - 'file/**' - - 'sqflite/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/dart.yml" + - "dart/**" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -39,10 +39,10 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Test (VM and browser) run: | @@ -68,16 +68,16 @@ jobs: dart pub get webdev build - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: name: sentry files: ./dart/coverage/lcov.info - - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: - path: './dart/coverage/lcov.info' + path: "./dart/coverage/lcov.info" min_coverage: 85 analyze: diff --git a/.github/workflows/diagrams.yml b/.github/workflows/diagrams.yml new file mode 100644 index 0000000000..8b8cee500e --- /dev/null +++ b/.github/workflows/diagrams.yml @@ -0,0 +1,64 @@ +name: diagrams +on: + workflow_dispatch: + +jobs: + diagrams: + runs-on: ubuntu-latest + name: "Create class diagrams of all packages" + steps: + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 + with: + sdk: stable + + - uses: actions/checkout@v4 + + - name: dependencies + run: | + dart pub global activate lakos + sudo apt update + sudo apt install graphviz + + - name: dart + working-directory: ./dart + run: lakos . -i "{test/**,example/**,example_web/**}" | dot -Tsvg -o class-diagram.svg + + - name: flutter + working-directory: ./flutter + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + - name: dio + working-directory: ./dio + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + - name: file + working-directory: ./file + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + - name: sqflite + working-directory: ./sqflite + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + - name: logging + working-directory: ./logging + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + - name: hive + working-directory: ./hive + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + - name: isar + working-directory: ./isar + run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg + + # Source: https://stackoverflow.com/a/58035262 + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + + # actions/checkout fetches only a single commit in a detached HEAD state. Therefore + # we need to pass the current branch, otherwise we can't commit the changes. + # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. + - name: Commit & push + run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }} "Update class diagrams" diff --git a/.github/workflows/dio.yml b/.github/workflows/dio.yml index 6bae44d19c..f92f029d98 100644 --- a/.github/workflows/dio.yml +++ b/.github/workflows/dio.yml @@ -5,18 +5,19 @@ on: - main - release/** pull_request: - paths-ignore: - - 'logging/**' - - 'flutter/**' - - 'file/**' - - 'sqflite/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/dio.yml" + - "dart/**" + - "dio/**" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -34,15 +35,15 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: - - os: windows-latest + - os: windows-latest sdk: beta - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Test (VM and browser) run: | @@ -51,16 +52,16 @@ jobs: dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: name: sentry_dio files: ./dio/coverage/lcov.info - - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: - path: './dio/coverage/lcov.info' + path: "./dio/coverage/lcov.info" min_coverage: 81 analyze: diff --git a/.github/workflows/drift.yml b/.github/workflows/drift.yml new file mode 100644 index 0000000000..bbd07f905b --- /dev/null +++ b/.github/workflows/drift.yml @@ -0,0 +1,113 @@ +name: sentry-drift +on: + push: + branches: + - main + - release/** + pull_request: + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/drift.yml" + - "dart/**" + - "drift/**" + +jobs: + cancel-previous-workflow: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 + with: + access_token: ${{ github.token }} + + build: + name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }} + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + target: ["ios", "android", "macos", "linux", "windows"] + sdk: ["stable", "beta"] + exclude: + - os: ubuntu-latest + target: ios + - os: ubuntu-latest + target: macos + - os: ubuntu-latest + target: windows + - os: windows-latest + target: ios + - os: windows-latest + target: android + - os: windows-latest + target: macos + - os: windows-latest + target: linux + # macos-latest is taking hours due to limited resources + - os: macos-latest + target: android + - os: macos-latest + target: linux + - os: macos-latest + target: windows + # Bad CPU type in executable + - os: macos-latest + sdk: beta + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + if: ${{ matrix.target == 'android' }} + with: + java-version: "11" + distribution: "adopt" + + # Install required dependencies for Flutter on Linux on Ubuntu + - name: "Setup Linux" + run: | + sudo apt update + sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb + sudo apt install -y network-manager upower + if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' + + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 + with: + channel: ${{ matrix.sdk }} + + - run: flutter upgrade + + - name: Pub Get + run: | + cd drift + flutter pub get + + - name: Test VM with coverage + run: | + cd drift + flutter test --coverage --test-randomize-ordering-seed=random + + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + with: + name: sentry_drift + file: ./drift/coverage/lcov.info + functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 + + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + with: + path: "./drift/coverage/lcov.info" + min_coverage: 80 + + analyze: + uses: ./.github/workflows/analyze.yml + with: + package: drift + sdk: flutter \ No newline at end of file diff --git a/.github/workflows/e2e_dart.yml b/.github/workflows/e2e_dart.yml index 06d4eaae17..bec5e47c95 100644 --- a/.github/workflows/e2e_dart.yml +++ b/.github/workflows/e2e_dart.yml @@ -5,12 +5,12 @@ on: - main - release/** pull_request: - paths-ignore: - - 'logging/**' - - 'dio/**' - - 'flutter/**' - - 'file/**' - - 'sqflite/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/e2e_dart.yml" + - "dart/**" + - "e2e_test/**" env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} @@ -21,13 +21,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} build: name: E2E - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" timeout-minutes: 30 defaults: run: @@ -37,10 +37,10 @@ jobs: matrix: sdk: [stable, beta] steps: - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run if: env.SENTRY_AUTH_TOKEN != null run: | diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 1cf2b4d40d..d981a7cac5 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -5,18 +5,20 @@ on: - main - release/** pull_request: - paths-ignore: - - 'logging/**' - - 'flutter/**' - - 'dio/**' - - 'sqflite/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/file.yml" + - "dart/**" + - "flutter/**" + - "file/**" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -34,15 +36,15 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: - - os: windows-latest + - os: windows-latest sdk: beta - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Test VM run: | @@ -50,16 +52,16 @@ jobs: dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: name: sentry_file files: ./file/coverage/lcov.info - - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: - path: './file/coverage/lcov.info' + path: "./file/coverage/lcov.info" min_coverage: 55 analyze: diff --git a/.github/workflows/flutter-symbols.yml b/.github/workflows/flutter-symbols.yml new file mode 100644 index 0000000000..4462ccccc8 --- /dev/null +++ b/.github/workflows/flutter-symbols.yml @@ -0,0 +1,58 @@ +name: Flutter symbols collection +on: + schedule: + # Run once an hour. It takes just a couple of minutes because of status caching. + - cron: "10 * * * *" + workflow_dispatch: + inputs: + flutter_version: + description: Flutter version, can be either a specific version (3.17.0) or a wildcard (3.2.*) + required: false + type: string + default: "3.*.*" + +defaults: + run: + working-directory: scripts/flutter_symbol_collector + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 + + - run: dart pub get + + - run: dart test + + run: + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 + + - run: dart pub get + + - name: Download status cache of previously processed files + run: | + gh run download --name 'flutter-symbol-collector-database' --dir .cache + grep -r "" .cache + continue-on-error: true + env: + GITHUB_TOKEN: ${{ github.token }} + + - run: dart run bin/flutter_symbol_collector.dart --version=${{ inputs.flutter_version || '3.*.*' }} + timeout-minutes: 300 + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Upload updated status cache of processed files + uses: actions/upload-artifact@v4 + if: always() + with: + name: flutter-symbol-collector-database + path: scripts/flutter_symbol_collector/.cache diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index e5c682efa9..4443f84e05 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -5,23 +5,25 @@ on: - main - release/** pull_request: - paths-ignore: - - 'logging/**' - - 'dio/**' - - 'file/**' - - 'sqflite/**' + paths: + - ".github/workflows/flutter.yml" + - "!**/*.md" + - "!**/class-diagram.svg" + - "dart/**" + - "flutter/**" + - "metrics/flutter.properties" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} build: - name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }} + name: "${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}" runs-on: ${{ matrix.os }} timeout-minutes: 30 defaults: @@ -31,8 +33,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - target: ['ios', 'android', 'web', 'macos', 'linux', 'windows'] - sdk: ['stable', 'beta'] + target: ["ios", "android", "web", "macos", "linux", "windows"] + sdk: ["stable", "beta"] exclude: - os: ubuntu-latest target: ios @@ -64,23 +66,23 @@ jobs: sdk: beta steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 if: ${{ matrix.target == 'android' }} with: - java-version: '11' - distribution: 'adopt' + java-version: "11" + distribution: "adopt" # Install required dependencies for Flutter on Linux on Ubuntu - - name: 'Setup Linux' + - name: "Setup Linux" run: | sudo apt update sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb sudo apt install -y network-manager upower if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 with: channel: ${{ matrix.sdk }} @@ -102,19 +104,21 @@ jobs: run: | cd flutter flutter test --coverage --test-randomize-ordering-seed=random + dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart' - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' with: name: sentry_flutter file: ./flutter/coverage/lcov.info - functionalities: 'search' # remove after https://github.com/codecov/codecov-action/issues/600 + functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 - - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' with: - path: './flutter/coverage/lcov.info' + path: "./flutter/coverage/lcov.info" min_coverage: 90 + exclude: "lib/src/native/cocoa/binding.dart" - name: Build ${{ matrix.target }} run: | @@ -158,7 +162,7 @@ jobs: run: working-directory: ./flutter steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # https://github.com/CocoaPods/CocoaPods/issues/5275#issuecomment-315461879 - run: pod lib lint ios/sentry_flutter.podspec --configuration=Debug --skip-import-validation --allow-warnings --verbose @@ -169,7 +173,7 @@ jobs: run: working-directory: ./flutter steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@3.2.1 with: args: --strict @@ -181,10 +185,10 @@ jobs: run: working-directory: ./flutter steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: ktlint - uses: ScaCap/action-ktlint@2cf245b99bc91f73bc4c96a3d9d57bb5da3533ae # pin@1.7.1 + uses: ScaCap/action-ktlint@0ff81efa49425bd0df46caabd8005aafdc8f2cf2 # pin@1.8.0 with: github_token: ${{ secrets.github_token }} reporter: github-pr-review @@ -195,8 +199,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # To recreate baseline run: detekt -i flutter/android,flutter/example/android -b flutter/config/detekt-bl.xml -cb - - uses: natiginfo/action-detekt-all@e01de6ff0eef7c24131e8a133bf598cfac6ceeab # pin@1.21.0 + - uses: natiginfo/action-detekt-all@1349d3d957cba64d7b6b2752ef874d1e03e402a2 # pin@1.23.4 with: args: -i flutter/android,flutter/example/android --baseline flutter/config/detekt-bl.xml --jvm-target 1.8 --build-upon-default-config --all-rules diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml index 9a78828164..86bcb2e2dd 100644 --- a/.github/workflows/flutter_integration_test.yml +++ b/.github/workflows/flutter_integration_test.yml @@ -8,7 +8,7 @@ on: # - release/** # pull_request: # paths-ignore: - # - 'file/**' +# - 'file/**' jobs: cancel-previous-workflow: @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: ["stable", "beta"] + sdk: [ "stable", "beta" ] steps: - name: checkout uses: actions/checkout@v3 @@ -48,17 +48,17 @@ jobs: - name: flutter pub get run: flutter pub get - - name: Gradle cache - uses: gradle/gradle-build-action@v2 + - name: Gradle cache + uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # pin@v2.11.1 - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-21 + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-21 - name: create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' @@ -73,17 +73,17 @@ jobs: profile: Nexus 6 script: echo 'Generated AVD snapshot for caching.' - - name: launch android emulator & run android integration test - uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #pin@v2.28.0 - with: - working-directory: ./flutter/example - api-level: 21 - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - arch: x86_64 - profile: Nexus 6 - script: flutter test integration_test/integration_test.dart --verbose + - name: launch android emulator & run android integration test + uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #pin@v2.28.0 + with: + working-directory: ./flutter/example + api-level: 21 + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + arch: x86_64 + profile: Nexus 6 + script: flutter test integration_test/integration_test.dart --verbose test-ios: runs-on: macos-13 @@ -95,7 +95,7 @@ jobs: fail-fast: false matrix: # 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340 - sdk: ["stable"] + sdk: [ "stable" ] steps: - name: checkout uses: actions/checkout@v3 diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml new file mode 100644 index 0000000000..66c8239fcd --- /dev/null +++ b/.github/workflows/flutter_test.yml @@ -0,0 +1,169 @@ +name: flutter native & integration test +on: + push: + branches: + - main + - release/** + pull_request: + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/flutter_test.yml" + - "dart/**" + - "flutter/**" + +env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + +jobs: + cancel-previous-workflow: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 + with: + access_token: ${{ github.token }} + + test-android: + runs-on: macos-latest + timeout-minutes: 30 + defaults: + run: + working-directory: ./flutter/example + strategy: + fail-fast: false + matrix: + sdk: ["stable", "beta"] + steps: + - name: checkout + uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: "adopt" + java-version: "11" + + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 + with: + channel: ${{ matrix.sdk }} + + - name: flutter upgrade + run: flutter upgrade + + - name: flutter pub get + run: flutter pub get + + - name: Gradle cache + uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # pin@v2.11.1 + + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-31 + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 #pin@v2.30.1 + with: + working-directory: ./flutter/example + api-level: 31 + profile: Nexus 6 + arch: x86_64 + force-avd-creation: false + avd-name: macOS-avd-x86_64-31 + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: echo 'Generated AVD snapshot for caching.' + + - name: build apk + working-directory: ./flutter/example/android + run: flutter build apk --debug + + - name: launch android emulator & run android native test + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 #pin@v2.30.1 + with: + working-directory: ./flutter/example/android + api-level: 31 + profile: Nexus 6 + arch: x86_64 + force-avd-creation: false + avd-name: macOS-avd-x86_64-31 + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: ./gradlew testDebugUnitTest + + - name: launch android emulator & run android integration test + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 #pin@v2.30.1 + with: + working-directory: ./flutter/example + api-level: 31 + profile: Nexus 6 + arch: x86_64 + force-avd-creation: false + avd-name: macOS-avd-x86_64-31 + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: flutter test integration_test/all.dart --verbose + + cocoa: + name: "${{ matrix.target }} | ${{ matrix.sdk }}" + runs-on: macos-13 + timeout-minutes: 30 + defaults: + run: + working-directory: ./flutter/example + strategy: + fail-fast: false + matrix: + sdk: ["stable", "beta"] + # TODO: remove ios for now, will be fixed in v8 + target: ["macos"] + steps: + - name: checkout + uses: actions/checkout@v4 + + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 + with: + channel: ${{ matrix.sdk }} + + - name: flutter upgrade + run: flutter upgrade + + - name: flutter pub get + run: flutter pub get + + - name: pod install + working-directory: ./flutter/example/${{ matrix.target }} + run: pod install + + - name: prepare test device + id: device + run: | + case "${{ matrix.target }}" in + ios) + device=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-17-0) + xcrun simctl boot ${device} + echo "platform=iOS Simulator,id=${device}" >> "$GITHUB_OUTPUT" + ;; + macos) + device="macos" + echo "platform=OS X" >> "$GITHUB_OUTPUT" + ;; + esac + echo "name=${device}" >> "$GITHUB_OUTPUT" + + - name: run integration test + # Disable flutter integration tests for iOS for now (https://github.com/getsentry/sentry-dart/issues/1605#issuecomment-1695809346) + if: ${{ matrix.target != 'ios' }} + run: flutter test -d "${{ steps.device.outputs.name }}" integration_test/all.dart --verbose + + - name: run native test + # We only have the native unit test package in the iOS xcodeproj at the moment. + # Should be OK because it will likely be removed after switching to FFI (see https://github.com/getsentry/sentry-dart/issues/1444). + if: ${{ matrix.target != 'macos' }} + working-directory: ./flutter/example/${{ matrix.target }} + run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=${{ steps.device.outputs.platform }}" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO diff --git a/.github/workflows/format-and-fix.yml b/.github/workflows/format-and-fix.yml new file mode 100644 index 0000000000..4f6d96f106 --- /dev/null +++ b/.github/workflows/format-and-fix.yml @@ -0,0 +1,54 @@ +on: + workflow_dispatch: + +jobs: + cancel-previous-workflow: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 + with: + access_token: ${{ github.token }} + + format-and-fix: + name: Format & fix code + if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + package: [ + {name: dart, sdk: dart}, + {name: dio, sdk: dart}, + {name: file, sdk: dart}, + {name: flutter, sdk: flutter}, + {name: logging, sdk: dart}, + {name: sqflite, sdk: flutter}, + ] + defaults: + run: + working-directory: ${{ matrix.package.name }} + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 + if: ${{ matrix.package.sdk == 'dart' }} + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 + if: ${{ matrix.package.sdk == 'flutter' }} + + - run: ${{ matrix.package.sdk }} pub get + + - run: dart format . + + - run: dart fix --apply + + # Source: https://stackoverflow.com/a/58035262 + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + + # actions/checkout fetches only a single commit in a detached HEAD state. Therefore + # we need to pass the current branch, otherwise we can't commit the changes. + # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. + - name: Commit & push + run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }} "Format & fix code" diff --git a/.github/workflows/hive.yml b/.github/workflows/hive.yml new file mode 100644 index 0000000000..5893673318 --- /dev/null +++ b/.github/workflows/hive.yml @@ -0,0 +1,70 @@ +name: sentry-hive +on: + push: + branches: + - main + - release/** + pull_request: + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/hive.yml" + - "dart/**" + - "hive/**" + +jobs: + cancel-previous-workflow: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 + with: + access_token: ${{ github.token }} + + build: + name: Build ${{matrix.sdk}} on ${{matrix.os}} + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + defaults: + run: + shell: bash + working-directory: ./hive + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + sdk: [stable, beta] + exclude: + - os: windows-latest + sdk: beta + - os: macos-latest + sdk: beta + steps: + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 + with: + sdk: ${{ matrix.sdk }} + - uses: actions/checkout@v4 + + - name: Test VM + run: | + dart pub get + dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces + dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib + + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + name: sentry_hive + files: ./hive/coverage/lcov.info + + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 + if: runner.os == 'Linux' && matrix.sdk == 'stable' + with: + path: "./hive/coverage/lcov.info" + min_coverage: 55 + + analyze: + uses: ./.github/workflows/analyze.yml + with: + package: hive + panaThreshold: 90 diff --git a/.github/workflows/isar.yml b/.github/workflows/isar.yml new file mode 100644 index 0000000000..f4038421df --- /dev/null +++ b/.github/workflows/isar.yml @@ -0,0 +1,113 @@ +name: sentry-isar +on: + push: + branches: + - main + - release/** + pull_request: + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/isar.yml" + - "dart/**" + - "isar/**" + +jobs: + cancel-previous-workflow: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 + with: + access_token: ${{ github.token }} + + build: + name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }} + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + target: ["ios", "android", "macos", "linux", "windows"] + sdk: ["stable", "beta"] + exclude: + - os: ubuntu-latest + target: ios + - os: ubuntu-latest + target: macos + - os: ubuntu-latest + target: windows + - os: windows-latest + target: ios + - os: windows-latest + target: android + - os: windows-latest + target: macos + - os: windows-latest + target: linux + # macos-latest is taking hours due to limited resources + - os: macos-latest + target: android + - os: macos-latest + target: linux + - os: macos-latest + target: windows + # Bad CPU type in executable + - os: macos-latest + sdk: beta + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + if: ${{ matrix.target == 'android' }} + with: + java-version: "11" + distribution: "adopt" + + # Install required dependencies for Flutter on Linux on Ubuntu + - name: "Setup Linux" + run: | + sudo apt update + sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb + sudo apt install -y network-manager upower + if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' + + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 + with: + channel: ${{ matrix.sdk }} + + - run: flutter upgrade + + - name: Pub Get + run: | + cd isar + flutter pub get + + - name: Test VM with coverage + run: | + cd isar + flutter test -j 1 --coverage --test-randomize-ordering-seed=random + + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + with: + name: sentry_isar + file: ./isar/coverage/lcov.info + functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 + + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + with: + path: "./isar/coverage/lcov.info" + min_coverage: 55 + + analyze: + uses: ./.github/workflows/analyze.yml + with: + package: isar + sdk: flutter diff --git a/.github/workflows/logging.yml b/.github/workflows/logging.yml index 88cc91d110..9a3fead839 100644 --- a/.github/workflows/logging.yml +++ b/.github/workflows/logging.yml @@ -5,18 +5,19 @@ on: - main - release/** pull_request: - paths-ignore: - - 'dio/**' - - 'flutter/**' - - 'file/**' - - 'sqflite/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/logging.yml" + - "dart/**" + - "logging/**" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -34,15 +35,15 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: - - os: windows-latest + - os: windows-latest sdk: beta - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Test (VM and browser) run: | @@ -51,15 +52,15 @@ jobs: dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: name: sentry_logging files: ./logging/coverage/lcov.info - - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.1.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' with: - path: './logging/coverage/lcov.info' + path: "./logging/coverage/lcov.info" min_coverage: 90 analyze: diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 9603300200..94278a167c 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -7,17 +7,18 @@ on: - dart/** - flutter/** - metrics/** + - "!**/*.md" branches-ignore: - deps/** - dependabot/** - tags-ignore: ['**'] + tags-ignore: ["**"] jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -40,7 +41,7 @@ jobs: host: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Let's stick to an explicit version and update manually because a version change may affect results. # If it would update implicitly it could confuse people to think the change is actually caused by the PR. @@ -52,19 +53,19 @@ jobs: echo "flutter=$version" >> "$GITHUB_OUTPUT" - name: Install Flutter v${{ steps.conf.outputs.flutter }} - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 with: flutter-version: ${{ steps.conf.outputs.flutter }} - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 if: ${{ matrix.platform == 'android' }} with: - java-version: '11' - distribution: 'adopt' + java-version: "11" + distribution: "adopt" - run: ./metrics/prepare.sh - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: app-plain-cache with: path: ${{ matrix.appPlain }} diff --git a/.github/workflows/min_version_test.yml b/.github/workflows/min_version_test.yml index 86287d14ed..c20f06489d 100644 --- a/.github/workflows/min_version_test.yml +++ b/.github/workflows/min_version_test.yml @@ -5,16 +5,20 @@ on: - main - release/** pull_request: - paths-ignore: - - 'file/**' - - 'sqflite/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/min_version_test.yml" + - "dart/**" + - "flutter/**" + - "min_version_test/**" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -23,16 +27,16 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: '11' + distribution: "adopt" + java-version: "11" - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 with: - flutter-version: '3.0.0' + flutter-version: "3.0.0" - name: Build Android run: | @@ -45,11 +49,11 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 with: - flutter-version: '3.0.0' + flutter-version: "3.0.0" - name: Build iOS run: | @@ -62,11 +66,11 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 with: - flutter-version: '3.0.0' + flutter-version: "3.0.0" - name: Build web run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1209884c7d..1642223bcd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: name: "Release a new version" steps: - name: Check out current commit (${{ github.sha }}) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.GH_RELEASE_PAT }} fetch-depth: 0 diff --git a/.github/workflows/sqflite.yml b/.github/workflows/sqflite.yml index 9c0696065b..a94c31475f 100644 --- a/.github/workflows/sqflite.yml +++ b/.github/workflows/sqflite.yml @@ -5,18 +5,19 @@ on: - main - release/** pull_request: - paths-ignore: - - 'logging/**' - - 'flutter/**' - - 'dio/**' - - 'file/**' + paths: + - "!**/*.md" + - "!**/class-diagram.svg" + - ".github/workflows/logging.yml" + - "dart/**" + - "sqflite/**" jobs: cancel-previous-workflow: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0 + uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # pin@0.12.1 with: access_token: ${{ github.token }} @@ -31,8 +32,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - target: ['ios', 'android', 'macos', 'linux', 'windows'] - sdk: ['stable', 'beta'] + target: ["ios", "android", "macos", "linux", "windows"] + sdk: ["stable", "beta"] exclude: - os: ubuntu-latest target: ios @@ -60,23 +61,23 @@ jobs: sdk: beta steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 if: ${{ matrix.target == 'android' }} with: - java-version: '11' - distribution: 'adopt' + java-version: "11" + distribution: "adopt" # Install required dependencies for Flutter on Linux on Ubuntu - - name: 'Setup Linux' + - name: "Setup Linux" run: | sudo apt update sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb sudo apt install -y network-manager upower if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux' - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 with: channel: ${{ matrix.sdk }} @@ -92,17 +93,17 @@ jobs: cd sqflite flutter test --coverage --test-randomize-ordering-seed=random - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + - uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' with: name: sentry_sqflite file: ./sqflite/coverage/lcov.info - functionalities: 'search' # remove after https://github.com/codecov/codecov-action/issues/600 + functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600 - - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 + - uses: VeryGoodOpenSource/very_good_coverage@3b475421464c564c0714d92ce02742bd81fa9eda # pin@v2.2.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' with: - path: './sqflite/coverage/lcov.info' + path: "./sqflite/coverage/lcov.info" min_coverage: 80 analyze: diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml index 233afc3d69..d7eaf21a58 100644 --- a/.github/workflows/update-deps.yml +++ b/.github/workflows/update-deps.yml @@ -3,7 +3,7 @@ name: Update Dependencies on: # Run every day. schedule: - - cron: '0 3 * * *' + - cron: "0 3 * * *" # And on on every PR merge so we get the updated dependencies ASAP, and to make sure the changelog doesn't conflict. push: branches: @@ -23,6 +23,7 @@ jobs: with: path: flutter/scripts/update-cocoa.sh name: Cocoa SDK + runs-on: macos-latest secrets: api-token: ${{ secrets.CI_DEPLOY_KEY }} @@ -34,3 +35,12 @@ jobs: changelog-entry: false secrets: api-token: ${{ secrets.CI_DEPLOY_KEY }} + + symbol-collector: + uses: getsentry/github-workflows/.github/workflows/updater.yml@v2 + with: + path: scripts/update-symbol-collector.sh + name: Symbol collector CLI + changelog-entry: false + secrets: + api-token: ${{ secrets.CI_DEPLOY_KEY }} diff --git a/.github/workflows/web-example-ghpages.yml b/.github/workflows/web-example-ghpages.yml index 1e5adc9456..106c52615d 100644 --- a/.github/workflows/web-example-ghpages.yml +++ b/.github/workflows/web-example-ghpages.yml @@ -13,8 +13,8 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} steps: - - uses: actions/checkout@v3 - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 - uses: bluefireteam/flutter-gh-pages@57815b17b371455ec1a98f075b71b4c6ba0a938c # pin@v8 with: workingDir: flutter/example diff --git a/.gitignore b/.gitignore index 558e422972..1f40d0ebb1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ dio/coverage/* file/coverage/* flutter/coverage/* sqflite/coverage/* +drift/coverage/* +hive/coverage/* +isar/coverage/* pubspec.lock Podfile.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 323f9c563e..6c1e59ae8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,21 +16,182 @@ - Now the device context from Android is available in `BeforeSendCallback` - Set ip_address to {{auto}} by default, even if sendDefaultPII is disabled ([#1665](https://github.com/getsentry/sentry-dart/pull/1665)) - Instead use the "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io + +## 7.16.0 + +### Features + +- Add `SentryWidget` ([#1846](https://github.com/getsentry/sentry-dart/pull/1846)) + - Prefer to use `SentryWidget` now instead of `SentryScreenshotWidget` and `SentryUserInteractionWidget` directly +- Performance monitoring support for Isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726)) +- Tracing without performance for Dio integration ([#1837](https://github.com/getsentry/sentry-dart/pull/1837)) +- Accept `Map` in `Hint` class ([#1807](https://github.com/getsentry/sentry-dart/pull/1807)) + - Please check if everything works as expected when using `Hint` + - Factory constructor `Hint.withMap(Map map)` now takes `Map` instead of `Map` + - Method `hint.addAll(Map keysAndValues)` now takes `Map` instead of `Map` + - Method `set(String key, dynamic value)` now takes value of `dynamic` instead of `Object` + - Method `hint.get(String key)` now returns `dynamic` instead of `Object?` + +### Dependencies + +- Bump Cocoa SDK from v8.18.0 to v8.19.0 ([#1803](https://github.com/getsentry/sentry-dart/pull/1844)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8190) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.18.0...8.19.0) +- Bump Android SDK from v7.2.0 to v7.3.0 ([#1852](https://github.com/getsentry/sentry-dart/pull/1852)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#730) + - [diff](https://github.com/getsentry/sentry-java/compare/7.2.0...7.3.0) + +## 7.15.0 + +### Features + +- Add [Spotlight](https://spotlightjs.com/about/) support ([#1786](https://github.com/getsentry/sentry-dart/pull/1786)) + - Set `options.spotlight = Spotlight(enabled: true)` to enable Spotlight +- Add `ConnectivityIntegration` for web ([#1765](https://github.com/getsentry/sentry-dart/pull/1765)) + - We only get the info if online/offline on web platform. The added breadcrumb is set to either `wifi` or `none`. +- Add isar breadcrumbs ([#1800](https://github.com/getsentry/sentry-dart/pull/1800)) +- Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1799](https://github.com/getsentry/sentry-dart/pull/1799)) +- Add beforeScreenshotCallback to SentryFlutterOptions ([#1805](https://github.com/getsentry/sentry-dart/pull/1805)) +- Add support for `readTransaction` in `sqflite` ([#1819](https://github.com/getsentry/sentry-dart/pull/1819)) -## Unreleased - +### Dependencies + +- Bump Android SDK from v7.0.0 to v7.2.0 ([#1788](https://github.com/getsentry/sentry-dart/pull/1788), [#1815](https://github.com/getsentry/sentry-dart/pull/1815)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#720) + - [diff](https://github.com/getsentry/sentry-java/compare/7.0.0...7.2.0) +- Bump Cocoa SDK from v8.17.2 to v8.18.0 ([#1803](https://github.com/getsentry/sentry-dart/pull/1803)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8180) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.17.2...8.18.0) + +## 7.14.0 + +- Add option to opt out of fatal level for automatically collected errors ([#1738](https://github.com/getsentry/sentry-dart/pull/1738)) + +### Fixes + +- Add debug_meta to all events ([#1756](https://github.com/getsentry/sentry-dart/pull/1756)) + - Fixes obfuscated stacktraces when `captureMessage` or `captureEvent` is called with `attachStacktrace` option + +### Features + +- Add option to opt out of fatal level for automatically collected errors ([#1738](https://github.com/getsentry/sentry-dart/pull/1738)) +- Add `Hive` breadcrumbs ([#1773](https://github.com/getsentry/sentry-dart/pull/1773)) + +### Dependencies + +- Bump Android SDK from v6.34.0 to v7.0.0 ([#1768](https://github.com/getsentry/sentry-dart/pull/1768)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#700) + - [diff](https://github.com/getsentry/sentry-java/compare/6.34.0...7.0.0) +- Bump Cocoa SDK from v8.15.2 to v8.17.2 ([#1761](https://github.com/getsentry/sentry-dart/pull/1761), [#1771](https://github.com/getsentry/sentry-dart/pull/1771), [#1787](https://github.com/getsentry/sentry-dart/pull/1787)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8172) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.15.2...8.17.2) + +## 7.13.2 + +### Fixes + +- Fix SIGSEV, SIGABRT and SIGBUS crashes happening after/around the August Google Play System update, see [#2955](https://github-redirect.dependabot.com/getsentry/sentry-java/issues/2955) for more details (fix provided by Native SDK bump) + +### Dependencies + +- Update package-info-plus constraint to include 5.0.1 ([#1749](https://github.com/getsentry/sentry-dart/pull/1749)) +- Bump Android SDK from v6.33.1 to v6.34.0 ([#1746](https://github.com/getsentry/sentry-dart/pull/1746)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6340) + - [diff](https://github.com/getsentry/sentry-java/compare/6.33.1...6.34.0) + +## 7.13.1 + +### Fixes + +- Fixes release of drift & hive and adds missing integration & sdk version information in the hub options ([#1729](https://github.com/getsentry/sentry-dart/pull/1729)) + +## 7.13.0 + +### Fixes + +- Fixes setting the correct locale to contexts with navigatorKey ([#1724](https://github.com/getsentry/sentry-dart/pull/1724)) + - If you have a selected locale in e.g MaterialApp, this fix will retrieve the correct locale for the event context. +- Flutter renderer information was removed on dart:io platforms since it didn't add the correct value ([#1723](https://github.com/getsentry/sentry-dart/pull/1723)) +- Unsupported types with Expando ([#1690](https://github.com/getsentry/sentry-dart/pull/1690)) + +### Features + +- Add APM integration for Drift ([#1709](https://github.com/getsentry/sentry-dart/pull/1709)) +- StackTraces in `PlatformException.message` will get nicely formatted too when present ([#1716](https://github.com/getsentry/sentry-dart/pull/1716)) +- Breadcrumbs for database operations ([#1656](https://github.com/getsentry/sentry-dart/pull/1656)) +- APM for hive ([#1672](https://github.com/getsentry/sentry-dart/pull/1672)) +- Add `attachScreenshotOnlyWhenResumed` to options ([#1700](https://github.com/getsentry/sentry-dart/pull/1700)) + +### Dependencies + +- Bump Android SDK from v6.32.0 to v6.33.1 ([#1710](https://github.com/getsentry/sentry-dart/pull/1710), [#1713](https://github.com/getsentry/sentry-dart/pull/1713)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6331) + - [diff](https://github.com/getsentry/sentry-java/compare/6.32.0...6.33.1) +- Bump Cocoa SDK from v8.14.2 to v8.15.2 ([#1712](https://github.com/getsentry/sentry-dart/pull/1712), [#1714](https://github.com/getsentry/sentry-dart/pull/1714), [#1717](https://github.com/getsentry/sentry-dart/pull/1717)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8152) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.14.2...8.15.2) + +## 7.12.0 + +### Enhancements + +- Log warning if both tracesSampleRate and tracesSampler are set ([#1701](https://github.com/getsentry/sentry-dart/pull/1701)) +- Better Flutter framework stack traces - we now collect Flutter framework debug symbols for iOS, macOS and Android automatically on the Sentry server ([#1673](https://github.com/getsentry/sentry-dart/pull/1673)) + +### Features + +- Initial (alpha) support for profiling on iOS and macOS ([#1611](https://github.com/getsentry/sentry-dart/pull/1611)) +- Add `SentryNavigatorObserver` current route to `event.app.contexts.viewNames` ([#1545](https://github.com/getsentry/sentry-dart/pull/1545)) + - Requires relay version [23.9.0](https://github.com/getsentry/relay/blob/master/CHANGELOG.md#2390) for self-hosted instances + +## 7.11.0 + +### Fixes + +- Session: missing mechanism.handled is considered crash ([#3353](https://github.com/getsentry/sentry-cocoa/pull/3353)) + +### Features + +- Breadcrumbs for file I/O operations ([#1649](https://github.com/getsentry/sentry-dart/pull/1649)) + +### Dependencies + +- Enable compatibility with uuid v4 ([#1647](https://github.com/getsentry/sentry-dart/pull/1647)) +- Bump Android SDK from v6.29.0 to v6.32.0 ([#1660](https://github.com/getsentry/sentry-dart/pull/1660), [#1676](https://github.com/getsentry/sentry-dart/pull/1676), [#1688](https://github.com/getsentry/sentry-dart/pull/1688)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6320) + - [diff](https://github.com/getsentry/sentry-java/compare/6.29.0...6.32.0) +- Bump Cocoa SDK from v8.11.0 to v8.14.2 ([#1650](https://github.com/getsentry/sentry-dart/pull/1650), [#1655](https://github.com/getsentry/sentry-dart/pull/1655), [#1677](https://github.com/getsentry/sentry-dart/pull/1677), [#1691](https://github.com/getsentry/sentry-dart/pull/1691)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8142) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.11.0...8.14.2) + +## 7.10.1 + +### Enhancements + +- Add Sampling Decision to Trace Envelope Header ([#1639](https://github.com/getsentry/sentry-dart/pull/1639)) +- Add http.request.method attribute to http spans data ([#1633](https://github.com/getsentry/sentry-dart/pull/1633)) +- Add db.system and db.name attributes to db spans data ([#1629](https://github.com/getsentry/sentry-dart/pull/1629)) +- Log SDK errors to the console if the log level is `fatal` even if `debug` is disabled ([#1635](https://github.com/getsentry/sentry-dart/pull/1635)) + +### Features + +- Tracing without performance ([#1621](https://github.com/getsentry/sentry-dart/pull/1621)) + ### Fixes +- Normalize data properties of `SentryUser` and `Breadcrumb` before sending over method channel ([#1591](https://github.com/getsentry/sentry-dart/pull/1591)) - Fixing memory leak issue in SentryFlutterPlugin (Android Plugin) ([#1588](https://github.com/getsentry/sentry-dart/pull/1588)) +- Discard empty stack frames ([#1625](https://github.com/getsentry/sentry-dart/pull/1625)) +- Disable scope sync for cloned scopes ([#1628](https://github.com/getsentry/sentry-dart/pull/1628)) ### Dependencies -- Bump Android SDK from v6.25.2 to v6.28.0 ([#1586](https://github.com/getsentry/sentry-dart/pull/1586)) - - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6280) - - [diff](https://github.com/getsentry/sentry-java/compare/6.25.2...6.28.0) -- Bump Cocoa SDK from v8.9.1 to v8.10.0 ([#1584](https://github.com/getsentry/sentry-dart/pull/1584), [#1606](https://github.com/getsentry/sentry-dart/pull/1606)) - - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8100) - - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.9.1...8.10.0) +- Bump Android SDK from v6.25.2 to v6.29.0 ([#1586](https://github.com/getsentry/sentry-dart/pull/1586), [#1630](https://github.com/getsentry/sentry-dart/pull/1630)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6290) + - [diff](https://github.com/getsentry/sentry-java/compare/6.25.2...6.29.0) +- Bump Cocoa SDK from v8.9.1 to v8.11.0 ([#1584](https://github.com/getsentry/sentry-dart/pull/1584), [#1606](https://github.com/getsentry/sentry-dart/pull/1606), [#1626](https://github.com/getsentry/sentry-dart/pull/1626)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8110) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.9.1...8.11.0) ## 7.9.0 diff --git a/README.md b/README.md index 8ab372fc5a..6159941c4c 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,21 @@ Sentry SDK for Dart and Flutter [![codecov](https://codecov.io/gh/getsentry/sentry-dart/branch/main/graph/badge.svg?token=J0QX0LPmwy)](https://codecov.io/gh/getsentry/sentry-dart) -| package | build | pub | likes | popularity | pub points | -| ------- | ------- | ------- | ------- | ------- | ------- | -| sentry | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-dart/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-dart) | [![pub package](https://img.shields.io/pub/v/sentry.svg)](https://pub.dev/packages/sentry) | [![likes](https://img.shields.io/pub/likes/sentry?logo=dart)](https://pub.dev/packages/sentry/score) | [![popularity](https://img.shields.io/pub/popularity/sentry?logo=dart)](https://pub.dev/packages/sentry/score) | [![pub points](https://img.shields.io/pub/points/sentry?logo=dart)](https://pub.dev/packages/sentry/score) +| package | build | pub | likes | popularity | pub points | +|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------| ------- | ------- | +| sentry | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/dart.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-dart) | [![pub package](https://img.shields.io/pub/v/sentry.svg)](https://pub.dev/packages/sentry) | [![likes](https://img.shields.io/pub/likes/sentry?logo=dart)](https://pub.dev/packages/sentry/score) | [![popularity](https://img.shields.io/pub/popularity/sentry?logo=dart)](https://pub.dev/packages/sentry/score) | [![pub points](https://img.shields.io/pub/points/sentry?logo=dart)](https://pub.dev/packages/sentry/score) | sentry_flutter | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-flutter/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-flutter) | [![pub package](https://img.shields.io/pub/v/sentry_flutter.svg)](https://pub.dev/packages/sentry_flutter) | [![likes](https://img.shields.io/pub/likes/sentry_flutter?logo=dart)](https://pub.dev/packages/sentry_flutter/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_flutter?logo=dart)](https://pub.dev/packages/sentry_flutter/score) | [![pub points](https://img.shields.io/pub/points/sentry_flutter?logo=dart)](https://pub.dev/packages/sentry_flutter/score) -| sentry_logging | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-logging/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Alogging) | [![pub package](https://img.shields.io/pub/v/sentry_logging.svg)](https://pub.dev/packages/sentry_logging) | [![likes](https://img.shields.io/pub/likes/sentry_logging?logo=dart)](https://pub.dev/packages/sentry_logging/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_logging?logo=dart)](https://pub.dev/packages/sentry_logging/score) | [![pub points](https://img.shields.io/pub/points/sentry_logging?logo=dart)](https://pub.dev/packages/sentry_logging/score) -| sentry_dio | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-dio/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-dio) | [![pub package](https://img.shields.io/pub/v/sentry_dio.svg)](https://pub.dev/packages/sentry_dio) | [![likes](https://img.shields.io/pub/likes/sentry_dio?logo=dart)](https://pub.dev/packages/sentry_dio/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_dio?logo=dart)](https://pub.dev/packages/sentry_dio/score) | [![pub points](https://img.shields.io/pub/points/sentry_dio?logo=dart)](https://pub.dev/packages/sentry_dio/score) -| sentry_file | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-file/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-file) | [![pub package](https://img.shields.io/pub/v/sentry_file.svg)](https://pub.dev/packages/sentry_file) | [![likes](https://img.shields.io/pub/likes/sentry_file?logo=dart)](https://pub.dev/packages/sentry_file/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_file?logo=dart)](https://pub.dev/packages/sentry_file/score) | [![pub points](https://img.shields.io/pub/points/sentry_file?logo=dart)](https://pub.dev/packages/sentry_file/score) -| sentry_sqflite | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-sqflite/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-sqflite) | [![pub package](https://img.shields.io/pub/v/sentry_sqflite.svg)](https://pub.dev/packages/sentry_sqflite) | [![likes](https://img.shields.io/pub/likes/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![pub points](https://img.shields.io/pub/points/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) +| sentry_logging | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-logging/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Alogging) | [![pub package](https://img.shields.io/pub/v/sentry_logging.svg)](https://pub.dev/packages/sentry_logging) | [![likes](https://img.shields.io/pub/likes/sentry_logging?logo=dart)](https://pub.dev/packages/sentry_logging/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_logging?logo=dart)](https://pub.dev/packages/sentry_logging/score) | [![pub points](https://img.shields.io/pub/points/sentry_logging?logo=dart)](https://pub.dev/packages/sentry_logging/score) +| sentry_dio | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-dio/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-dio) | [![pub package](https://img.shields.io/pub/v/sentry_dio.svg)](https://pub.dev/packages/sentry_dio) | [![likes](https://img.shields.io/pub/likes/sentry_dio?logo=dart)](https://pub.dev/packages/sentry_dio/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_dio?logo=dart)](https://pub.dev/packages/sentry_dio/score) | [![pub points](https://img.shields.io/pub/points/sentry_dio?logo=dart)](https://pub.dev/packages/sentry_dio/score) +| sentry_file | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-file/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-file) | [![pub package](https://img.shields.io/pub/v/sentry_file.svg)](https://pub.dev/packages/sentry_file) | [![likes](https://img.shields.io/pub/likes/sentry_file?logo=dart)](https://pub.dev/packages/sentry_file/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_file?logo=dart)](https://pub.dev/packages/sentry_file/score) | [![pub points](https://img.shields.io/pub/points/sentry_file?logo=dart)](https://pub.dev/packages/sentry_file/score) +| sentry_sqflite | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-sqflite/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-sqflite) | [![pub package](https://img.shields.io/pub/v/sentry_sqflite.svg)](https://pub.dev/packages/sentry_sqflite) | [![likes](https://img.shields.io/pub/likes/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![pub points](https://img.shields.io/pub/points/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) +| sentry_drift | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-drift) | [![pub package](https://img.shields.io/pub/v/sentry_drift.svg)](https://pub.dev/packages/sentry_drift) | [![likes](https://img.shields.io/pub/likes/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![pub points](https://img.shields.io/pub/points/sentry_drift)](https://pub.dev/packages/sentry_drift/score) +| sentry_hive | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-hive) | [![pub package](https://img.shields.io/pub/v/sentry_hive.svg)](https://pub.dev/packages/sentry_hive) | [![likes](https://img.shields.io/pub/likes/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![pub points](https://img.shields.io/pub/points/sentry_hive)](https://pub.dev/packages/sentry_hive/score) +| sentry_isar | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-isar) | [![pub package](https://img.shields.io/pub/v/sentry_isar.svg)](https://pub.dev/packages/sentry_isar) | [![likes](https://img.shields.io/pub/likes/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![pub points](https://img.shields.io/pub/points/sentry_isar)](https://pub.dev/packages/sentry_isar/score) ##### Usage -For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart), [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter), [logging](https://github.com/getsentry/sentry-dart/tree/main/logging), [dio](https://github.com/getsentry/sentry-dart/tree/main/dio), [file](https://github.com/getsentry/sentry-dart/tree/main/file) and [sqflite](https://github.com/getsentry/sentry-dart/tree/main/sqflite) `README's` or our `Resources` section below. +For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart), [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter), [logging](https://github.com/getsentry/sentry-dart/tree/main/logging), [dio](https://github.com/getsentry/sentry-dart/tree/main/dio), [file](https://github.com/getsentry/sentry-dart/tree/main/file), [sqflite](https://github.com/getsentry/sentry-dart/tree/main/sqflite), [drift](https://github.com/getsentry/sentry-dart/tree/main/drift), [hive](https://github.com/getsentry/sentry-dart/tree/main/hive) and [isar](https://github.com/getsentry/sentry-dart/tree/main/isar) `README's` or our `Resources` section below. #### Blog posts diff --git a/dart/README.md b/dart/README.md index e3cf3b6bb6..a6582faa16 100644 --- a/dart/README.md +++ b/dart/README.md @@ -184,8 +184,11 @@ Read more about [Automatic Instrumentation](https://docs.sentry.io/platforms/dar #### Resources -* [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dart/) -* [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks) -* [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) +#### Resources + +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) * [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) -* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/dart/analysis_options.yaml b/dart/analysis_options.yaml index c5924fcb20..74ed00b114 100644 --- a/dart/analysis_options.yaml +++ b/dart/analysis_options.yaml @@ -3,6 +3,7 @@ include: package:lints/recommended.yaml analyzer: exclude: - example/** # the example has its own 'analysis_options.yaml' + - test/*.mocks.dart errors: # treat missing required parameters as a warning (not a hint) missing_required_param: error diff --git a/dart/class-diagram.svg b/dart/class-diagram.svg new file mode 100644 index 0000000000..db98a9ad63 --- /dev/null +++ b/dart/class-diagram.svg @@ -0,0 +1,3364 @@ + + + + + + + + +cluster~ + +dart + + +cluster~/lib + +lib + + +cluster~/lib/src + +src + + +cluster~/lib/src/environment + +environment + + +cluster~/lib/src/protocol + +protocol + + +cluster~/lib/src/event_processor + +event_processor + + +cluster~/lib/src/event_processor/exception + +exception + + +cluster~/lib/src/event_processor/enricher + +enricher + + +cluster~/lib/src/platform + +platform + + +cluster~/lib/src/sentry_attachment + +sentry_attachment + + +cluster~/lib/src/http_client + +http_client + + +cluster~/lib/src/transport + +transport + + +cluster~/lib/src/utils + +utils + + +cluster~/lib/src/client_reports + +client_reports + + + +/lib/src/noop_hub.dart + +noop_hub + + + +/lib/src/sentry_client.dart + +sentry_client + + + +/lib/src/noop_hub.dart->/lib/src/sentry_client.dart + + + + + +/lib/src/sentry_options.dart + +sentry_options + + + +/lib/src/noop_hub.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/hint.dart + +hint + + + +/lib/src/noop_hub.dart->/lib/src/hint.dart + + + + + +/lib/src/tracing.dart + +tracing + + + +/lib/src/noop_hub.dart->/lib/src/tracing.dart + + + + + +/lib/src/protocol.dart + +protocol + + + +/lib/src/noop_hub.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_user_feedback.dart + +sentry_user_feedback + + + +/lib/src/noop_hub.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/scope.dart + +scope + + + +/lib/src/noop_hub.dart->/lib/src/scope.dart + + + + + +/lib/src/hub.dart + +hub + + + +/lib/src/noop_hub.dart->/lib/src/hub.dart + + + + + +/lib/src/sentry_event_like.dart + +sentry_event_like + + + +/lib/src/sentry_event_like.dart->/lib/src/protocol.dart + + + + + +/lib/src/version.dart + +version + + + +/lib/src/utils.dart + +utils + + + +/lib/src/sentry_span_context.dart + +sentry_span_context + + + +/lib/sentry.dart + +sentry + + + +/lib/src/sentry_span_context.dart->/lib/sentry.dart + + + + + +/lib/src/environment/_web_environment_variables.dart + +_web_environment_variables + + + +/lib/src/environment/keys.dart + +keys + + + +/lib/src/environment/_web_environment_variables.dart->/lib/src/environment/keys.dart + + + + + +/lib/src/environment/environment_variables.dart + +environment_variables + + + +/lib/src/environment/_web_environment_variables.dart->/lib/src/environment/environment_variables.dart + + + + + +/lib/src/environment/_io_environment_variables.dart + +_io_environment_variables + + + +/lib/src/environment/_io_environment_variables.dart->/lib/src/environment/_web_environment_variables.dart + + + + + +/lib/src/environment/_io_environment_variables.dart->/lib/src/environment/keys.dart + + + + + +/lib/src/environment/_io_environment_variables.dart->/lib/src/environment/environment_variables.dart + + + + + +/lib/src/platform_checker.dart + +platform_checker + + + +/lib/src/environment/environment_variables.dart->/lib/src/platform_checker.dart + + + + + +/lib/src/propagation_context.dart + +propagation_context + + + +/lib/src/sentry_baggage.dart + +sentry_baggage + + + +/lib/src/propagation_context.dart->/lib/src/sentry_baggage.dart + + + + + +/lib/src/propagation_context.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_trace_origins.dart + +sentry_trace_origins + + + +/lib/src/sentry_isolate_extension.dart + +sentry_isolate_extension + + + +/lib/src/hub_adapter.dart + +hub_adapter + + + +/lib/src/sentry_isolate_extension.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/sentry_isolate.dart + +sentry_isolate + + + +/lib/src/sentry_isolate_extension.dart->/lib/src/sentry_isolate.dart + + + + + +/lib/src/sentry_isolate_extension.dart->/lib/src/hub.dart + + + + + +/lib/src/sentry_item_type.dart + +sentry_item_type + + + +/lib/src/diagnostic_logger.dart + +diagnostic_logger + + + +/lib/src/diagnostic_logger.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/diagnostic_logger.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_traces_sampler.dart + +sentry_traces_sampler + + + +/lib/src/sentry_traces_sampler.dart->/lib/sentry.dart + + + + + +/lib/src/invalid_sentry_trace_header_exception.dart + +invalid_sentry_trace_header_exception + + + +/lib/src/sentry.dart + +sentry + + + +/lib/src/sentry.dart->/lib/src/noop_hub.dart + + + + + +/lib/src/sentry.dart->/lib/src/environment/environment_variables.dart + + + + + +/lib/src/sentry.dart->/lib/src/sentry_client.dart + + + + + +/lib/src/sentry.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/event_processor/deduplication_event_processor.dart + +deduplication_event_processor + + + +/lib/src/sentry.dart->/lib/src/event_processor/deduplication_event_processor.dart + + + + + +/lib/src/event_processor/exception/exception_event_processor.dart + +exception_event_processor + + + +/lib/src/sentry.dart->/lib/src/event_processor/exception/exception_event_processor.dart + + + + + +/lib/src/event_processor/enricher/enricher_event_processor.dart + +enricher_event_processor + + + +/lib/src/sentry.dart->/lib/src/event_processor/enricher/enricher_event_processor.dart + + + + + +/lib/src/sentry.dart->/lib/src/hint.dart + + + + + +/lib/src/sentry.dart->/lib/src/tracing.dart + + + + + +/lib/src/integration.dart + +integration + + + +/lib/src/sentry.dart->/lib/src/integration.dart + + + + + +/lib/src/sentry.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/sentry.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/run_zoned_guarded_integration.dart + +run_zoned_guarded_integration + + + +/lib/src/sentry.dart->/lib/src/run_zoned_guarded_integration.dart + + + + + +/lib/src/sentry.dart->/lib/src/hub.dart + + + + + +/lib/src/sentry_envelope_item.dart + +sentry_envelope_item + + + +/lib/src/sentry_envelope_item.dart->/lib/src/utils.dart + + + + + +/lib/src/sentry_envelope_item.dart->/lib/src/sentry_item_type.dart + + + + + +/lib/src/sentry_envelope_item_header.dart + +sentry_envelope_item_header + + + +/lib/src/sentry_envelope_item.dart->/lib/src/sentry_envelope_item_header.dart + + + + + +/lib/src/sentry_envelope_item.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_attachment/sentry_attachment.dart + +sentry_attachment + + + +/lib/src/sentry_envelope_item.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/src/sentry_envelope_item.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/client_reports/client_report.dart + +client_report + + + +/lib/src/sentry_envelope_item.dart->/lib/src/client_reports/client_report.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/version.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/sentry_baggage.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/hint.dart + + + + + +/lib/src/sentry_trace_context_header.dart + +sentry_trace_context_header + + + +/lib/src/sentry_client.dart->/lib/src/sentry_trace_context_header.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/transport/noop_transport.dart + +noop_transport + + + +/lib/src/sentry_client.dart->/lib/src/transport/noop_transport.dart + + + + + +/lib/src/transport/data_category.dart + +data_category + + + +/lib/src/sentry_client.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/transport/rate_limiter.dart + +rate_limiter + + + +/lib/src/sentry_client.dart->/lib/src/transport/rate_limiter.dart + + + + + +/lib/src/transport/http_transport.dart + +http_transport + + + +/lib/src/sentry_client.dart->/lib/src/transport/http_transport.dart + + + + + +/lib/src/sentry_client.dart->/lib/src/scope.dart + + + + + +/lib/src/event_processor.dart + +event_processor + + + +/lib/src/sentry_client.dart->/lib/src/event_processor.dart + + + + + +/lib/src/utils/isolate_utils.dart + +isolate_utils + + + +/lib/src/sentry_client.dart->/lib/src/utils/isolate_utils.dart + + + + + +/lib/src/client_reports/client_report_recorder.dart + +client_report_recorder + + + +/lib/src/sentry_client.dart->/lib/src/client_reports/client_report_recorder.dart + + + + + +/lib/src/client_reports/discard_reason.dart + +discard_reason + + + +/lib/src/sentry_client.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/sentry_stack_trace_factory.dart + +sentry_stack_trace_factory + + + +/lib/src/sentry_client.dart->/lib/src/sentry_stack_trace_factory.dart + + + + + +/lib/src/sentry_envelope.dart + +sentry_envelope + + + +/lib/src/sentry_client.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/src/sentry_exception_factory.dart + +sentry_exception_factory + + + +/lib/src/sentry_client.dart->/lib/src/sentry_exception_factory.dart + + + + + +/lib/src/protocol/span_id.dart + +span_id + + + +/lib/src/protocol/sentry_response.dart + +sentry_response + + + +/lib/src/protocol/contexts.dart + +contexts + + + +/lib/src/protocol/sentry_response.dart->/lib/src/protocol/contexts.dart + + + + + +/lib/src/utils/iterable_extension.dart + +iterable_extension + + + +/lib/src/protocol/sentry_response.dart->/lib/src/utils/iterable_extension.dart + + + + + +/lib/src/protocol/sentry_thread.dart + +sentry_thread + + + +/lib/src/protocol/sentry_stack_trace.dart + +sentry_stack_trace + + + +/lib/src/protocol/sentry_thread.dart->/lib/src/protocol/sentry_stack_trace.dart + + + + + +/lib/src/protocol/sentry_stack_frame.dart + +sentry_stack_frame + + + +/lib/src/protocol/sentry_transaction_info.dart + +sentry_transaction_info + + + +/lib/src/protocol/sentry_span.dart + +sentry_span + + + +/lib/src/protocol/sentry_span.dart->/lib/src/utils.dart + + + + + +/lib/src/protocol/sentry_span.dart->/lib/src/tracing.dart + + + + + +/lib/src/protocol/sentry_span.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_tracer.dart + +sentry_tracer + + + +/lib/src/protocol/sentry_span.dart->/lib/src/sentry_tracer.dart + + + + + +/lib/src/protocol/sentry_span.dart->/lib/src/hub.dart + + + + + +/lib/src/protocol/breadcrumb.dart + +breadcrumb + + + +/lib/src/protocol/breadcrumb.dart->/lib/src/utils.dart + + + + + +/lib/src/protocol/breadcrumb.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/sentry_request.dart + +sentry_request + + + +/lib/src/utils/http_sanitizer.dart + +http_sanitizer + + + +/lib/src/protocol/sentry_request.dart->/lib/src/utils/http_sanitizer.dart + + + + + +/lib/src/protocol/sentry_request.dart->/lib/src/utils/iterable_extension.dart + + + + + +/lib/src/protocol/sentry_level.dart + +sentry_level + + + +/lib/src/protocol/sdk_version.dart + +sdk_version + + + +/lib/src/protocol/sentry_package.dart + +sentry_package + + + +/lib/src/protocol/sdk_version.dart->/lib/src/protocol/sentry_package.dart + + + + + +/lib/src/protocol/sentry_trace_header.dart + +sentry_trace_header + + + +/lib/src/protocol/sentry_trace_header.dart->/lib/src/invalid_sentry_trace_header_exception.dart + + + + + +/lib/src/protocol/sentry_trace_header.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/sentry_transaction.dart + +sentry_transaction + + + +/lib/src/protocol/sentry_transaction.dart->/lib/src/utils.dart + + + + + +/lib/src/protocol/sentry_transaction.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/sentry_transaction.dart->/lib/src/sentry_tracer.dart + + + + + +/lib/src/sentry_measurement.dart + +sentry_measurement + + + +/lib/src/protocol/sentry_transaction.dart->/lib/src/sentry_measurement.dart + + + + + +/lib/src/protocol/sentry_id.dart + +sentry_id + + + +/lib/src/protocol/sentry_view_hierarchy_element.dart + +sentry_view_hierarchy_element + + + +/lib/src/protocol/sentry_culture.dart + +sentry_culture + + + +/lib/src/protocol/sentry_geo.dart + +sentry_geo + + + +/lib/src/protocol/debug_meta.dart + +debug_meta + + + +/lib/src/protocol/debug_meta.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/mechanism.dart + +mechanism + + + +/lib/src/protocol/sentry_app.dart + +sentry_app + + + +/lib/src/protocol/sentry_gpu.dart + +sentry_gpu + + + +/lib/src/protocol/sentry_trace_context.dart + +sentry_trace_context + + + +/lib/src/protocol/sentry_trace_context.dart->/lib/src/propagation_context.dart + + + + + +/lib/src/protocol/sentry_trace_context.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/sentry_trace_context.dart->/lib/sentry.dart + + + + + +/lib/src/protocol/contexts.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/debug_image.dart + +debug_image + + + +/lib/src/protocol/sentry_baggage_header.dart + +sentry_baggage_header + + + +/lib/src/protocol/sentry_baggage_header.dart->/lib/src/sentry_baggage.dart + + + + + +/lib/src/protocol/sentry_stack_trace.dart->/lib/src/protocol/sentry_stack_frame.dart + + + + + +/lib/src/protocol/sentry_runtime.dart + +sentry_runtime + + + +/lib/src/protocol/sentry_device.dart + +sentry_device + + + +/lib/src/protocol/sentry_device.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/protocol/sentry_message.dart + +sentry_message + + + +/lib/src/protocol/sdk_info.dart + +sdk_info + + + +/lib/src/protocol/max_body_size.dart + +max_body_size + + + +/lib/src/protocol/sentry_event.dart + +sentry_event + + + +/lib/src/protocol/sentry_event.dart->/lib/src/utils.dart + + + + + +/lib/src/throwable_mechanism.dart + +throwable_mechanism + + + +/lib/src/protocol/sentry_event.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/src/protocol/sentry_event.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/sentry_operating_system.dart + +sentry_operating_system + + + +/lib/src/protocol/sentry_user.dart + +sentry_user + + + +/lib/src/protocol/sentry_user.dart->/lib/sentry.dart + + + + + +/lib/src/protocol/sentry_exception.dart + +sentry_exception + + + +/lib/src/protocol/sentry_exception.dart->/lib/src/protocol.dart + + + + + +/lib/src/protocol/span_status.dart + +span_status + + + +/lib/src/protocol/sentry_transaction_name_source.dart + +sentry_transaction_name_source + + + +/lib/src/protocol/sentry_view_hierarchy.dart + +sentry_view_hierarchy + + + +/lib/src/protocol/sentry_view_hierarchy.dart->/lib/src/protocol/sentry_view_hierarchy_element.dart + + + + + +/lib/src/protocol/sentry_browser.dart + +sentry_browser + + + +/lib/src/protocol/dsn.dart + +dsn + + + +/lib/src/sentry_baggage.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_baggage.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_baggage.dart->/lib/src/scope.dart + + + + + +/lib/src/exception_stacktrace_extractor.dart + +exception_stacktrace_extractor + + + +/lib/src/exception_stacktrace_extractor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/exception_stacktrace_extractor.dart->/lib/src/protocol.dart + + + + + +/lib/src/isolate_error_integration.dart + +isolate_error_integration + + + +/lib/src/isolate_error_integration.dart->/lib/src/sentry_isolate_extension.dart + + + + + +/lib/src/isolate_error_integration.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/isolate_error_integration.dart->/lib/src/integration.dart + + + + + +/lib/src/isolate_error_integration.dart->/lib/src/hub.dart + + + + + +/lib/src/throwable_mechanism.dart->/lib/src/protocol/mechanism.dart + + + + + +/lib/src/type_check_hint.dart + +type_check_hint + + + +/lib/src/http_client/failed_request_client.dart + +failed_request_client + + + +/lib/src/type_check_hint.dart->/lib/src/http_client/failed_request_client.dart + + + + + +/lib/src/sentry_client_stub.dart + +sentry_client_stub + + + +/lib/src/sentry_client_stub.dart->/lib/src/sentry_client.dart + + + + + +/lib/src/sentry_client_stub.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/version.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/environment/environment_variables.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/diagnostic_logger.dart + + + + + +/lib/src/noop_client.dart + +noop_client + + + +/lib/src/sentry_options.dart->/lib/src/noop_client.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/transport/noop_transport.dart + + + + + +/lib/src/client_reports/noop_client_report_recorder.dart + +noop_client_report_recorder + + + +/lib/src/sentry_options.dart->/lib/src/client_reports/noop_client_report_recorder.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/client_reports/client_report_recorder.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/sentry_stack_trace_factory.dart + + + + + +/lib/src/sentry_options.dart->/lib/src/sentry_exception_factory.dart + + + + + +/lib/src/sentry_options.dart->/lib/sentry.dart + + + + + +/lib/src/event_processor/deduplication_event_processor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/event_processor/deduplication_event_processor.dart->/lib/src/hint.dart + + + + + +/lib/src/event_processor/deduplication_event_processor.dart->/lib/src/protocol.dart + + + + + +/lib/src/event_processor/deduplication_event_processor.dart->/lib/src/event_processor.dart + + + + + +/lib/src/event_processor/exception/exception_event_processor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/event_processor/exception/exception_event_processor.dart->/lib/src/event_processor.dart + + + + + +/lib/src/event_processor/exception/web_exception_event_processor.dart + +web_exception_event_processor + + + +/lib/src/event_processor/exception/web_exception_event_processor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/event_processor/exception/web_exception_event_processor.dart->/lib/src/event_processor/exception/exception_event_processor.dart + + + + + +/lib/src/event_processor/exception/web_exception_event_processor.dart->/lib/src/hint.dart + + + + + +/lib/src/event_processor/exception/web_exception_event_processor.dart->/lib/src/protocol.dart + + + + + +/lib/src/event_processor/exception/io_exception_event_processor.dart + +io_exception_event_processor + + + +/lib/src/event_processor/exception/io_exception_event_processor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/event_processor/exception/io_exception_event_processor.dart->/lib/src/event_processor/exception/exception_event_processor.dart + + + + + +/lib/src/event_processor/exception/io_exception_event_processor.dart->/lib/src/hint.dart + + + + + +/lib/src/event_processor/exception/io_exception_event_processor.dart->/lib/src/protocol.dart + + + + + +/lib/src/event_processor/enricher/io_enricher_event_processor.dart + +io_enricher_event_processor + + + +/lib/src/event_processor/enricher/io_enricher_event_processor.dart->/lib/src/event_processor/enricher/enricher_event_processor.dart + + + + + +/lib/src/event_processor/enricher/io_enricher_event_processor.dart->/lib/sentry.dart + + + + + +/lib/src/event_processor/enricher/enricher_event_processor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/event_processor/enricher/enricher_event_processor.dart->/lib/src/event_processor.dart + + + + + +/lib/src/event_processor/enricher/web_enricher_event_processor.dart + +web_enricher_event_processor + + + +/lib/src/event_processor/enricher/web_enricher_event_processor.dart->/lib/src/event_processor/enricher/enricher_event_processor.dart + + + + + +/lib/src/event_processor/enricher/web_enricher_event_processor.dart->/lib/sentry.dart + + + + + +/lib/src/platform/platform.dart + +platform + + + +/lib/src/platform/_web_platform.dart + +_web_platform + + + +/lib/src/platform/_web_platform.dart->/lib/src/platform/platform.dart + + + + + +/lib/src/platform/_io_platform.dart + +_io_platform + + + +/lib/src/platform/_io_platform.dart->/lib/src/platform/platform.dart + + + + + +/lib/src/hint.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/src/platform_checker.dart->/lib/src/platform/platform.dart + + + + + +/lib/src/tracing.dart->/lib/src/sentry_span_context.dart + + + + + +/lib/src/tracing.dart->/lib/src/invalid_sentry_trace_header_exception.dart + + + + + +/lib/src/tracing.dart->/lib/src/sentry_trace_context_header.dart + + + + + +/lib/src/sentry_measurement_unit.dart + +sentry_measurement_unit + + + +/lib/src/tracing.dart->/lib/src/sentry_measurement_unit.dart + + + + + +/lib/src/sentry_transaction_context.dart + +sentry_transaction_context + + + +/lib/src/tracing.dart->/lib/src/sentry_transaction_context.dart + + + + + +/lib/src/sentry_span_interface.dart + +sentry_span_interface + + + +/lib/src/tracing.dart->/lib/src/sentry_span_interface.dart + + + + + +/lib/src/sentry_traces_sampling_decision.dart + +sentry_traces_sampling_decision + + + +/lib/src/tracing.dart->/lib/src/sentry_traces_sampling_decision.dart + + + + + +/lib/src/noop_sentry_span.dart + +noop_sentry_span + + + +/lib/src/tracing.dart->/lib/src/noop_sentry_span.dart + + + + + +/lib/src/tracing.dart->/lib/src/sentry_measurement.dart + + + + + +/lib/src/sentry_sampling_context.dart + +sentry_sampling_context + + + +/lib/src/tracing.dart->/lib/src/sentry_sampling_context.dart + + + + + +/lib/src/exception_cause.dart + +exception_cause + + + +/lib/src/noop_isolate_error_integration.dart + +noop_isolate_error_integration + + + +/lib/src/noop_isolate_error_integration.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/noop_isolate_error_integration.dart->/lib/src/integration.dart + + + + + +/lib/src/noop_isolate_error_integration.dart->/lib/src/hub.dart + + + + + +/lib/src/sentry_trace_context_header.dart->/lib/src/protocol/sentry_id.dart + + + + + +/lib/src/sentry_trace_context_header.dart->/lib/src/sentry_baggage.dart + + + + + +/lib/src/sentry_trace_context_header.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/integration.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/integration.dart->/lib/src/hub.dart + + + + + +/lib/src/protocol.dart->/lib/src/sentry_event_like.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/span_id.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_response.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_thread.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_stack_frame.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_transaction_info.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_span.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/breadcrumb.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_request.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_level.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sdk_version.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_trace_header.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_transaction.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_id.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_view_hierarchy_element.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_culture.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_geo.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/debug_meta.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/mechanism.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_app.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_gpu.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_trace_context.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/contexts.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/debug_image.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_baggage_header.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_stack_trace.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_runtime.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_device.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_message.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sdk_info.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/max_body_size.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_package.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_event.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_operating_system.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_user.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_exception.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/span_status.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_transaction_name_source.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_view_hierarchy.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/sentry_browser.dart + + + + + +/lib/src/protocol.dart->/lib/src/protocol/dsn.dart + + + + + +/lib/src/sentry_attachment/io_sentry_attachment.dart + +io_sentry_attachment + + + +/lib/src/sentry_attachment/io_sentry_attachment.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/src/sentry_attachment/sentry_attachment.dart->/lib/src/utils.dart + + + + + +/lib/src/sentry_attachment/sentry_attachment.dart->/lib/src/protocol/sentry_view_hierarchy.dart + + + + + +/lib/src/exception_cause_extractor.dart + +exception_cause_extractor + + + +/lib/src/exception_cause_extractor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/exception_cause_extractor.dart->/lib/src/exception_cause.dart + + + + + +/lib/src/exception_cause_extractor.dart->/lib/src/protocol.dart + + + + + +/lib/src/noop_sentry_client.dart + +noop_sentry_client + + + +/lib/src/noop_sentry_client.dart->/lib/src/sentry_client.dart + + + + + +/lib/src/noop_sentry_client.dart->/lib/src/hint.dart + + + + + +/lib/src/noop_sentry_client.dart->/lib/src/sentry_trace_context_header.dart + + + + + +/lib/src/noop_sentry_client.dart->/lib/src/protocol.dart + + + + + +/lib/src/noop_sentry_client.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/noop_sentry_client.dart->/lib/src/scope.dart + + + + + +/lib/src/noop_sentry_client.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/src/sentry_transaction_context.dart->/lib/src/sentry_trace_origins.dart + + + + + +/lib/src/sentry_transaction_context.dart->/lib/src/sentry_baggage.dart + + + + + +/lib/src/sentry_transaction_context.dart->/lib/src/tracing.dart + + + + + +/lib/src/sentry_transaction_context.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_tracer_finish_status.dart + +sentry_tracer_finish_status + + + +/lib/src/sentry_tracer.dart->/lib/src/sentry_tracer_finish_status.dart + + + + + +/lib/src/utils/sample_rate_format.dart + +sample_rate_format + + + +/lib/src/sentry_tracer.dart->/lib/src/utils/sample_rate_format.dart + + + + + +/lib/src/sentry_tracer.dart->/lib/sentry.dart + + + + + +/lib/src/sentry_span_interface.dart->/lib/src/tracing.dart + + + + + +/lib/src/sentry_span_interface.dart->/lib/src/protocol.dart + + + + + +/lib/src/noop_origin.dart + +noop_origin + + + +/lib/src/hub_adapter.dart->/lib/src/sentry.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/sentry_client.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/hint.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/tracing.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/protocol.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/scope.dart + + + + + +/lib/src/hub_adapter.dart->/lib/src/hub.dart + + + + + +/lib/src/sentry_user_feedback.dart->/lib/src/protocol.dart + + + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/type_check_hint.dart + + + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/hint.dart + + + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/protocol.dart + + + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/http_client/sentry_http_client.dart + +sentry_http_client + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/http_client/sentry_http_client.dart + + + + + +/lib/src/http_client/sentry_http_client_error.dart + +sentry_http_client_error + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/http_client/sentry_http_client_error.dart + + + + + +/lib/src/utils/tracing_utils.dart + +tracing_utils + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/utils/tracing_utils.dart + + + + + +/lib/src/http_client/failed_request_client.dart->/lib/src/hub.dart + + + + + +/lib/src/http_client/sentry_http_client.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/http_client/sentry_http_client.dart->/lib/src/http_client/failed_request_client.dart + + + + + +/lib/src/http_client/breadcrumb_client.dart + +breadcrumb_client + + + +/lib/src/http_client/sentry_http_client.dart->/lib/src/http_client/breadcrumb_client.dart + + + + + +/lib/src/http_client/tracing_client.dart + +tracing_client + + + +/lib/src/http_client/sentry_http_client.dart->/lib/src/http_client/tracing_client.dart + + + + + +/lib/src/http_client/sentry_http_client.dart->/lib/src/hub.dart + + + + + +/lib/src/http_client/breadcrumb_client.dart->/lib/src/protocol.dart + + + + + +/lib/src/http_client/breadcrumb_client.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/http_client/breadcrumb_client.dart->/lib/src/utils/http_sanitizer.dart + + + + + +/lib/src/utils/url_details.dart + +url_details + + + +/lib/src/http_client/breadcrumb_client.dart->/lib/src/utils/url_details.dart + + + + + +/lib/src/http_client/breadcrumb_client.dart->/lib/src/hub.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/sentry_trace_origins.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/tracing.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/protocol.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/utils/http_sanitizer.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/utils/tracing_utils.dart + + + + + +/lib/src/http_client/tracing_client.dart->/lib/src/hub.dart + + + + + +/lib/src/noop_sentry_span.dart->/lib/src/utils.dart + + + + + +/lib/src/noop_sentry_span.dart->/lib/src/tracing.dart + + + + + +/lib/src/noop_sentry_span.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_tracer_finish_status.dart->/lib/sentry.dart + + + + + +/lib/src/run_zoned_guarded_integration.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/src/run_zoned_guarded_integration.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/run_zoned_guarded_integration.dart->/lib/src/integration.dart + + + + + +/lib/src/run_zoned_guarded_integration.dart->/lib/src/protocol.dart + + + + + +/lib/src/run_zoned_guarded_integration.dart->/lib/src/hub.dart + + + + + +/lib/src/transport/noop_transport.dart->/lib/src/protocol.dart + + + + + +/lib/src/transport/transport.dart + +transport + + + +/lib/src/transport/noop_transport.dart->/lib/src/transport/transport.dart + + + + + +/lib/src/transport/noop_transport.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/src/transport/rate_limit_parser.dart + +rate_limit_parser + + + +/lib/src/transport/rate_limit_parser.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/transport/rate_limit.dart + +rate_limit + + + +/lib/src/transport/rate_limit_parser.dart->/lib/src/transport/rate_limit.dart + + + + + +/lib/src/transport/noop_encode.dart + +noop_encode + + + +/lib/src/transport/transport.dart->/lib/src/protocol.dart + + + + + +/lib/src/transport/transport.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/sentry_envelope_item.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/transport/rate_limit_parser.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/transport/rate_limit.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/transport/rate_limiter.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/src/transport/encode.dart + +encode + + + +/lib/src/transport/rate_limit.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/noop_client.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/protocol.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/transport/noop_encode.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/transport/transport.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/transport/rate_limiter.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/client_reports/client_report_recorder.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/transport/http_transport.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/src/recursive_exception_cause_extractor.dart + +recursive_exception_cause_extractor + + + +/lib/src/recursive_exception_cause_extractor.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/src/recursive_exception_cause_extractor.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/recursive_exception_cause_extractor.dart->/lib/src/exception_cause.dart + + + + + +/lib/src/recursive_exception_cause_extractor.dart->/lib/src/protocol.dart + + + + + +/lib/src/scope.dart->/lib/src/propagation_context.dart + + + + + +/lib/src/scope.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/scope.dart->/lib/src/hint.dart + + + + + +/lib/src/scope.dart->/lib/src/protocol.dart + + + + + +/lib/src/scope.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/src/scope.dart->/lib/src/sentry_tracer.dart + + + + + +/lib/src/scope.dart->/lib/src/sentry_span_interface.dart + + + + + +/lib/src/scope.dart->/lib/src/event_processor.dart + + + + + +/lib/src/scope_observer.dart + +scope_observer + + + +/lib/src/scope.dart->/lib/src/scope_observer.dart + + + + + +/lib/src/event_processor.dart->/lib/src/hint.dart + + + + + +/lib/src/event_processor.dart->/lib/src/protocol.dart + + + + + +/lib/src/utils/http_sanitizer.dart->/lib/src/protocol.dart + + + + + +/lib/src/utils/http_sanitizer.dart->/lib/src/utils/url_details.dart + + + + + +/lib/src/utils/url_details.dart->/lib/sentry.dart + + + + + +/lib/src/utils/http_header_utils.dart + +http_header_utils + + + +/lib/src/utils/_web_get_isolate_name.dart + +_web_get_isolate_name + + + +/lib/src/utils/tracing_utils.dart->/lib/sentry.dart + + + + + +/lib/src/utils/_io_get_isolate_name.dart + +_io_get_isolate_name + + + +/lib/src/client_reports/client_report.dart->/lib/src/utils.dart + + + + + +/lib/src/client_reports/discarded_event.dart + +discarded_event + + + +/lib/src/client_reports/client_report.dart->/lib/src/client_reports/discarded_event.dart + + + + + +/lib/src/client_reports/noop_client_report_recorder.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/client_reports/noop_client_report_recorder.dart->/lib/src/client_reports/client_report.dart + + + + + +/lib/src/client_reports/noop_client_report_recorder.dart->/lib/src/client_reports/client_report_recorder.dart + + + + + +/lib/src/client_reports/noop_client_report_recorder.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/client_reports/discarded_event.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/client_reports/discarded_event.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/client_reports/client_report_recorder.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/client_reports/client_report_recorder.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/client_reports/client_report_recorder.dart->/lib/src/client_reports/client_report.dart + + + + + +/lib/src/client_reports/client_report_recorder.dart->/lib/src/client_reports/discarded_event.dart + + + + + +/lib/src/client_reports/client_report_recorder.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/sentry_stack_trace_factory.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_stack_trace_factory.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_stack_trace_factory.dart->/lib/src/noop_origin.dart + + + + + +/lib/src/sentry_measurement.dart->/lib/src/sentry_measurement_unit.dart + + + + + +/lib/src/sentry_envelope_header.dart + +sentry_envelope_header + + + +/lib/src/sentry_envelope_header.dart->/lib/src/utils.dart + + + + + +/lib/src/sentry_envelope_header.dart->/lib/src/protocol/sdk_version.dart + + + + + +/lib/src/sentry_envelope_header.dart->/lib/src/protocol/sentry_id.dart + + + + + +/lib/src/sentry_envelope_header.dart->/lib/src/sentry_trace_context_header.dart + + + + + +/lib/src/sentry_isolate.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/src/sentry_isolate.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_isolate.dart->/lib/src/hub_adapter.dart + + + + + +/lib/src/sentry_isolate.dart->/lib/src/hub.dart + + + + + +/lib/src/scope_observer.dart->/lib/src/protocol/breadcrumb.dart + + + + + +/lib/src/scope_observer.dart->/lib/src/protocol/sentry_user.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/utils.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_item_type.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_envelope_item.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_trace_context_header.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/client_reports/client_report.dart + + + + + +/lib/src/sentry_envelope.dart->/lib/src/sentry_envelope_header.dart + + + + + +/lib/src/sentry_sampling_context.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_sampling_context.dart->/lib/src/tracing.dart + + + + + +/lib/src/sentry_exception_factory.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/src/sentry_exception_factory.dart->/lib/src/sentry_options.dart + + + + + +/lib/src/sentry_exception_factory.dart->/lib/src/protocol.dart + + + + + +/lib/src/sentry_exception_factory.dart->/lib/src/recursive_exception_cause_extractor.dart + + + + + +/lib/src/sentry_exception_factory.dart->/lib/src/sentry_stack_trace_factory.dart + + + + + +/lib/src/hub.dart->/lib/src/propagation_context.dart + + + + + +/lib/src/hub.dart->/lib/src/sentry_traces_sampler.dart + + + + + +/lib/src/hub.dart->/lib/src/sentry_tracer.dart + + + + + +/lib/src/hub.dart->/lib/src/transport/data_category.dart + + + + + +/lib/src/hub.dart->/lib/src/client_reports/discard_reason.dart + + + + + +/lib/src/hub.dart->/lib/sentry.dart + + + + + +/lib/src/origin.dart + +origin + + + +/lib/sentry.dart->/lib/src/utils.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_trace_origins.dart + + + + + +/lib/sentry.dart->/lib/src/sentry.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_envelope_item.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_client.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_baggage.dart + + + + + +/lib/sentry.dart->/lib/src/exception_stacktrace_extractor.dart + + + + + +/lib/sentry.dart->/lib/src/throwable_mechanism.dart + + + + + +/lib/sentry.dart->/lib/src/type_check_hint.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_options.dart + + + + + +/lib/sentry.dart->/lib/src/hint.dart + + + + + +/lib/sentry.dart->/lib/src/platform_checker.dart + + + + + +/lib/sentry.dart->/lib/src/tracing.dart + + + + + +/lib/sentry.dart->/lib/src/exception_cause.dart + + + + + +/lib/sentry.dart->/lib/src/integration.dart + + + + + +/lib/sentry.dart->/lib/src/protocol.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_attachment/sentry_attachment.dart + + + + + +/lib/sentry.dart->/lib/src/exception_cause_extractor.dart + + + + + +/lib/sentry.dart->/lib/src/hub_adapter.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_user_feedback.dart + + + + + +/lib/sentry.dart->/lib/src/http_client/sentry_http_client.dart + + + + + +/lib/sentry.dart->/lib/src/http_client/sentry_http_client_error.dart + + + + + +/lib/sentry.dart->/lib/src/run_zoned_guarded_integration.dart + + + + + +/lib/sentry.dart->/lib/src/transport/transport.dart + + + + + +/lib/sentry.dart->/lib/src/scope.dart + + + + + +/lib/sentry.dart->/lib/src/event_processor.dart + + + + + +/lib/sentry.dart->/lib/src/utils/http_sanitizer.dart + + + + + +/lib/sentry.dart->/lib/src/utils/url_details.dart + + + + + +/lib/sentry.dart->/lib/src/utils/http_header_utils.dart + + + + + +/lib/sentry.dart->/lib/src/utils/tracing_utils.dart + + + + + +/lib/sentry.dart->/lib/src/scope_observer.dart + + + + + +/lib/sentry.dart->/lib/src/sentry_envelope.dart + + + + + +/lib/sentry.dart->/lib/src/hub.dart + + + + + +/lib/sentry_io.dart + +sentry_io + + + +/lib/sentry_io.dart->/lib/src/sentry_isolate_extension.dart + + + + + +/lib/sentry_io.dart->/lib/src/sentry_attachment/io_sentry_attachment.dart + + + + + +/lib/sentry_io.dart->/lib/src/sentry_isolate.dart + + + + + +/lib/sentry_io.dart->/lib/sentry.dart + + + + + diff --git a/dart/lib/sentry.dart b/dart/lib/sentry.dart index 9d06bb7e2a..5419aa45b8 100644 --- a/dart/lib/sentry.dart +++ b/dart/lib/sentry.dart @@ -3,6 +3,8 @@ // found in the LICENSE file. /// A pure Dart client for Sentry.io crash reporting. +library sentry_dart; + export 'src/run_zoned_guarded_integration.dart'; export 'src/hub.dart'; // useful for tests @@ -48,3 +50,5 @@ export 'src/utils/http_header_utils.dart'; export 'src/sentry_trace_origins.dart'; // ignore: invalid_export_of_internal_element export 'src/utils.dart'; +// spotlight debugging +export 'src/spotlight.dart'; diff --git a/dart/lib/src/diagnostic_logger.dart b/dart/lib/src/diagnostic_logger.dart index 9a393f974f..ca523c12ae 100644 --- a/dart/lib/src/diagnostic_logger.dart +++ b/dart/lib/src/diagnostic_logger.dart @@ -26,6 +26,8 @@ class DiagnosticLogger { } bool _isEnabled(SentryLevel level) { - return _options.debug && level.ordinal >= _options.diagnosticLevel.ordinal; + return _options.debug && + level.ordinal >= _options.diagnosticLevel.ordinal || + level == SentryLevel.fatal; } } diff --git a/dart/lib/src/hint.dart b/dart/lib/src/hint.dart index f14f69d5dc..5d8dbf1f0a 100644 --- a/dart/lib/src/hint.dart +++ b/dart/lib/src/hint.dart @@ -40,7 +40,7 @@ import 'sentry_attachment/sentry_attachment.dart'; /// }; /// ``` class Hint { - final Map _internalStorage = {}; + final Map _internalStorage = {}; final List attachments = []; @@ -62,7 +62,7 @@ class Hint { return hint; } - factory Hint.withMap(Map map) { + factory Hint.withMap(Map map) { final hint = Hint(); hint.addAll(map); return hint; @@ -80,17 +80,19 @@ class Hint { return hint; } - // Objects + // Key/Value Storage - void addAll(Map keysAndValues) { - _internalStorage.addAll(keysAndValues); + void addAll(Map keysAndValues) { + final withoutNullValues = + keysAndValues.map((key, value) => MapEntry(key, value ?? "null")); + _internalStorage.addAll(withoutNullValues); } - void set(String key, Object value) { - _internalStorage[key] = value; + void set(String key, dynamic value) { + _internalStorage[key] = value ?? "null"; } - Object? get(String key) { + dynamic get(String key) { return _internalStorage[key]; } diff --git a/dart/lib/src/http_client/tracing_client.dart b/dart/lib/src/http_client/tracing_client.dart index ae7a81e973..95627724c3 100644 --- a/dart/lib/src/http_client/tracing_client.dart +++ b/dart/lib/src/http_client/tracing_client.dart @@ -41,20 +41,33 @@ class TracingClient extends BaseClient { span = null; } - span?.setData('http.method', request.method); + span?.setData('http.request.method', request.method); urlDetails?.applyToSpan(span); StreamedResponse? response; try { - if (span != null) { - if (containsTargetOrMatchesRegExp( - _hub.options.tracePropagationTargets, request.url.toString())) { - addSentryTraceHeader(span, request.headers); - addBaggageHeader( + if (containsTargetOrMatchesRegExp( + _hub.options.tracePropagationTargets, request.url.toString())) { + if (span != null) { + addSentryTraceHeaderFromSpan(span, request.headers); + addBaggageHeaderFromSpan( span, request.headers, logger: _hub.options.logger, ); + } else { + final scope = _hub.scope; + final propagationContext = scope.propagationContext; + + final traceHeader = propagationContext.toSentryTrace(); + addSentryTraceHeader(traceHeader, request.headers); + + final baggage = propagationContext.baggage; + if (baggage != null) { + final baggageHeader = SentryBaggageHeader.fromBaggage(baggage); + addBaggageHeader(baggageHeader, request.headers, + logger: _hub.options.logger); + } } } diff --git a/dart/lib/src/hub.dart b/dart/lib/src/hub.dart index e1ffe802dd..42291d1c87 100644 --- a/dart/lib/src/hub.dart +++ b/dart/lib/src/hub.dart @@ -2,6 +2,8 @@ import 'dart:async'; import 'dart:collection'; import 'package:meta/meta.dart'; +import 'profiling.dart'; +import 'propagation_context.dart'; import 'transport/data_category.dart'; import '../sentry.dart'; @@ -65,6 +67,9 @@ class Hub { /// Last event id recorded by the Hub SentryId get lastEventId => _lastEventId; + @internal + Scope get scope => _peek().scope; + /// Captures the event. Future captureEvent( SentryEvent event, { @@ -273,7 +278,7 @@ class Hub { exception: exception, stackTrace: stackTrace, ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } @@ -373,7 +378,7 @@ class Hub { SentryLevel.error, "Error in the 'configureScope' callback, error: $err", ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } @@ -426,19 +431,17 @@ class Hub { "Instance is disabled and this 'startTransaction' call is a no-op.", ); } else if (!_options.isTracingEnabled()) { - _options.logger( - SentryLevel.info, - "Tracing is disabled and this 'startTransaction' returns a no-op.", - ); + final item = _peek(); + item.scope.propagationContext = PropagationContext(); } else { final item = _peek(); - final samplingContext = SentrySamplingContext( - transactionContext, customSamplingContext ?? {}); - // if transactionContext has no sampled decision, run the traces sampler - if (transactionContext.samplingDecision == null) { - final samplingDecision = _tracesSampler.sample(samplingContext); + var samplingDecision = transactionContext.samplingDecision; + if (samplingDecision == null) { + final samplingContext = SentrySamplingContext( + transactionContext, customSamplingContext ?? {}); + samplingDecision = _tracesSampler.sample(samplingContext); transactionContext = transactionContext.copyWith(samplingDecision: samplingDecision); } @@ -449,6 +452,12 @@ class Hub { ); } + SentryProfiler? profiler; + if (_profilerFactory != null && + _tracesSampler.sampleProfiling(samplingDecision)) { + profiler = _profilerFactory?.startProfiler(transactionContext); + } + final tracer = SentryTracer( transactionContext, this, @@ -457,6 +466,7 @@ class Hub { autoFinishAfter: autoFinishAfter, trimEnd: trimEnd ?? false, onFinish: onFinish, + profiler: profiler, ); if (bindToScope ?? false) { item.scope.span = tracer; @@ -552,6 +562,14 @@ class Hub { ) => _throwableToSpan.add(throwable, span, transaction); + @internal + SentryProfilerFactory? get profilerFactory => _profilerFactory; + + @internal + set profilerFactory(SentryProfilerFactory? value) => _profilerFactory = value; + + SentryProfilerFactory? _profilerFactory; + SentryEvent _assignTraceContext(SentryEvent event) { // assign trace context if (event.throwable != null && event.contexts.trace == null) { @@ -587,6 +605,8 @@ class _WeakMap { final SentryOptions _options; + final throwableHandler = UnsupportedThrowablesHandler(); + _WeakMap(this._options); void add( @@ -597,6 +617,7 @@ class _WeakMap { if (throwable == null) { return; } + throwable = throwableHandler.wrapIfUnsupportedType(throwable); try { if (_expando[throwable] == null) { _expando[throwable] = MapEntry(span, transaction); @@ -615,6 +636,7 @@ class _WeakMap { if (throwable == null) { return null; } + throwable = throwableHandler.wrapIfUnsupportedType(throwable); try { return _expando[throwable] as MapEntry?; } catch (exception, stackTrace) { @@ -628,3 +650,35 @@ class _WeakMap { return null; } } + +/// A handler for unsupported throwables used for Expando. +@visibleForTesting +class UnsupportedThrowablesHandler { + final _unsupportedTypes = {String, int, double, bool}; + final _unsupportedThrowables = {}; + + dynamic wrapIfUnsupportedType(dynamic throwable) { + if (_unsupportedTypes.contains(throwable.runtimeType)) { + throwable = _UnsupportedExceptionWrapper(Exception(throwable)); + _unsupportedThrowables.add(throwable); + } + return _unsupportedThrowables.lookup(throwable) ?? throwable; + } +} + +class _UnsupportedExceptionWrapper { + _UnsupportedExceptionWrapper(this.exception); + + final Exception exception; + + @override + bool operator ==(Object other) { + if (other is _UnsupportedExceptionWrapper) { + return other.exception.toString() == exception.toString(); + } + return false; + } + + @override + int get hashCode => exception.toString().hashCode; +} diff --git a/dart/lib/src/hub_adapter.dart b/dart/lib/src/hub_adapter.dart index 8c1a176df8..8a9107ae54 100644 --- a/dart/lib/src/hub_adapter.dart +++ b/dart/lib/src/hub_adapter.dart @@ -4,7 +4,9 @@ import 'package:meta/meta.dart'; import 'hint.dart'; import 'hub.dart'; +import 'profiling.dart'; import 'protocol.dart'; +import 'scope.dart'; import 'sentry.dart'; import 'sentry_client.dart'; import 'sentry_user_feedback.dart'; @@ -166,4 +168,17 @@ class HubAdapter implements Hub { String transaction, ) => Sentry.currentHub.setSpanContext(throwable, span, transaction); + + @internal + @override + set profilerFactory(SentryProfilerFactory? value) => + Sentry.currentHub.profilerFactory = value; + + @internal + @override + SentryProfilerFactory? get profilerFactory => + Sentry.currentHub.profilerFactory; + + @override + Scope get scope => Sentry.currentHub.scope; } diff --git a/dart/lib/src/noop_hub.dart b/dart/lib/src/noop_hub.dart index ea005184b6..06d31e7da2 100644 --- a/dart/lib/src/noop_hub.dart +++ b/dart/lib/src/noop_hub.dart @@ -4,7 +4,9 @@ import 'package:meta/meta.dart'; import 'hint.dart'; import 'hub.dart'; +import 'profiling.dart'; import 'protocol.dart'; +import 'scope.dart'; import 'sentry_client.dart'; import 'sentry_options.dart'; import 'sentry_user_feedback.dart'; @@ -118,4 +120,15 @@ class NoOpHub implements Hub { @override void setSpanContext(throwable, ISentrySpan span, String transaction) {} + + @internal + @override + set profilerFactory(SentryProfilerFactory? value) {} + + @internal + @override + SentryProfilerFactory? get profilerFactory => null; + + @override + Scope get scope => Scope(_options); } diff --git a/dart/lib/src/profiling.dart b/dart/lib/src/profiling.dart new file mode 100644 index 0000000000..d0ed997313 --- /dev/null +++ b/dart/lib/src/profiling.dart @@ -0,0 +1,22 @@ +import 'dart:async'; + +import 'package:meta/meta.dart'; + +import '../sentry.dart'; + +@internal +abstract class SentryProfilerFactory { + SentryProfiler? startProfiler(SentryTransactionContext context); +} + +@internal +abstract class SentryProfiler { + Future finishFor(SentryTransaction transaction); + void dispose(); +} + +// See https://develop.sentry.dev/sdk/profiles/ +@internal +abstract class SentryProfileInfo { + SentryEnvelopeItem asEnvelopeItem(); +} diff --git a/dart/lib/src/propagation_context.dart b/dart/lib/src/propagation_context.dart new file mode 100644 index 0000000000..1a0f32355a --- /dev/null +++ b/dart/lib/src/propagation_context.dart @@ -0,0 +1,12 @@ +import 'package:meta/meta.dart'; +import 'protocol.dart'; +import 'sentry_baggage.dart'; + +@internal +class PropagationContext { + late SentryId traceId = SentryId.newId(); + late SpanId spanId = SpanId.newId(); + SentryBaggage? baggage; + + SentryTraceHeader toSentryTrace() => SentryTraceHeader(traceId, spanId); +} diff --git a/dart/lib/src/protocol/sentry_app.dart b/dart/lib/src/protocol/sentry_app.dart index 67accebe1a..b5163e5856 100644 --- a/dart/lib/src/protocol/sentry_app.dart +++ b/dart/lib/src/protocol/sentry_app.dart @@ -18,6 +18,7 @@ class SentryApp { this.deviceAppHash, this.appMemory, this.inForeground, + this.viewNames, }); /// Human readable application name, as it appears on the platform. @@ -48,20 +49,27 @@ class SentryApp { /// An app is in foreground when it's visible to the user. final bool? inForeground; + /// The names of the currently visible views. + final List? viewNames; + /// Deserializes a [SentryApp] from JSON [Map]. - factory SentryApp.fromJson(Map data) => SentryApp( - name: data['app_name'], - version: data['app_version'], - identifier: data['app_identifier'], - build: data['app_build'], - buildType: data['build_type'], - startTime: data['app_start_time'] != null - ? DateTime.tryParse(data['app_start_time']) - : null, - deviceAppHash: data['device_app_hash'], - appMemory: data['app_memory'], - inForeground: data['in_foreground'], - ); + factory SentryApp.fromJson(Map data) { + final viewNamesJson = data['view_names'] as List?; + return SentryApp( + name: data['app_name'], + version: data['app_version'], + identifier: data['app_identifier'], + build: data['app_build'], + buildType: data['build_type'], + startTime: data['app_start_time'] != null + ? DateTime.tryParse(data['app_start_time']) + : null, + deviceAppHash: data['device_app_hash'], + appMemory: data['app_memory'], + inForeground: data['in_foreground'], + viewNames: viewNamesJson?.map((e) => e as String).toList(), + ); + } /// Produces a [Map] that can be serialized to JSON. Map toJson() { @@ -71,10 +79,11 @@ class SentryApp { if (identifier != null) 'app_identifier': identifier!, if (build != null) 'app_build': build!, if (buildType != null) 'build_type': buildType!, + if (startTime != null) 'app_start_time': startTime!.toIso8601String(), if (deviceAppHash != null) 'device_app_hash': deviceAppHash!, if (appMemory != null) 'app_memory': appMemory!, - if (startTime != null) 'app_start_time': startTime!.toIso8601String(), if (inForeground != null) 'in_foreground': inForeground!, + if (viewNames != null && viewNames!.isNotEmpty) 'view_names': viewNames!, }; } @@ -88,6 +97,7 @@ class SentryApp { deviceAppHash: deviceAppHash, appMemory: appMemory, inForeground: inForeground, + viewNames: viewNames, ); SentryApp copyWith({ @@ -100,6 +110,7 @@ class SentryApp { String? deviceAppHash, int? appMemory, bool? inForeground, + List? viewNames, }) => SentryApp( name: name ?? this.name, @@ -111,5 +122,6 @@ class SentryApp { deviceAppHash: deviceAppHash ?? this.deviceAppHash, appMemory: appMemory ?? this.appMemory, inForeground: inForeground ?? this.inForeground, + viewNames: viewNames ?? this.viewNames, ); } diff --git a/dart/lib/src/protocol/sentry_event.dart b/dart/lib/src/protocol/sentry_event.dart index e51441cd7d..32a76b9885 100644 --- a/dart/lib/src/protocol/sentry_event.dart +++ b/dart/lib/src/protocol/sentry_event.dart @@ -59,7 +59,7 @@ class SentryEvent with SentryEventLike { /// The ID Sentry.io assigned to the submitted event for future reference. final SentryId eventId; - /// A timestamp representing when the breadcrumb occurred. + /// A timestamp representing when the event occurred. final DateTime? timestamp; /// A string representing the platform the SDK is submitting from. This will be used by the Sentry interface to customize various components in the interface. diff --git a/dart/lib/src/protocol/sentry_trace_context.dart b/dart/lib/src/protocol/sentry_trace_context.dart index fab3d1444d..25c4ca7ad8 100644 --- a/dart/lib/src/protocol/sentry_trace_context.dart +++ b/dart/lib/src/protocol/sentry_trace_context.dart @@ -1,5 +1,7 @@ import 'package:meta/meta.dart'; +import '../../sentry.dart'; +import '../propagation_context.dart'; import '../protocol.dart'; @immutable @@ -87,4 +89,14 @@ class SentryTraceContext { this.origin, }) : traceId = traceId ?? SentryId.newId(), spanId = spanId ?? SpanId.newId(); + + @internal + factory SentryTraceContext.fromPropagationContext( + PropagationContext propagationContext) { + return SentryTraceContext( + traceId: propagationContext.traceId, + spanId: propagationContext.spanId, + operation: 'default', + ); + } } diff --git a/dart/lib/src/protocol/sentry_transaction.dart b/dart/lib/src/protocol/sentry_transaction.dart index 44e6c4298f..e00fa23355 100644 --- a/dart/lib/src/protocol/sentry_transaction.dart +++ b/dart/lib/src/protocol/sentry_transaction.dart @@ -10,66 +10,56 @@ class SentryTransaction extends SentryEvent { late final DateTime startTimestamp; static const String _type = 'transaction'; late final List spans; - final SentryTracer _tracer; + @internal + final SentryTracer tracer; late final Map measurements; late final SentryTransactionInfo? transactionInfo; SentryTransaction( - this._tracer, { - SentryId? eventId, + this.tracer, { + super.eventId, DateTime? timestamp, - String? platform, - String? serverName, - String? release, - String? dist, - String? environment, + super.platform, + super.serverName, + super.release, + super.dist, + super.environment, String? transaction, dynamic throwable, Map? tags, @Deprecated( 'Additional Data is deprecated in favor of structured [Contexts] and should be avoided when possible') Map? extra, - SentryUser? user, - Contexts? contexts, - List? breadcrumbs, - SdkVersion? sdk, - SentryRequest? request, + super.user, + super.contexts, + super.breadcrumbs, + super.sdk, + super.request, String? type, Map? measurements, SentryTransactionInfo? transactionInfo, }) : super( - eventId: eventId, - timestamp: timestamp ?? _tracer.endTimestamp, - platform: platform, - serverName: serverName, - release: release, - dist: dist, - environment: environment, - transaction: transaction ?? _tracer.name, - throwable: throwable ?? _tracer.throwable, - tags: tags ?? _tracer.tags, + timestamp: timestamp ?? tracer.endTimestamp, + transaction: transaction ?? tracer.name, + throwable: throwable ?? tracer.throwable, + tags: tags ?? tracer.tags, // ignore: deprecated_member_use_from_same_package - extra: extra ?? _tracer.data, - user: user, - contexts: contexts, - breadcrumbs: breadcrumbs, - sdk: sdk, - request: request, + extra: extra ?? tracer.data, type: _type, ) { - startTimestamp = _tracer.startTimestamp; + startTimestamp = tracer.startTimestamp; - final spanContext = _tracer.context; - spans = _tracer.children; + final spanContext = tracer.context; + spans = tracer.children; this.measurements = measurements ?? {}; - this.contexts.trace = spanContext.toTraceContext( - sampled: _tracer.samplingDecision?.sampled, - status: _tracer.status, + contexts.trace = spanContext.toTraceContext( + sampled: tracer.samplingDecision?.sampled, + status: tracer.status, ); this.transactionInfo = transactionInfo ?? - SentryTransactionInfo(_tracer.transactionNameSource.name); + SentryTransactionInfo(tracer.transactionNameSource.name); } @override @@ -136,7 +126,7 @@ class SentryTransaction extends SentryEvent { SentryTransactionInfo? transactionInfo, }) => SentryTransaction( - _tracer, + tracer, eventId: eventId ?? this.eventId, timestamp: timestamp ?? this.timestamp, platform: platform ?? this.platform, diff --git a/dart/lib/src/run_zoned_guarded_integration.dart b/dart/lib/src/run_zoned_guarded_integration.dart index 623a9a5f54..20f0857e3b 100644 --- a/dart/lib/src/run_zoned_guarded_integration.dart +++ b/dart/lib/src/run_zoned_guarded_integration.dart @@ -50,7 +50,9 @@ class RunZonedGuardedIntegration extends Integration { final event = SentryEvent( throwable: throwableMechanism, - level: SentryLevel.fatal, + level: options.markAutomaticallyCollectedErrorsAsFatal + ? SentryLevel.fatal + : SentryLevel.error, timestamp: hub.options.clock(), ); diff --git a/dart/lib/src/scope.dart b/dart/lib/src/scope.dart index bbe8bb54d5..3fef9a92a2 100644 --- a/dart/lib/src/scope.dart +++ b/dart/lib/src/scope.dart @@ -1,8 +1,11 @@ import 'dart:async'; import 'dart:collection'; +import 'package:meta/meta.dart'; + import 'event_processor.dart'; import 'hint.dart'; +import 'propagation_context.dart'; import 'protocol.dart'; import 'scope_observer.dart'; import 'sentry_attachment/sentry_attachment.dart'; @@ -39,6 +42,9 @@ class Scope { /// Returns active transaction or null if there is no active transaction. ISentrySpan? span; + @internal + PropagationContext propagationContext = PropagationContext(); + SentryUser? _user; /// Get the current user. @@ -136,6 +142,7 @@ class Scope { List.unmodifiable(_eventProcessors); final SentryOptions _options; + bool _enableScopeSync = true; final List _attachments = []; @@ -171,7 +178,7 @@ class Scope { exception: exception, stackTrace: stackTrace, ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } @@ -311,10 +318,15 @@ class Scope { }); final newSpan = span; - if (event.contexts.trace == null && newSpan != null) { - event.contexts.trace = newSpan.context.toTraceContext( - sampled: newSpan.samplingDecision?.sampled, - ); + if (event.contexts.trace == null) { + if (newSpan != null) { + event.contexts.trace = newSpan.context.toTraceContext( + sampled: newSpan.samplingDecision?.sampled, + ); + } else { + event.contexts.trace = + SentryTraceContext.fromPropagationContext(propagationContext); + } } SentryEvent? processedEvent = event; @@ -333,7 +345,7 @@ class Scope { exception: exception, stackTrace: stackTrace, ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } @@ -412,7 +424,8 @@ class Scope { ..level = level ..fingerprint = List.from(fingerprint) .._transaction = _transaction - ..span = span; + ..span = span + .._enableScopeSync = false; clone._setUserSync(user); @@ -450,7 +463,7 @@ class Scope { } Future _callScopeObservers(_OnScopeObserver action) async { - if (_options.enableScopeSync) { + if (_options.enableScopeSync && _enableScopeSync) { for (final scopeObserver in _options.scopeObservers) { await action(scopeObserver); } diff --git a/dart/lib/src/sentry.dart b/dart/lib/src/sentry.dart index b3ec82ce10..88fdd42996 100644 --- a/dart/lib/src/sentry.dart +++ b/dart/lib/src/sentry.dart @@ -58,7 +58,7 @@ class Sentry { exception: exception, stackTrace: stackTrace, ); - if (sentryOptions.devMode) { + if (sentryOptions.automatedTestMode) { rethrow; } } diff --git a/dart/lib/src/sentry_attachment/io_sentry_attachment.dart b/dart/lib/src/sentry_attachment/io_sentry_attachment.dart index a1e2585556..ae07b51508 100644 --- a/dart/lib/src/sentry_attachment/io_sentry_attachment.dart +++ b/dart/lib/src/sentry_attachment/io_sentry_attachment.dart @@ -24,12 +24,10 @@ class IoSentryAttachment extends SentryAttachment { IoSentryAttachment.fromFile( File file, { String? filename, - String? attachmentType, - String? contentType, + super.attachmentType, + super.contentType, }) : super.fromLoader( loader: () => file.readAsBytes(), filename: filename ?? file.uri.pathSegments.last, - attachmentType: attachmentType, - contentType: contentType, ); } diff --git a/dart/lib/src/sentry_baggage.dart b/dart/lib/src/sentry_baggage.dart index 50547622d5..25aab900f4 100644 --- a/dart/lib/src/sentry_baggage.dart +++ b/dart/lib/src/sentry_baggage.dart @@ -1,4 +1,7 @@ -import 'protocol/sentry_level.dart'; +import 'package:meta/meta.dart'; +import 'scope.dart'; +import 'protocol.dart'; + import 'sentry_options.dart'; class SentryBaggage { @@ -87,6 +90,27 @@ class SentryBaggage { return SentryBaggage(keyValues, logger: logger); } + @internal + setValuesFromScope(Scope scope, SentryOptions options) { + final propagationContext = scope.propagationContext; + setTraceId(propagationContext.traceId.toString()); + if (options.dsn != null) { + setPublicKey(Dsn.parse(options.dsn!).publicKey); + } + if (options.release != null) { + setRelease(options.release!); + } + if (options.environment != null) { + setEnvironment(options.environment!); + } + if (scope.user?.id != null) { + setUserId(scope.user!.id!); + } + if (scope.user?.segment != null) { + setUserSegment(scope.user!.segment!); + } + } + static Map _extractKeyValuesFromBaggageString( String headerValue, { SentryLogger? logger, @@ -164,6 +188,10 @@ class SentryBaggage { set(_sampleRateKeyName, value); } + void setSampled(String value) { + set('sentry-sampled', value); + } + double? getSampleRate() { final sampleRate = get(_sampleRateKeyName); if (sampleRate == null) { diff --git a/dart/lib/src/sentry_client.dart b/dart/lib/src/sentry_client.dart index d354e4a449..d3121dfbce 100644 --- a/dart/lib/src/sentry_client.dart +++ b/dart/lib/src/sentry_client.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:math'; import 'package:meta/meta.dart'; +import 'sentry_baggage.dart'; import 'sentry_attachment/sentry_attachment.dart'; import 'event_processor.dart'; @@ -15,6 +16,7 @@ import 'sentry_options.dart'; import 'sentry_stack_trace_factory.dart'; import 'transport/http_transport.dart'; import 'transport/noop_transport.dart'; +import 'transport/spotlight_http_transport.dart'; import 'utils/isolate_utils.dart'; import 'version.dart'; import 'sentry_envelope.dart'; @@ -47,6 +49,9 @@ class SentryClient { final rateLimiter = RateLimiter(options); options.transport = HttpTransport(options, rateLimiter); } + if (options.spotlight.enabled) { + options.transport = SpotlightHttpTransport(options, options.transport); + } return SentryClient._(options); } @@ -119,11 +124,24 @@ class SentryClient { attachments.add(viewHierarchy); } + var traceContext = scope?.span?.traceContext(); + if (traceContext == null) { + if (scope?.propagationContext.baggage == null) { + scope?.propagationContext.baggage = + SentryBaggage({}, logger: _options.logger); + scope?.propagationContext.baggage?.setValuesFromScope(scope, _options); + } + if (scope != null) { + traceContext = SentryTraceContextHeader.fromBaggage( + scope.propagationContext.baggage!); + } + } + final envelope = SentryEnvelope.fromEvent( preparedEvent, _options.sdk, dsn: _options.dsn, - traceContext: scope?.span?.traceContext(), + traceContext: traceContext, attachments: attachments.isNotEmpty ? attachments : null, ); @@ -322,6 +340,11 @@ class SentryClient { traceContext: traceContext, attachments: attachments, ); + + final profileInfo = preparedTransaction.tracer.profileInfo; + if (profileInfo != null) { + envelope.items.add(profileInfo.asEnvelopeItem()); + } final id = await captureEnvelope(envelope); return id ?? SentryId.empty(); @@ -378,7 +401,7 @@ class SentryClient { exception: exception, stackTrace: stackTrace, ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } @@ -415,7 +438,7 @@ class SentryClient { exception: exception, stackTrace: stackTrace, ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } diff --git a/dart/lib/src/sentry_envelope_item.dart b/dart/lib/src/sentry_envelope_item.dart index f88f808600..5e38a7123d 100644 --- a/dart/lib/src/sentry_envelope_item.dart +++ b/dart/lib/src/sentry_envelope_item.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:convert'; + import 'client_reports/client_report.dart'; import 'protocol.dart'; import 'utils.dart'; @@ -97,6 +98,7 @@ class SentryEnvelopeItem { final newLine = utf8.encode('\n'); final data = await dataFactory(); + // TODO the data copy could be avoided - this would be most significant with attachments. return [...itemHeader, ...newLine, ...data]; } catch (e) { return []; diff --git a/dart/lib/src/sentry_isolate.dart b/dart/lib/src/sentry_isolate.dart index 8a6b71d48f..9998544d5b 100644 --- a/dart/lib/src/sentry_isolate.dart +++ b/dart/lib/src/sentry_isolate.dart @@ -75,7 +75,9 @@ class SentryIsolate { final event = SentryEvent( throwable: throwableMechanism, - level: SentryLevel.fatal, + level: hub.options.markAutomaticallyCollectedErrorsAsFatal + ? SentryLevel.fatal + : SentryLevel.error, timestamp: hub.options.clock(), ); diff --git a/dart/lib/src/sentry_item_type.dart b/dart/lib/src/sentry_item_type.dart index c74b6b6049..6215cbb78f 100644 --- a/dart/lib/src/sentry_item_type.dart +++ b/dart/lib/src/sentry_item_type.dart @@ -4,5 +4,6 @@ class SentryItemType { static const String attachment = 'attachment'; static const String transaction = 'transaction'; static const String clientReport = 'client_report'; + static const String profile = 'profile'; static const String unknown = '__unknown__'; } diff --git a/dart/lib/src/sentry_options.dart b/dart/lib/src/sentry_options.dart index 37f7dc01e9..6fe367e732 100644 --- a/dart/lib/src/sentry_options.dart +++ b/dart/lib/src/sentry_options.dart @@ -289,6 +289,17 @@ class SentryOptions { /// to be sent to Sentry. TracesSamplerCallback? tracesSampler; + double? _profilesSampleRate; + + @internal // Only exposed by SentryFlutterOptions at the moment. + double? get profilesSampleRate => _profilesSampleRate; + + @internal // Only exposed by SentryFlutterOptions at the moment. + set profilesSampleRate(double? value) { + assert(value == null || (value >= 0 && value <= 1)); + _profilesSampleRate = value; + } + /// Send statistics to sentry when the client drops events. bool sendClientReports = true; @@ -353,10 +364,22 @@ class SentryOptions { /// are set. bool? enableTracing; - /// Changed SDK behaviour when set to true: + /// Only for internal use. Changed SDK behaviour when set to true: /// - Rethrow exceptions that occur in user provided closures @internal - bool devMode = false; + bool automatedTestMode = false; + + /// Errors that the SDK automatically collects, for example in + /// [SentryIsolate], have `level` [SentryLevel.fatal] set per default. + /// Settings this to `false` will set the `level` to [SentryLevel.error]. + bool markAutomaticallyCollectedErrorsAsFatal = true; + + /// The Spotlight configuration. + /// Disabled by default. + /// ```dart + /// spotlight = Spotlight(enabled: true) + /// ``` + Spotlight spotlight = Spotlight(enabled: false); SentryOptions({this.dsn, PlatformChecker? checker}) { if (checker != null) { diff --git a/dart/lib/src/sentry_trace_context_header.dart b/dart/lib/src/sentry_trace_context_header.dart index 181752b359..bcb1d0b1bb 100644 --- a/dart/lib/src/sentry_trace_context_header.dart +++ b/dart/lib/src/sentry_trace_context_header.dart @@ -12,6 +12,7 @@ class SentryTraceContextHeader { this.userSegment, this.transaction, this.sampleRate, + this.sampled, }); final SentryId traceId; @@ -22,6 +23,7 @@ class SentryTraceContextHeader { final String? userSegment; final String? transaction; final String? sampleRate; + final String? sampled; /// Deserializes a [SentryTraceContextHeader] from JSON [Map]. factory SentryTraceContextHeader.fromJson(Map json) { @@ -34,6 +36,7 @@ class SentryTraceContextHeader { userSegment: json['user_segment'], transaction: json['transaction'], sampleRate: json['sample_rate'], + sampled: json['sampled'], ); } @@ -48,6 +51,7 @@ class SentryTraceContextHeader { if (userSegment != null) 'user_segment': userSegment, if (transaction != null) 'transaction': transaction, if (sampleRate != null) 'sample_rate': sampleRate, + if (sampled != null) 'sampled': sampled, }; } @@ -76,7 +80,18 @@ class SentryTraceContextHeader { if (sampleRate != null) { baggage.setSampleRate(sampleRate!); } - + if (sampled != null) { + baggage.setSampled(sampled!); + } return baggage; } + + factory SentryTraceContextHeader.fromBaggage(SentryBaggage baggage) { + return SentryTraceContextHeader( + SentryId.fromId(baggage.get('sentry-trace_id').toString()), + baggage.get('sentry-public_key').toString(), + release: baggage.get('sentry-release'), + environment: baggage.get('sentry-environment'), + ); + } } diff --git a/dart/lib/src/sentry_trace_origins.dart b/dart/lib/src/sentry_trace_origins.dart index e3fd4dbafc..5a7c49b339 100644 --- a/dart/lib/src/sentry_trace_origins.dart +++ b/dart/lib/src/sentry_trace_origins.dart @@ -18,4 +18,13 @@ class SentryTraceOrigins { 'auto.db.sqflite.database_executor'; static const autoDbSqfliteDatabaseFactory = 'auto.db.sqflite.database_factory'; + static const autoDbIsar = 'auto.db.isar'; + static const autoDbIsarCollection = 'auto.db.isar.collection'; + static const autoDbHive = 'auto.db.hive'; + static const autoDbHiveBoxBase = 'auto.db.hive.box_base'; + static const autoDbHiveLazyBox = 'auto.db.hive.lazy_box'; + static const autoDbHiveBoxCollection = 'auto.db.hive.box_collection'; + static const autoDbDriftQueryExecutor = 'auto.db.drift.query.executor'; + static const autoDbDriftTransactionExecutor = + 'auto.db.drift.transaction.executor'; } diff --git a/dart/lib/src/sentry_tracer.dart b/dart/lib/src/sentry_tracer.dart index 30a9eb27d3..ff9449fc42 100644 --- a/dart/lib/src/sentry_tracer.dart +++ b/dart/lib/src/sentry_tracer.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:meta/meta.dart'; import '../sentry.dart'; +import 'profiling.dart'; import 'sentry_tracer_finish_status.dart'; import 'utils/sample_rate_format.dart'; @@ -31,6 +32,13 @@ class SentryTracer extends ISentrySpan { SentryTraceContextHeader? _sentryTraceContextHeader; + // Profiler attached to this tracer. + late final SentryProfiler? profiler; + + // Resulting profile, after it has been collected. This is later used by + // SentryClient to attach as an envelope item when sending the transaction. + SentryProfileInfo? profileInfo; + /// If [waitForChildren] is true, this transaction will not finish until all /// its children are finished. /// @@ -52,6 +60,7 @@ class SentryTracer extends ISentrySpan { Duration? autoFinishAfter, bool trimEnd = false, OnTransactionFinish? onFinish, + this.profiler, }) { _rootSpan = SentrySpan( this, @@ -77,8 +86,13 @@ class SentryTracer extends ISentrySpan { final commonEndTimestamp = endTimestamp ?? _hub.options.clock(); _autoFinishAfterTimer?.cancel(); _finishStatus = SentryTracerFinishStatus.finishing(status); - if (!_rootSpan.finished && - (!_waitForChildren || _haveAllChildrenFinished())) { + if (_rootSpan.finished) { + return; + } + if (_waitForChildren && !_haveAllChildrenFinished()) { + return; + } + try { _rootSpan.status ??= status; // remove span where its endTimestamp is before startTimestamp @@ -122,10 +136,17 @@ class SentryTracer extends ISentrySpan { final transaction = SentryTransaction(this); transaction.measurements.addAll(_measurements); + + profileInfo = (status == null || status == SpanStatus.ok()) + ? await profiler?.finishFor(transaction) + : null; + await _hub.captureTransaction( transaction, traceContext: traceContext(), ); + } finally { + profiler?.dispose(); } } @@ -337,6 +358,7 @@ class SentryTracer extends ISentrySpan { transaction: _isHighQualityTransactionName(transactionNameSource) ? name : null, sampleRate: _sampleRateToString(_rootSpan.samplingDecision?.sampleRate), + sampled: _rootSpan.samplingDecision?.sampled.toString(), ); return _sentryTraceContextHeader; diff --git a/dart/lib/src/sentry_traces_sampler.dart b/dart/lib/src/sentry_traces_sampler.dart index 62d94dc339..b1668084c9 100644 --- a/dart/lib/src/sentry_traces_sampler.dart +++ b/dart/lib/src/sentry_traces_sampler.dart @@ -14,7 +14,12 @@ class SentryTracesSampler { SentryTracesSampler( this._options, { Random? random, - }) : _random = random ?? Random(); + }) : _random = random ?? Random() { + if (_options.tracesSampler != null && _options.tracesSampleRate != null) { + _options.logger(SentryLevel.warning, + 'Both tracesSampler and traceSampleRate are set. tracesSampler will take precedence and fallback to traceSampleRate if it returns null.'); + } + } SentryTracesSamplingDecision sample(SentrySamplingContext samplingContext) { final samplingDecision = @@ -40,7 +45,7 @@ class SentryTracesSampler { exception: exception, stackTrace: stackTrace, ); - if (_options.devMode) { + if (_options.automatedTestMode) { rethrow; } } @@ -67,5 +72,13 @@ class SentryTracesSampler { return SentryTracesSamplingDecision(false); } + bool sampleProfiling(SentryTracesSamplingDecision tracesSamplingDecision) { + double? optionsRate = _options.profilesSampleRate; + if (optionsRate == null || !tracesSamplingDecision.sampled) { + return false; + } + return _sample(optionsRate); + } + bool _sample(double result) => !(result < _random.nextDouble()); } diff --git a/dart/lib/src/sentry_transaction_context.dart b/dart/lib/src/sentry_transaction_context.dart index 66024459f5..32ab0324b7 100644 --- a/dart/lib/src/sentry_transaction_context.dart +++ b/dart/lib/src/sentry_transaction_context.dart @@ -15,21 +15,16 @@ class SentryTransactionContext extends SentrySpanContext { SentryTransactionContext( this.name, String operation, { - String? description, + super.description, this.parentSamplingDecision, - SentryId? traceId, - SpanId? spanId, - SpanId? parentSpanId, + super.traceId, + super.spanId, + super.parentSpanId, this.transactionNameSource, this.samplingDecision, - String? origin, + super.origin, }) : super( operation: operation, - description: description, - traceId: traceId, - spanId: spanId, - parentSpanId: parentSpanId, - origin: origin, ); factory SentryTransactionContext.fromSentryTrace( diff --git a/dart/lib/src/spotlight.dart b/dart/lib/src/spotlight.dart new file mode 100644 index 0000000000..b106ed3547 --- /dev/null +++ b/dart/lib/src/spotlight.dart @@ -0,0 +1,21 @@ +import 'platform_checker.dart'; + +/// Spotlight configuration class. +class Spotlight { + /// Whether to enable Spotlight for local development. + bool enabled; + + /// The Spotlight Sidecar URL. + /// Defaults to http://10.0.2.2:8969/stream due to Emulator on Android. + /// Otherwise defaults to http://localhost:8969/stream. + String url; + + Spotlight({required this.enabled, String? url}) + : url = url ?? _defaultSpotlightUrl(); +} + +String _defaultSpotlightUrl() { + return (PlatformChecker().platform.isAndroid + ? 'http://10.0.2.2:8969/stream' + : 'http://localhost:8969/stream'); +} diff --git a/dart/lib/src/transport/http_transport.dart b/dart/lib/src/transport/http_transport.dart index acf0e6cf64..90dd8949ce 100644 --- a/dart/lib/src/transport/http_transport.dart +++ b/dart/lib/src/transport/http_transport.dart @@ -2,11 +2,9 @@ import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart'; +import '../utils/transport_utils.dart'; +import 'http_transport_request_handler.dart'; -import '../client_reports/client_report_recorder.dart'; -import '../client_reports/discard_reason.dart'; -import 'data_category.dart'; -import 'noop_encode.dart' if (dart.library.io) 'encode.dart'; import '../noop_client.dart'; import '../protocol.dart'; import '../sentry_options.dart'; @@ -18,15 +16,9 @@ import 'rate_limiter.dart'; class HttpTransport implements Transport { final SentryOptions _options; - final Dsn _dsn; - final RateLimiter _rateLimiter; - final ClientReportRecorder _recorder; - - late _CredentialBuilder _credentialBuilder; - - final Map _headers; + final HttpTransportRequestHandler _requestHandler; factory HttpTransport(SentryOptions options, RateLimiter rateLimiter) { if (options.httpClient is NoOpClient) { @@ -37,17 +29,8 @@ class HttpTransport implements Transport { } HttpTransport._(this._options, this._rateLimiter) - : _dsn = Dsn.parse(_options.dsn!), - _recorder = _options.recorder, - _headers = _buildHeaders( - _options.platformChecker.isWeb, - _options.sentryClientName, - ) { - _credentialBuilder = _CredentialBuilder( - _dsn, - _options.sentryClientName, - ); - } + : _requestHandler = HttpTransportRequestHandler( + _options, Dsn.parse(_options.dsn!).postUri); @override Future send(SentryEnvelope envelope) async { @@ -57,63 +40,31 @@ class HttpTransport implements Transport { } filteredEnvelope.header.sentAt = _options.clock(); - final streamedRequest = await _createStreamedRequest(filteredEnvelope); + final streamedRequest = + await _requestHandler.createRequest(filteredEnvelope); + final response = await _options.httpClient .send(streamedRequest) .then(Response.fromStream); _updateRetryAfterLimits(response); - if (response.statusCode != 200) { - // body guard to not log the error as it has performance impact to allocate - // the body String. - if (_options.debug) { - _options.logger( - SentryLevel.error, - 'API returned an error, statusCode = ${response.statusCode}, ' - 'body = ${response.body}', - ); - } - - if (response.statusCode >= 400 && response.statusCode != 429) { - _recorder.recordLostEvent( - DiscardReason.networkError, DataCategory.error); - } - - return SentryId.empty(); - } else { - _options.logger( - SentryLevel.debug, - 'Envelope ${envelope.header.eventId ?? "--"} was sent successfully.', - ); - } + TransportUtils.logResponse(_options, envelope, response, target: 'Sentry'); - final eventId = json.decode(response.body)['id']; - if (eventId == null) { - return null; + if (response.statusCode == 200) { + return _parseEventId(response); } - return SentryId.fromId(eventId); + return SentryId.empty(); } - Future _createStreamedRequest( - SentryEnvelope envelope) async { - final streamedRequest = StreamedRequest('POST', _dsn.postUri); - - if (_options.compressPayload) { - final compressionSink = compressInSink(streamedRequest.sink, _headers); - envelope - .envelopeStream(_options) - .listen(compressionSink.add) - .onDone(compressionSink.close); - } else { - envelope - .envelopeStream(_options) - .listen(streamedRequest.sink.add) - .onDone(streamedRequest.sink.close); + SentryId? _parseEventId(Response response) { + try { + final eventId = json.decode(response.body)['id']; + return eventId != null ? SentryId.fromId(eventId) : null; + } catch (e) { + _options.logger(SentryLevel.error, 'Error parsing response: $e'); + return null; } - streamedRequest.headers.addAll(_credentialBuilder.configure(_headers)); - - return streamedRequest; } void _updateRetryAfterLimits(Response response) { @@ -131,51 +82,3 @@ class HttpTransport implements Transport { sentryRateLimitHeader, retryAfterHeader, response.statusCode); } } - -class _CredentialBuilder { - final String _authHeader; - - _CredentialBuilder._(String authHeader) : _authHeader = authHeader; - - factory _CredentialBuilder(Dsn dsn, String sdkIdentifier) { - final authHeader = _buildAuthHeader( - publicKey: dsn.publicKey, - secretKey: dsn.secretKey, - sdkIdentifier: sdkIdentifier, - ); - - return _CredentialBuilder._(authHeader); - } - - static String _buildAuthHeader({ - required String publicKey, - String? secretKey, - required String sdkIdentifier, - }) { - var header = 'Sentry sentry_version=7, sentry_client=$sdkIdentifier, ' - 'sentry_key=$publicKey'; - - if (secretKey != null) { - header += ', sentry_secret=$secretKey'; - } - - return header; - } - - Map configure(Map headers) { - return headers - ..addAll( - {'X-Sentry-Auth': _authHeader}, - ); - } -} - -Map _buildHeaders(bool isWeb, String sdkIdentifier) { - final headers = {'Content-Type': 'application/x-sentry-envelope'}; - // NOTE(lejard_h) overriding user agent on VM and Flutter not sure why - // for web it use browser user agent - if (!isWeb) { - headers['User-Agent'] = sdkIdentifier; - } - return headers; -} diff --git a/dart/lib/src/transport/http_transport_request_handler.dart b/dart/lib/src/transport/http_transport_request_handler.dart new file mode 100644 index 0000000000..4aa50898c5 --- /dev/null +++ b/dart/lib/src/transport/http_transport_request_handler.dart @@ -0,0 +1,98 @@ +import 'dart:async'; + +import 'package:http/http.dart'; +import 'package:meta/meta.dart'; + +import 'noop_encode.dart' if (dart.library.io) 'encode.dart'; +import '../protocol.dart'; +import '../sentry_options.dart'; +import '../sentry_envelope.dart'; + +@internal +class HttpTransportRequestHandler { + final SentryOptions _options; + final Dsn _dsn; + final Map _headers; + final Uri _requestUri; + late _CredentialBuilder _credentialBuilder; + + HttpTransportRequestHandler(this._options, this._requestUri) + : _dsn = Dsn.parse(_options.dsn!), + _headers = _buildHeaders( + _options.platformChecker.isWeb, + _options.sentryClientName, + ) { + _credentialBuilder = _CredentialBuilder( + _dsn, + _options.sentryClientName, + ); + } + + Future createRequest(SentryEnvelope envelope) async { + final streamedRequest = StreamedRequest('POST', _requestUri); + + if (_options.compressPayload) { + final compressionSink = compressInSink(streamedRequest.sink, _headers); + envelope + .envelopeStream(_options) + .listen(compressionSink.add) + .onDone(compressionSink.close); + } else { + envelope + .envelopeStream(_options) + .listen(streamedRequest.sink.add) + .onDone(streamedRequest.sink.close); + } + + streamedRequest.headers.addAll(_credentialBuilder.configure(_headers)); + return streamedRequest; + } +} + +Map _buildHeaders(bool isWeb, String sdkIdentifier) { + final headers = {'Content-Type': 'application/x-sentry-envelope'}; + // NOTE(lejard_h) overriding user agent on VM and Flutter not sure why + // for web it use browser user agent + if (!isWeb) { + headers['User-Agent'] = sdkIdentifier; + } + return headers; +} + +class _CredentialBuilder { + final String _authHeader; + + _CredentialBuilder._(String authHeader) : _authHeader = authHeader; + + factory _CredentialBuilder(Dsn dsn, String sdkIdentifier) { + final authHeader = _buildAuthHeader( + publicKey: dsn.publicKey, + secretKey: dsn.secretKey, + sdkIdentifier: sdkIdentifier, + ); + + return _CredentialBuilder._(authHeader); + } + + static String _buildAuthHeader({ + required String publicKey, + String? secretKey, + required String sdkIdentifier, + }) { + var header = 'Sentry sentry_version=7, sentry_client=$sdkIdentifier, ' + 'sentry_key=$publicKey'; + + if (secretKey != null) { + header += ', sentry_secret=$secretKey'; + } + + return header; + } + + Map configure(Map headers) { + return headers + ..addAll( + {'X-Sentry-Auth': _authHeader}, + ); + } +} diff --git a/dart/lib/src/transport/spotlight_http_transport.dart b/dart/lib/src/transport/spotlight_http_transport.dart new file mode 100644 index 0000000000..f51e77d478 --- /dev/null +++ b/dart/lib/src/transport/spotlight_http_transport.dart @@ -0,0 +1,52 @@ +import 'package:http/http.dart'; +import '../utils/transport_utils.dart'; +import 'http_transport_request_handler.dart'; + +import '../../sentry.dart'; +import '../noop_client.dart'; + +/// Spotlight HTTP transport decorator that sends Sentry envelopes to both Sentry and Spotlight. +class SpotlightHttpTransport extends Transport { + final SentryOptions _options; + final Transport _transport; + final HttpTransportRequestHandler _requestHandler; + + factory SpotlightHttpTransport(SentryOptions options, Transport transport) { + if (options.httpClient is NoOpClient) { + options.httpClient = Client(); + } + return SpotlightHttpTransport._(options, transport); + } + + SpotlightHttpTransport._(this._options, this._transport) + : _requestHandler = HttpTransportRequestHandler( + _options, Uri.parse(_options.spotlight.url)); + + @override + Future send(SentryEnvelope envelope) async { + try { + await _sendToSpotlight(envelope); + } catch (e) { + _options.logger( + SentryLevel.warning, 'Failed to send envelope to Spotlight: $e'); + } + return _transport.send(envelope); + } + + Future _sendToSpotlight(SentryEnvelope envelope) async { + envelope.header.sentAt = _options.clock(); + + // Screenshots do not work currently https://github.com/getsentry/spotlight/issues/274 + envelope.items + .removeWhere((element) => element.header.contentType == 'image/png'); + + final spotlightRequest = await _requestHandler.createRequest(envelope); + + final response = await _options.httpClient + .send(spotlightRequest) + .then(Response.fromStream); + + TransportUtils.logResponse(_options, envelope, response, + target: 'Spotlight'); + } +} diff --git a/dart/lib/src/utils/sample_rate_format.dart b/dart/lib/src/utils/sample_rate_format.dart index 4abb79edd8..e69163f30b 100644 --- a/dart/lib/src/utils/sample_rate_format.dart +++ b/dart/lib/src/utils/sample_rate_format.dart @@ -1,3 +1,4 @@ +// ignore: dangling_library_doc_comments /// Code ported & adapted from `intl` package /// https://pub.dev/packages/intl /// diff --git a/dart/lib/src/utils/tracing_utils.dart b/dart/lib/src/utils/tracing_utils.dart index a60497509f..6198062ddc 100644 --- a/dart/lib/src/utils/tracing_utils.dart +++ b/dart/lib/src/utils/tracing_utils.dart @@ -1,42 +1,55 @@ import '../../sentry.dart'; -void addSentryTraceHeader(ISentrySpan span, Map headers) { +void addSentryTraceHeaderFromSpan( + ISentrySpan span, Map headers) { final traceHeader = span.toSentryTrace(); headers[traceHeader.name] = traceHeader.value; } -void addBaggageHeader( +void addSentryTraceHeader( + SentryTraceHeader traceHeader, Map headers) { + headers[traceHeader.name] = traceHeader.value; +} + +void addBaggageHeaderFromSpan( ISentrySpan span, Map headers, { SentryLogger? logger, }) { final baggage = span.toBaggageHeader(); if (baggage != null) { - final currentValue = headers[baggage.name] as String? ?? ''; + addBaggageHeader(baggage, headers, logger: logger); + } +} - final currentBaggage = SentryBaggage.fromHeader( - currentValue, - logger: logger, - ); - final sentryBaggage = SentryBaggage.fromHeader( - baggage.value, - logger: logger, - ); +void addBaggageHeader( + SentryBaggageHeader baggage, + Map headers, { + SentryLogger? logger, +}) { + final currentValue = headers[baggage.name] as String? ?? ''; - // overwrite sentry's keys https://develop.sentry.dev/sdk/performance/dynamic-sampling-context/#baggage - final filteredBaggageHeader = Map.from(currentBaggage.keyValues); - filteredBaggageHeader - .removeWhere((key, value) => key.startsWith('sentry-')); + final currentBaggage = SentryBaggage.fromHeader( + currentValue, + logger: logger, + ); + final sentryBaggage = SentryBaggage.fromHeader( + baggage.value, + logger: logger, + ); - final mergedBaggage = { - ...filteredBaggageHeader, - ...sentryBaggage.keyValues, - }; + // overwrite sentry's keys https://develop.sentry.dev/sdk/performance/dynamic-sampling-context/#baggage + final filteredBaggageHeader = Map.from(currentBaggage.keyValues); + filteredBaggageHeader.removeWhere((key, value) => key.startsWith('sentry-')); - final newBaggage = SentryBaggage(mergedBaggage, logger: logger); + final mergedBaggage = { + ...filteredBaggageHeader, + ...sentryBaggage.keyValues, + }; - headers[baggage.name] = newBaggage.toHeaderString(); - } + final newBaggage = SentryBaggage(mergedBaggage, logger: logger); + + headers[baggage.name] = newBaggage.toHeaderString(); } bool containsTargetOrMatchesRegExp( diff --git a/dart/lib/src/utils/transport_utils.dart b/dart/lib/src/utils/transport_utils.dart new file mode 100644 index 0000000000..388db8e8d5 --- /dev/null +++ b/dart/lib/src/utils/transport_utils.dart @@ -0,0 +1,30 @@ +import 'package:http/http.dart'; + +import '../../sentry_io.dart'; +import '../client_reports/discard_reason.dart'; +import '../transport/data_category.dart'; + +class TransportUtils { + static void logResponse( + SentryOptions options, SentryEnvelope envelope, Response response, + {required String target}) { + if (response.statusCode != 200) { + if (options.debug) { + options.logger( + SentryLevel.error, + 'Error, statusCode = ${response.statusCode}, body = ${response.body}', + ); + } + + if (response.statusCode >= 400 && response.statusCode != 429) { + options.recorder + .recordLostEvent(DiscardReason.networkError, DataCategory.error); + } + } else { + options.logger( + SentryLevel.debug, + 'Envelope ${envelope.header.eventId ?? "--"} was sent successfully to $target.', + ); + } + } +} diff --git a/dart/lib/src/version.dart b/dart/lib/src/version.dart index 6e9ff2059d..c29bdd09cb 100644 --- a/dart/lib/src/version.dart +++ b/dart/lib/src/version.dart @@ -9,7 +9,7 @@ library version; /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.9.0'; +const String sdkVersion = '7.16.0'; String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName; diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index 330d6084e7..1cc9bf8c75 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -1,5 +1,5 @@ name: sentry -version: 7.9.0 +version: 7.16.0 description: > A crash reporting library for Dart that sends crash reports to Sentry.io. This library supports Dart VM and Web. For Flutter consider sentry_flutter instead. @@ -15,11 +15,12 @@ dependencies: http: '>=0.13.0 <2.0.0' meta: ^1.3.0 stack_trace: ^1.10.0 - uuid: ^3.0.0 + uuid: '>=3.0.0 <5.0.0' dev_dependencies: + build_runner: ^2.4.2 mockito: ^5.1.0 - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.21.1 yaml: ^3.1.0 # needed for version match (code and pubspec) collection: ^1.16.0 diff --git a/dart/test/diagnostic_logger_test.dart b/dart/test/diagnostic_logger_test.dart new file mode 100644 index 0000000000..ec53421e33 --- /dev/null +++ b/dart/test/diagnostic_logger_test.dart @@ -0,0 +1,64 @@ +import 'package:sentry/sentry.dart'; +import 'package:sentry/src/diagnostic_logger.dart'; +import 'package:test/test.dart'; + +void main() { + late Fixture fixture; + + setUp(() { + fixture = Fixture(); + }); + + test('$DiagnosticLogger do not log if debug is disabled', () { + fixture.options.debug = false; + + fixture.getSut().log(SentryLevel.error, 'foobar'); + + expect(fixture.loggedMessage, isNull); + }); + + test('$DiagnosticLogger log if debug is enabled', () { + fixture.options.debug = true; + + fixture.getSut().log(SentryLevel.error, 'foobar'); + + expect(fixture.loggedMessage, 'foobar'); + }); + + test('$DiagnosticLogger do not log if level is too low', () { + fixture.options.debug = true; + fixture.options.diagnosticLevel = SentryLevel.error; + + fixture.getSut().log(SentryLevel.warning, 'foobar'); + + expect(fixture.loggedMessage, isNull); + }); + + test('$DiagnosticLogger always log fatal', () { + fixture.options.debug = false; + + fixture.getSut().log(SentryLevel.fatal, 'foobar'); + + expect(fixture.loggedMessage, 'foobar'); + }); +} + +class Fixture { + var options = SentryOptions(); + + Object? loggedMessage; + + DiagnosticLogger getSut() { + return DiagnosticLogger(mockLogger, options); + } + + void mockLogger( + SentryLevel level, + String message, { + String? logger, + Object? exception, + StackTrace? stackTrace, + }) { + loggedMessage = message; + } +} diff --git a/dart/test/environment_test.dart b/dart/test/environment_test.dart index 6a409022c5..b16225d1dd 100644 --- a/dart/test/environment_test.dart +++ b/dart/test/environment_test.dart @@ -23,7 +23,7 @@ void main() { release: 'release-9.8.7', dist: 'bar', ); - options.devMode = true; + options.automatedTestMode = true; await Sentry.init( (options) => options, @@ -39,19 +39,19 @@ void main() { test('SentryOptions are overriden by environment', () async { final options = SentryOptions(); options.environmentVariables = MockEnvironmentVariables( - dsn: 'foo-bar', + dsn: fakeDsn, environment: 'staging', release: 'release-9.8.7', dist: 'bar', ); - options.devMode = true; + options.automatedTestMode = true; await Sentry.init( (options) => options, options: options, ); - expect(options.dsn, 'foo-bar'); + expect(options.dsn, fakeDsn); expect(options.environment, 'staging'); expect(options.release, 'release-9.8.7'); expect(options.dist, 'bar'); diff --git a/dart/test/event_processor/deduplication_event_processor_test.dart b/dart/test/event_processor/deduplication_event_processor_test.dart index 4ced85c113..3e17fe4065 100644 --- a/dart/test/event_processor/deduplication_event_processor_test.dart +++ b/dart/test/event_processor/deduplication_event_processor_test.dart @@ -77,7 +77,7 @@ void main() { final transport = MockTransport(); - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( (options) { options.dsn = fakeDsn; diff --git a/dart/test/event_processor/enricher/io_enricher_test.dart b/dart/test/event_processor/enricher/io_enricher_test.dart index fcf37f958e..72080cba3f 100644 --- a/dart/test/event_processor/enricher/io_enricher_test.dart +++ b/dart/test/event_processor/enricher/io_enricher_test.dart @@ -159,7 +159,7 @@ void main() { }); test('$IoEnricherEventProcessor gets added on init', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; late SentryOptions configuredOptions; await Sentry.init( (options) { diff --git a/dart/test/hint_test.dart b/dart/test/hint_test.dart index d46a022405..04c09a28a0 100644 --- a/dart/test/hint_test.dart +++ b/dart/test/hint_test.dart @@ -82,6 +82,23 @@ void main() { expect(sut.screenshot, attachment); expect(sut.viewHierarchy, attachment); }); + + test('Hint init with map null fallback', () { + final hint = Hint.withMap({'fixture-key': null}); + expect("null", hint.get("fixture-key")); + }); + + test('Hint addAll with map null fallback', () { + final hint = Hint(); + hint.addAll({'fixture-key': null}); + expect("null", hint.get("fixture-key")); + }); + + test('Hint set with null value fallback', () { + final hint = Hint(); + hint.set("fixture-key", null); + expect("null", hint.get("fixture-key")); + }); } class Fixture { diff --git a/dart/test/http_client/tracing_client_test.dart b/dart/test/http_client/tracing_client_test.dart index dce3b3ef31..cc48d5cb37 100644 --- a/dart/test/http_client/tracing_client_test.dart +++ b/dart/test/http_client/tracing_client_test.dart @@ -38,7 +38,7 @@ void main() { expect(span.status, SpanStatus.ok()); expect(span.context.operation, 'http.client'); expect(span.context.description, 'GET https://example.com'); - expect(span.data['http.method'], 'GET'); + expect(span.data['http.request.method'], 'GET'); expect(span.data['url'], 'https://example.com'); expect(span.data['http.query'], 'foo=bar'); expect(span.data['http.fragment'], 'baz'); @@ -141,20 +141,6 @@ void main() { expect(response.request!.headers[sentryTrace.name], sentryTrace.value); }); - test('captured span do not add headers if NoOp', () async { - final sut = fixture.getSut( - client: fixture.getClient(statusCode: 200, reason: 'OK'), - ); - - await fixture._hub - .configureScope((scope) => scope.span = NoOpSentrySpan()); - - final response = await sut.get(requestUri); - - expect(response.request!.headers['baggage'], null); - expect(response.request!.headers['sentry-trace'], null); - }); - test('captured span do not add headers if origins not set', () async { final sut = fixture.getSut( client: fixture.getClient( @@ -188,6 +174,38 @@ void main() { await sut.get(requestUri); }); + + test('set headers from propagationContext when tracing is disabled', + () async { + fixture._options.enableTracing = false; + final sut = fixture.getSut( + client: fixture.getClient(statusCode: 200, reason: 'OK'), + ); + + final propagationContext = fixture._hub.scope.propagationContext; + propagationContext.baggage = SentryBaggage({'foo': 'bar'}); + + final response = await sut.get(requestUri); + + expect(response.request!.headers['sentry-trace'], + propagationContext.toSentryTrace().value); + expect(response.request!.headers['baggage'], 'foo=bar'); + }); + + test('set headers from propagationContext when no transaction', () async { + final sut = fixture.getSut( + client: fixture.getClient(statusCode: 200, reason: 'OK'), + ); + + final propagationContext = fixture._hub.scope.propagationContext; + propagationContext.baggage = SentryBaggage({'foo': 'bar'}); + + final response = await sut.get(requestUri); + + expect(response.request!.headers['sentry-trace'], + propagationContext.toSentryTrace().value); + expect(response.request!.headers['baggage'], 'foo=bar'); + }); }); } diff --git a/dart/test/hub_test.dart b/dart/test/hub_test.dart index 32e0f1021c..31698329d6 100644 --- a/dart/test/hub_test.dart +++ b/dart/test/hub_test.dart @@ -1,4 +1,5 @@ import 'package:collection/collection.dart'; +import 'package:mockito/mockito.dart'; import 'package:sentry/sentry.dart'; import 'package:sentry/src/client_reports/discard_reason.dart'; import 'package:sentry/src/sentry_tracer.dart'; @@ -6,6 +7,7 @@ import 'package:sentry/src/transport/data_category.dart'; import 'package:test/test.dart'; import 'mocks.dart'; +import 'mocks.mocks.dart'; import 'mocks/mock_client_report_recorder.dart'; import 'mocks/mock_sentry_client.dart'; @@ -148,8 +150,8 @@ void main() { final capturedEvent = fixture.client.captureEventCalls.first; - expect(capturedEvent.event.transaction, isNull); - expect(capturedEvent.event.contexts.trace, isNull); + expect(capturedEvent.event.transaction, 'test'); + expect(capturedEvent.event.contexts.trace, isNotNull); }); }); @@ -374,6 +376,70 @@ void main() { expect( fixture.client.captureTransactionCalls.first.traceContext, context); }); + + test('profiler is not started by default', () async { + final hub = fixture.getSut(); + final tr = hub.startTransaction('name', 'op'); + expect(tr, isA()); + expect((tr as SentryTracer).profiler, isNull); + }); + + test('profiler is started according to the sampling rate', () async { + final hub = fixture.getSut(); + final factory = MockSentryProfilerFactory(); + when(factory.startProfiler(fixture._context)) + .thenReturn(MockSentryProfiler()); + hub.profilerFactory = factory; + + var tr = hub.startTransactionWithContext(fixture._context); + expect((tr as SentryTracer).profiler, isNull); + verifyZeroInteractions(factory); + + hub.options.profilesSampleRate = 1.0; + tr = hub.startTransactionWithContext(fixture._context); + expect((tr as SentryTracer).profiler, isNotNull); + verify(factory.startProfiler(fixture._context)).called(1); + }); + + test('profiler.finish() is called', () async { + final hub = fixture.getSut(); + final factory = MockSentryProfilerFactory(); + final profiler = MockSentryProfiler(); + final expected = MockSentryProfileInfo(); + when(factory.startProfiler(fixture._context)).thenReturn(profiler); + when(profiler.finishFor(any)).thenAnswer((_) async => expected); + + hub.profilerFactory = factory; + hub.options.profilesSampleRate = 1.0; + final tr = hub.startTransactionWithContext(fixture._context); + await tr.finish(); + verify(profiler.finishFor(any)).called(1); + verify(profiler.dispose()).called(1); + }); + + test('profiler.dispose() is called even if not captured', () async { + final hub = fixture.getSut(); + final factory = MockSentryProfilerFactory(); + final profiler = MockSentryProfiler(); + final expected = MockSentryProfileInfo(); + when(factory.startProfiler(fixture._context)).thenReturn(profiler); + when(profiler.finishFor(any)).thenAnswer((_) async => expected); + + hub.profilerFactory = factory; + hub.options.profilesSampleRate = 1.0; + final tr = hub.startTransactionWithContext(fixture._context); + await tr.finish(status: SpanStatus.aborted()); + verify(profiler.dispose()).called(1); + verifyNever(profiler.finishFor(any)); + }); + + test('returns scope', () async { + final hub = fixture.getSut(); + + final scope = hub.scope; + + expect(scope, isNotNull); + }); }); group('Hub scope', () { @@ -641,10 +707,12 @@ class Fixture { final hub = Hub(options); + // A fully configured context - won't trigger a copy in startTransaction(). _context = SentryTransactionContext( 'name', 'op', samplingDecision: SentryTracesSamplingDecision(sampled!), + origin: SentryTraceOrigins.manual, ); tracer = SentryTracer(_context, hub); diff --git a/dart/test/initialization_test.dart b/dart/test/initialization_test.dart index fae9f26e82..7eb8c15265 100644 --- a/dart/test/initialization_test.dart +++ b/dart/test/initialization_test.dart @@ -14,7 +14,7 @@ void main() { }); test('async re-initilization', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( (options) { options.dsn = fakeDsn; @@ -35,7 +35,7 @@ void main() { // This is the failure from // https://github.com/getsentry/sentry-dart/issues/508 test('re-initilization', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( (options) { options.dsn = fakeDsn; diff --git a/dart/test/mocks.dart b/dart/test/mocks.dart index 08058d3b32..82a6fe329d 100644 --- a/dart/test/mocks.dart +++ b/dart/test/mocks.dart @@ -1,4 +1,6 @@ +import 'package:mockito/annotations.dart'; import 'package:sentry/sentry.dart'; +import 'package:sentry/src/profiling.dart'; import 'package:sentry/src/transport/rate_limiter.dart'; final fakeDsn = 'https://abc@def.ingest.sentry.io/1234567'; @@ -149,3 +151,10 @@ class MockRateLimiter implements RateLimiter { this.errorCode = errorCode; } } + +@GenerateMocks([ + SentryProfilerFactory, + SentryProfiler, + SentryProfileInfo, +]) +void main() {} diff --git a/dart/test/mocks.mocks.dart b/dart/test/mocks.mocks.dart new file mode 100644 index 0000000000..5f2556400e --- /dev/null +++ b/dart/test/mocks.mocks.dart @@ -0,0 +1,101 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in sentry/test/mocks.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:sentry/sentry.dart' as _i2; +import 'package:sentry/src/profiling.dart' as _i3; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeSentryEnvelopeItem_0 extends _i1.SmartFake + implements _i2.SentryEnvelopeItem { + _FakeSentryEnvelopeItem_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [SentryProfilerFactory]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSentryProfilerFactory extends _i1.Mock + implements _i3.SentryProfilerFactory { + MockSentryProfilerFactory() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.SentryProfiler? startProfiler(_i2.SentryTransactionContext? context) => + (super.noSuchMethod(Invocation.method( + #startProfiler, + [context], + )) as _i3.SentryProfiler?); +} + +/// A class which mocks [SentryProfiler]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSentryProfiler extends _i1.Mock implements _i3.SentryProfiler { + MockSentryProfiler() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i3.SentryProfileInfo?> finishFor( + _i2.SentryTransaction? transaction) => + (super.noSuchMethod( + Invocation.method( + #finishFor, + [transaction], + ), + returnValue: _i4.Future<_i3.SentryProfileInfo?>.value(), + ) as _i4.Future<_i3.SentryProfileInfo?>); + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [SentryProfileInfo]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSentryProfileInfo extends _i1.Mock implements _i3.SentryProfileInfo { + MockSentryProfileInfo() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.SentryEnvelopeItem asEnvelopeItem() => (super.noSuchMethod( + Invocation.method( + #asEnvelopeItem, + [], + ), + returnValue: _FakeSentryEnvelopeItem_0( + this, + Invocation.method( + #asEnvelopeItem, + [], + ), + ), + ) as _i2.SentryEnvelopeItem); +} diff --git a/dart/test/mocks/mock_hub.dart b/dart/test/mocks/mock_hub.dart index d8b4d7384b..351ad70672 100644 --- a/dart/test/mocks/mock_hub.dart +++ b/dart/test/mocks/mock_hub.dart @@ -131,6 +131,9 @@ class MockHub with NoSuchMethodProvider implements Hub { void setSpanContext(throwable, ISentrySpan span, String transaction) { spanContextCals++; } + + @override + Scope get scope => Scope(_options); } class CaptureEventCall { diff --git a/dart/test/protocol/sentry_app_test.dart b/dart/test/protocol/sentry_app_test.dart index 6c72e956d3..6fd4236efc 100644 --- a/dart/test/protocol/sentry_app_test.dart +++ b/dart/test/protocol/sentry_app_test.dart @@ -14,6 +14,7 @@ void main() { startTime: testStartTime, deviceAppHash: 'fixture-deviceAppHash', inForeground: true, + viewNames: ['fixture-viewName', 'fixture-viewName2'], ); final sentryAppJson = { @@ -25,25 +26,36 @@ void main() { 'app_start_time': testStartTime.toIso8601String(), 'device_app_hash': 'fixture-deviceAppHash', 'in_foreground': true, + 'view_names': ['fixture-viewName', 'fixture-viewName2'], }; group('json', () { test('toJson', () { final json = sentryApp.toJson(); - expect( - MapEquality().equals(sentryAppJson, json), - true, - ); + expect(json['app_name'], 'fixture-name'); + expect(json['app_version'], 'fixture-version'); + expect(json['app_identifier'], 'fixture-identifier'); + expect(json['app_build'], 'fixture-build'); + expect(json['build_type'], 'fixture-buildType'); + expect(json['app_start_time'], testStartTime.toIso8601String()); + expect(json['device_app_hash'], 'fixture-deviceAppHash'); + expect(json['in_foreground'], true); + expect(json['view_names'], ['fixture-viewName', 'fixture-viewName2']); }); test('fromJson', () { final sentryApp = SentryApp.fromJson(sentryAppJson); final json = sentryApp.toJson(); - expect( - MapEquality().equals(sentryAppJson, json), - true, - ); + expect(json['app_name'], 'fixture-name'); + expect(json['app_version'], 'fixture-version'); + expect(json['app_identifier'], 'fixture-identifier'); + expect(json['app_build'], 'fixture-build'); + expect(json['build_type'], 'fixture-buildType'); + expect(json['app_start_time'], testStartTime.toIso8601String()); + expect(json['device_app_hash'], 'fixture-deviceAppHash'); + expect(json['in_foreground'], true); + expect(json['view_names'], ['fixture-viewName', 'fixture-viewName2']); }); }); @@ -73,6 +85,7 @@ void main() { startTime: startTime, deviceAppHash: 'hash1', inForeground: true, + viewNames: ['screen1'], ); expect('name1', copy.name); @@ -83,6 +96,7 @@ void main() { expect(startTime, copy.startTime); expect('hash1', copy.deviceAppHash); expect(true, copy.inForeground); + expect(['screen1'], copy.viewNames); }); }); } diff --git a/dart/test/protocol/sentry_baggage_header_test.dart b/dart/test/protocol/sentry_baggage_header_test.dart index 4fdb6a13d4..38428be41a 100644 --- a/dart/test/protocol/sentry_baggage_header_test.dart +++ b/dart/test/protocol/sentry_baggage_header_test.dart @@ -20,11 +20,12 @@ void main() { baggage.setUserSegment('userSegment'); baggage.setTransaction('transaction'); baggage.setSampleRate('1.0'); + baggage.setSampled('false'); final baggageHeader = SentryBaggageHeader.fromBaggage(baggage); expect(baggageHeader.value, - 'sentry-trace_id=$id,sentry-public_key=publicKey,sentry-release=release,sentry-environment=environment,sentry-user_id=userId,sentry-user_segment=userSegment,sentry-transaction=transaction,sentry-sample_rate=1.0'); + 'sentry-trace_id=$id,sentry-public_key=publicKey,sentry-release=release,sentry-environment=environment,sentry-user_id=userId,sentry-user_segment=userSegment,sentry-transaction=transaction,sentry-sample_rate=1.0,sentry-sampled=false'); }); }); } diff --git a/dart/test/run_zoned_guarded_integration_test.dart b/dart/test/run_zoned_guarded_integration_test.dart index 7e8045445d..13b102d7da 100644 --- a/dart/test/run_zoned_guarded_integration_test.dart +++ b/dart/test/run_zoned_guarded_integration_test.dart @@ -54,6 +54,23 @@ void main() { expect(onErrorCalled, true); }); + + test('sets level to error instead of fatal', () async { + final exception = StateError('error'); + final stackTrace = StackTrace.current; + + final hub = Hub(fixture.options); + final client = MockSentryClient(); + hub.bindClient(client); + + final sut = fixture.getSut(runner: () async {}); + + fixture.options.markAutomaticallyCollectedErrorsAsFatal = false; + await sut.captureError(hub, fixture.options, exception, stackTrace); + + final capturedEvent = client.captureEventCalls.last.event; + expect(capturedEvent.level, SentryLevel.error); + }); }); } diff --git a/dart/test/scope_test.dart b/dart/test/scope_test.dart index d93b1cf112..66cc543b6b 100644 --- a/dart/test/scope_test.dart +++ b/dart/test/scope_test.dart @@ -395,6 +395,14 @@ void main() { expect(1, fixture.mockScopeObserver.numberOfRemoveTagCalls); }); + test('clone has disabled scope sync', () async { + final sut = fixture.getSut(scopeObserver: fixture.mockScopeObserver); + final clone = sut.clone(); + + await clone.setContexts("fixture-contexts-key", "fixture-contexts-value"); + expect(0, fixture.mockScopeObserver.numberOfSetContextsCalls); + }); + group('Scope apply', () { final scopeUser = SentryUser( id: '800', diff --git a/dart/test/sentry_client_test.dart b/dart/test/sentry_client_test.dart index 522bfcae73..121151f640 100644 --- a/dart/test/sentry_client_test.dart +++ b/dart/test/sentry_client_test.dart @@ -13,6 +13,7 @@ import 'package:sentry/src/sentry_stack_trace_factory.dart'; import 'package:sentry/src/sentry_tracer.dart'; import 'package:sentry/src/transport/data_category.dart'; import 'package:sentry/src/utils/iterable_utils.dart'; +import 'package:sentry/src/transport/spotlight_http_transport.dart'; import 'package:test/test.dart'; import 'mocks.dart'; @@ -543,6 +544,137 @@ void main() { fixture = Fixture(); }); + test( + 'when scope does not have an active transaction, trace state is set on the envelope from scope', + () async { + final client = fixture.getSut(); + final scope = Scope(fixture.options); + await client.captureEvent(SentryEvent(), scope: scope); + + final capturedEnvelope = (fixture.transport).envelopes.first; + final capturedTraceContext = capturedEnvelope.header.traceContext; + final capturedTraceId = capturedTraceContext?.traceId; + final propagationContextTraceId = scope.propagationContext.traceId; + + expect(capturedTraceContext, isNotNull); + expect(capturedTraceId, propagationContextTraceId); + }); + + test('attaches trace context from span if none present yet', () async { + final client = fixture.getSut(); + final spanContext = SentrySpanContext( + traceId: SentryId.newId(), + spanId: SpanId.newId(), + operation: 'op.load', + ); + final scope = Scope(fixture.options); + scope.span = SentrySpan(fixture.tracer, spanContext, MockHub()); + + final sentryEvent = SentryEvent(); + await client.captureEvent(sentryEvent, scope: scope); + + expect(fixture.transport.envelopes.length, 1); + expect(spanContext.spanId, sentryEvent.contexts.trace!.spanId); + expect(spanContext.traceId, sentryEvent.contexts.trace!.traceId); + }); + + test( + 'attaches trace context from scope if none present yet and no span on scope', + () async { + final client = fixture.getSut(); + + final scope = Scope(fixture.options); + final scopePropagationContext = scope.propagationContext; + + final sentryEvent = SentryEvent(); + await client.captureEvent(sentryEvent, scope: scope); + + expect(fixture.transport.envelopes.length, 1); + expect( + scopePropagationContext.traceId, sentryEvent.contexts.trace!.traceId); + expect( + scopePropagationContext.spanId, sentryEvent.contexts.trace!.spanId); + }); + + test('keeps existing trace context if already present', () async { + final client = fixture.getSut(); + + final spanContext = SentrySpanContext( + traceId: SentryId.newId(), + spanId: SpanId.newId(), + operation: 'op.load', + ); + final scope = Scope(fixture.options); + scope.span = SentrySpan(fixture.tracer, spanContext, MockHub()); + + final propagationContext = scope.propagationContext; + final preExistingSpanContext = SentryTraceContext( + traceId: SentryId.newId(), + spanId: SpanId.newId(), + operation: 'op.load'); + + final sentryEvent = SentryEvent(); + sentryEvent.contexts.trace = preExistingSpanContext; + await client.captureEvent(sentryEvent, scope: scope); + + expect(fixture.transport.envelopes.length, 1); + expect( + preExistingSpanContext.traceId, sentryEvent.contexts.trace!.traceId); + expect(preExistingSpanContext.spanId, sentryEvent.contexts.trace!.spanId); + expect(spanContext.traceId, isNot(sentryEvent.contexts.trace!.traceId)); + expect(spanContext.spanId, isNot(sentryEvent.contexts.trace!.spanId)); + expect(propagationContext.traceId, + isNot(sentryEvent.contexts.trace!.traceId)); + expect( + propagationContext.spanId, isNot(sentryEvent.contexts.trace!.spanId)); + }); + + test( + 'uses propagation context on scope for trace header if no transaction is on scope', + () async { + final client = fixture.getSut(); + + final scope = Scope(fixture.options); + final scopePropagationContext = scope.propagationContext; + + final sentryEvent = SentryEvent(); + await client.captureEvent(sentryEvent, scope: scope); + + final capturedEnvelope = fixture.transport.envelopes.first; + final capturedTraceContext = capturedEnvelope.header.traceContext; + + expect(fixture.transport.envelopes.length, 1); + expect(scope.span, isNull); + expect(capturedTraceContext, isNotNull); + expect(scopePropagationContext.traceId, capturedTraceContext!.traceId); + }); + + test( + 'uses trace context on transaction for trace header if a transaction is on scope', + () async { + final client = fixture.getSut(); + + final spanContext = SentrySpanContext( + traceId: SentryId.newId(), + spanId: SpanId.newId(), + operation: 'op.load', + ); + final scope = Scope(fixture.options); + scope.span = SentrySpan(fixture.tracer, spanContext, MockHub()); + + final sentryEvent = SentryEvent(); + await client.captureEvent(sentryEvent, scope: scope); + + final capturedEnvelope = fixture.transport.envelopes.first; + final capturedTraceContext = capturedEnvelope.header.traceContext; + + expect(fixture.transport.envelopes.length, 1); + expect(scope.span, isNotNull); + expect(capturedTraceContext, isNotNull); + expect( + scope.span!.traceContext()!.traceId, capturedTraceContext!.traceId); + }); + test('should contain a transaction in the envelope', () async { try { throw StateError('Error'); @@ -847,8 +979,7 @@ void main() { expect(capturedEvent.user?.ipAddress, '{{auto}}'); }); - test('event has a user with IP address', - () async { + test('event has a user with IP address', () async { final client = fixture.getSut(sendDefaultPii: true); await client.captureEvent(fakeEvent); @@ -864,8 +995,7 @@ void main() { expect(capturedEvent.user?.email, fakeEvent.user!.email); }); - test('event has a user without IP address', - () async { + test('event has a user without IP address', () async { final client = fixture.getSut(sendDefaultPii: true); final event = fakeEvent.copyWith(user: fakeUser); @@ -1372,6 +1502,14 @@ void main() { expect(capturedEnvelope.header.dsn, fixture.options.dsn); }); + + test('Spotlight enabled should set transport to SpotlightHttpTransport', + () async { + fixture.options.spotlight = Spotlight(enabled: true); + fixture.getSut(); + + expect(fixture.options.transport is SpotlightHttpTransport, true); + }); }); } diff --git a/dart/test/sentry_isolate_test.dart b/dart/test/sentry_isolate_test.dart index 1b1939ac2f..7cebc3e5e4 100644 --- a/dart/test/sentry_isolate_test.dart +++ b/dart/test/sentry_isolate_test.dart @@ -1,6 +1,7 @@ @TestOn('vm') import 'package:sentry/src/hub.dart'; +import 'package:sentry/src/protocol/sentry_level.dart'; import 'package:sentry/src/protocol/span_status.dart'; import 'package:sentry/src/sentry_isolate.dart'; import 'package:sentry/src/sentry_options.dart'; @@ -48,6 +49,23 @@ void main() { await span?.finish(); }); + + test('sets level to error instead of fatal', () async { + final exception = StateError('error'); + final stackTrace = StackTrace.current.toString(); + + final hub = Hub(fixture.options); + final client = MockSentryClient(); + hub.bindClient(client); + + fixture.options.markAutomaticallyCollectedErrorsAsFatal = false; + + await SentryIsolate.handleIsolateError( + hub, [exception.toString(), stackTrace]); + + final capturedEvent = client.captureEventCalls.last.event; + expect(capturedEvent.level, SentryLevel.error); + }); }); } diff --git a/dart/test/sentry_options_test.dart b/dart/test/sentry_options_test.dart index f6dec29e90..e921c87b32 100644 --- a/dart/test/sentry_options_test.dart +++ b/dart/test/sentry_options_test.dart @@ -127,4 +127,10 @@ void main() { expect(options.isTracingEnabled(), false); }); + + test('Spotlight is disabled by default', () { + final options = SentryOptions(dsn: fakeDsn); + + expect(options.spotlight.enabled, false); + }); } diff --git a/dart/test/sentry_test.dart b/dart/test/sentry_test.dart index 2705f23161..b041f19527 100644 --- a/dart/test/sentry_test.dart +++ b/dart/test/sentry_test.dart @@ -18,7 +18,7 @@ void main() { var anException = Exception(); setUp(() async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) => { @@ -137,7 +137,7 @@ void main() { }); test('null DSN', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; expect( () async => await Sentry.init( options: options, @@ -150,7 +150,7 @@ void main() { test('appRunner should be optional', () async { expect(Sentry.isEnabled, false); - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) => options.dsn = fakeDsn, @@ -159,7 +159,7 @@ void main() { }); test('empty DSN', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) => options.dsn = '', @@ -170,7 +170,7 @@ void main() { test('empty DSN disables the SDK but runs the integrations', () async { final integration = MockIntegration(); - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) { @@ -183,7 +183,7 @@ void main() { }); test('close disables the SDK', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) => options.dsn = fakeDsn, @@ -207,7 +207,7 @@ void main() { test('should install integrations', () async { final integration = MockIntegration(); - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) { @@ -221,7 +221,7 @@ void main() { test('should add default integrations', () async { late SentryOptions optionsReference; - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) { @@ -245,7 +245,7 @@ void main() { }, onPlatform: {'browser': Skip()}); test('should add only web compatible default integrations', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) { @@ -261,7 +261,7 @@ void main() { test('should close integrations', () async { final integration = MockIntegration(); - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) { @@ -277,7 +277,7 @@ void main() { }); test('$DeduplicationEventProcessor is added on init', () async { - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; await Sentry.init( options: options, (options) { @@ -294,7 +294,7 @@ void main() { final completer = Completer(); var completed = false; - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; final init = Sentry.init( options: options, (options) { @@ -321,7 +321,7 @@ void main() { final completer = Completer(); var completed = false; - final options = SentryOptions(dsn: fakeDsn)..devMode = true; + final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true; final init = Sentry.init( options: options, (options) { @@ -345,11 +345,11 @@ void main() { test('options.environment debug', () async { final sentryOptions = SentryOptions(dsn: fakeDsn) - ..devMode = true + ..automatedTestMode = true ..platformChecker = FakePlatformChecker.debugMode(); final options = SentryOptions(); - options.devMode = true; + options.automatedTestMode = true; await Sentry.init( (options) { options.dsn = fakeDsn; @@ -363,7 +363,7 @@ void main() { test('options.environment profile', () async { final sentryOptions = SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.profileMode()) - ..devMode = true; + ..automatedTestMode = true; await Sentry.init( (options) { @@ -378,7 +378,7 @@ void main() { test('options.environment production (defaultEnvironment)', () async { final sentryOptions = SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.releaseMode()) - ..devMode = true; + ..automatedTestMode = true; await Sentry.init( (options) { options.dsn = fakeDsn; @@ -392,7 +392,7 @@ void main() { test('options.logger is set by setting the debug flag', () async { final sentryOptions = SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.debugMode()) - ..devMode = true; + ..automatedTestMode = true; await Sentry.init( (options) { @@ -417,7 +417,7 @@ void main() { test('throw is handled and logged', () async { final sentryOptions = SentryOptions(dsn: fakeDsn) - ..devMode = false + ..automatedTestMode = false ..debug = true ..logger = fixture.mockLogger; @@ -439,7 +439,7 @@ void main() { test('throw is handled and logged', () async { final sentryOptions = SentryOptions(dsn: fakeDsn) - ..devMode = false + ..automatedTestMode = false ..debug = true ..logger = fixture.mockLogger; diff --git a/dart/test/sentry_trace_context_header_test.dart b/dart/test/sentry_trace_context_header_test.dart index 8de346c943..6ba6d93bc2 100644 --- a/dart/test/sentry_trace_context_header_test.dart +++ b/dart/test/sentry_trace_context_header_test.dart @@ -14,6 +14,7 @@ void main() { 'user_segment': 'user_segment', 'transaction': 'transaction', 'sample_rate': '1.0', + 'sampled': 'false' }; final context = SentryTraceContextHeader.fromJson(mapJson); @@ -26,6 +27,7 @@ void main() { expect(context.userSegment, 'user_segment'); expect(context.transaction, 'transaction'); expect(context.sampleRate, '1.0'); + expect(context.sampled, 'false'); }); test('toJson', () { @@ -38,7 +40,7 @@ void main() { final baggage = context.toBaggage(); expect(baggage.toHeaderString(), - 'sentry-trace_id=${id.toString()},sentry-public_key=123,sentry-release=release,sentry-environment=environment,sentry-user_id=user_id,sentry-user_segment=user_segment,sentry-transaction=transaction,sentry-sample_rate=1.0'); + 'sentry-trace_id=${id.toString()},sentry-public_key=123,sentry-release=release,sentry-environment=environment,sentry-user_id=user_id,sentry-user_segment=user_segment,sentry-transaction=transaction,sentry-sample_rate=1.0,sentry-sampled=false'); }); }); } diff --git a/dart/test/sentry_tracer_test.dart b/dart/test/sentry_tracer_test.dart index 24649e23b2..684e2e97f2 100644 --- a/dart/test/sentry_tracer_test.dart +++ b/dart/test/sentry_tracer_test.dart @@ -473,6 +473,7 @@ void main() { expect(newBaggage.get('sentry-user_segment'), 'segment'); expect(newBaggage.get('sentry-transaction'), 'name'); expect(newBaggage.get('sentry-sample_rate'), '1'); + expect(newBaggage.get('sentry-sampled'), 'true'); }); test('skip transaction name if low cardinality', () { @@ -546,6 +547,7 @@ void main() { expect(context.userSegment, 'segment'); expect(context.transaction, 'name'); expect(context.sampleRate, '1'); + expect(context.sampled, 'true'); }); }); } diff --git a/dart/test/transport/spotlight_http_transport_test.dart b/dart/test/transport/spotlight_http_transport_test.dart new file mode 100644 index 0000000000..b23f1fd87f --- /dev/null +++ b/dart/test/transport/spotlight_http_transport_test.dart @@ -0,0 +1,70 @@ +import 'package:http/http.dart' as http; +import 'package:http/testing.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry/src/transport/http_transport.dart'; +import 'package:sentry/src/transport/rate_limiter.dart'; +import 'package:sentry/src/transport/spotlight_http_transport.dart'; +import 'package:test/expect.dart'; +import 'package:test/scaffolding.dart'; + +import '../mocks.dart'; +import '../mocks/mock_client_report_recorder.dart'; + +void main() { + group('send to Sentry', () { + late Fixture fixture; + + setUp(() { + fixture = Fixture(); + }); + + test('send event to Sentry even if Spotlight fails', () async { + List? body; + + final httpMock = MockClient((http.Request request) async { + body = request.bodyBytes; + if (request.url.toString() == fixture.options.spotlight.url) { + return http.Response('{}', 500); + } + return http.Response('{}', 200); + }); + + fixture.options.compressPayload = false; + final mockRateLimiter = MockRateLimiter(); + final sut = fixture.getSut(httpMock, mockRateLimiter); + + final sentryEvent = SentryEvent(); + final envelope = SentryEnvelope.fromEvent( + sentryEvent, + fixture.options.sdk, + dsn: fixture.options.dsn, + ); + await sut.send(envelope); + + final envelopeData = []; + await envelope + .envelopeStream(fixture.options) + .forEach(envelopeData.addAll); + + expect(body, envelopeData); + }); + }); +} + +class Fixture { + final options = SentryOptions( + dsn: 'https://public:secret@sentry.example.com/1', + ); + + late var clientReportRecorder = MockClientReportRecorder(); + + Transport getSut(http.Client client, RateLimiter rateLimiter) { + options.httpClient = client; + options.recorder = clientReportRecorder; + options.clock = () { + return DateTime.utc(2019); + }; + final httpTransport = HttpTransport(options, rateLimiter); + return SpotlightHttpTransport(options, httpTransport); + } +} diff --git a/dart/test/unsupported_throwables_test.dart b/dart/test/unsupported_throwables_test.dart new file mode 100644 index 0000000000..9cac063a34 --- /dev/null +++ b/dart/test/unsupported_throwables_test.dart @@ -0,0 +1,92 @@ +import 'package:sentry/src/hub.dart'; +import 'package:test/expect.dart'; +import 'package:test/scaffolding.dart'; + +void main() { + late Fixture fixture; + + setUp(() { + fixture = Fixture(); + }); + + group('unsupported throwable types', () { + test('wrapped string throwable does not throw when expanding', () async { + final throwableHandler = fixture.sut; + final unsupportedThrowable = 'test throwable'; + final wrappedThrowable = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + + expect(() { + fixture.expando[wrappedThrowable]; + }, returnsNormally); + }); + + test('wrapped int throwable does not throw when expanding', () async { + final throwableHandler = fixture.sut; + final unsupportedThrowable = 1; + final wrappedThrowable = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + + expect(() { + fixture.expando[wrappedThrowable]; + }, returnsNormally); + }); + + test('wrapped double throwable does not throw when expanding', () async { + final throwableHandler = fixture.sut; + final unsupportedThrowable = 1.0; + final wrappedThrowable = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + + expect(() { + fixture.expando[wrappedThrowable]; + }, returnsNormally); + }); + + test('wrapped bool throwable does not throw when expanding', () async { + final throwableHandler = fixture.sut; + final unsupportedThrowable = true; + final wrappedThrowable = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + + expect(() { + fixture.expando[wrappedThrowable]; + }, returnsNormally); + }); + + test( + 'creating multiple instances of string wrapped exceptions accesses the same expando value', + () async { + final unsupportedThrowable = 'test throwable'; + final throwableHandler = fixture.sut; + + final first = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + fixture.expando[first] = 1; + + final second = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + expect(fixture.expando[second], 1); + fixture.expando[second] = 2.0; + + final third = + throwableHandler.wrapIfUnsupportedType(unsupportedThrowable); + expect(fixture.expando[third], 2.0); + }); + }); + + group('supported throwable type', () { + test('does not wrap exception if it is a supported type', () async { + final supportedThrowable = Exception('test throwable'); + final result = fixture.sut.wrapIfUnsupportedType(supportedThrowable); + + expect(result, supportedThrowable); + }); + }); +} + +class Fixture { + final expando = Expando(); + + UnsupportedThrowablesHandler get sut => UnsupportedThrowablesHandler(); +} diff --git a/dart/test/utils/tracing_utils_test.dart b/dart/test/utils/tracing_utils_test.dart index 39d6da6349..96b26b55b1 100644 --- a/dart/test/utils/tracing_utils_test.dart +++ b/dart/test/utils/tracing_utils_test.dart @@ -50,15 +50,25 @@ void main() { }); }); - group('$addSentryTraceHeader', () { + group('$addSentryTraceHeaderFromSpan', () { final fixture = Fixture(); + test('adds sentry trace header from span', () { + final headers = {}; + final sut = fixture.getSut(); + final sentryHeader = sut.toSentryTrace(); + + addSentryTraceHeaderFromSpan(sut, headers); + + expect(headers[sentryHeader.name], sentryHeader.value); + }); + test('adds sentry trace header', () { final headers = {}; final sut = fixture.getSut(); final sentryHeader = sut.toSentryTrace(); - addSentryTraceHeader(sut, headers); + addSentryTraceHeader(sentryHeader, headers); expect(headers[sentryHeader.name], sentryHeader.value); }); @@ -72,12 +82,22 @@ void main() { final sut = fixture.getSut(); final baggage = sut.toBaggageHeader(); - addBaggageHeader(sut, headers); + addBaggageHeader(sut.toBaggageHeader()!, headers); + + expect(headers[baggage!.name], baggage.value); + }); + + test('adds baggage header from span', () { + final headers = {}; + final sut = fixture.getSut(); + final baggage = sut.toBaggageHeader(); + + addBaggageHeaderFromSpan(sut, headers); expect(headers[baggage!.name], baggage.value); }); - test('appends baggage header', () { + test('appends baggage header from span', () { final headers = {}; final oldValue = 'other-vendor-value-1=foo'; headers['baggage'] = oldValue; @@ -87,7 +107,7 @@ void main() { final newValue = '$oldValue,${baggage!.value}'; - addBaggageHeader(sut, headers); + addBaggageHeaderFromSpan(sut, headers); expect(headers[baggage.name], newValue); }); @@ -102,10 +122,10 @@ void main() { final sut = fixture.getSut(); final baggage = sut.toBaggageHeader(); - addBaggageHeader(sut, headers); + addBaggageHeaderFromSpan(sut, headers); expect(headers[baggage!.name], - 'other-vendor-value=foo,sentry-trace_id=${sut.context.traceId},sentry-public_key=abc,sentry-release=release,sentry-environment=environment,sentry-user_segment=segment,sentry-transaction=name,sentry-sample_rate=1'); + 'other-vendor-value=foo,sentry-trace_id=${sut.context.traceId},sentry-public_key=abc,sentry-release=release,sentry-environment=environment,sentry-user_segment=segment,sentry-transaction=name,sentry-sample_rate=1,sentry-sampled=true'); }); }); diff --git a/dio/README.md b/dio/README.md index 72c1cbeaa8..a8cf767237 100644 --- a/dio/README.md +++ b/dio/README.md @@ -49,8 +49,9 @@ Depending on your configuration, this adds performance tracing and http breadcru #### Resources -* [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dart/) -* [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks) -* [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) * [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) -* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/dio/class-diagram.svg b/dio/class-diagram.svg new file mode 100644 index 0000000000..0e368cbdf5 --- /dev/null +++ b/dio/class-diagram.svg @@ -0,0 +1,159 @@ + + + + + + + + +cluster~ + +dio + + +cluster~/lib + +lib + + +cluster~/lib/src + +src + + + +/lib/src/version.dart + +version + + + +/lib/src/dio_event_processor.dart + +dio_event_processor + + + +/lib/src/dio_stacktrace_extractor.dart + +dio_stacktrace_extractor + + + +/lib/src/sentry_dio_client_adapter.dart + +sentry_dio_client_adapter + + + +/lib/src/tracing_client_adapter.dart + +tracing_client_adapter + + + +/lib/src/sentry_dio_client_adapter.dart->/lib/src/tracing_client_adapter.dart + + + + + +/lib/src/breadcrumb_client_adapter.dart + +breadcrumb_client_adapter + + + +/lib/src/sentry_dio_client_adapter.dart->/lib/src/breadcrumb_client_adapter.dart + + + + + +/lib/src/sentry_transformer.dart + +sentry_transformer + + + +/lib/src/dio_error_extractor.dart + +dio_error_extractor + + + +/lib/src/sentry_dio_extension.dart + +sentry_dio_extension + + + +/lib/src/sentry_dio_extension.dart->/lib/src/version.dart + + + + + +/lib/src/sentry_dio_extension.dart->/lib/src/dio_event_processor.dart + + + + + +/lib/src/sentry_dio_extension.dart->/lib/src/dio_stacktrace_extractor.dart + + + + + +/lib/src/sentry_dio_extension.dart->/lib/src/sentry_dio_client_adapter.dart + + + + + +/lib/src/sentry_dio_extension.dart->/lib/src/sentry_transformer.dart + + + + + +/lib/src/sentry_dio_extension.dart->/lib/src/dio_error_extractor.dart + + + + + +/lib/src/failed_request_interceptor.dart + +failed_request_interceptor + + + +/lib/src/sentry_dio_extension.dart->/lib/src/failed_request_interceptor.dart + + + + + +/lib/sentry_dio.dart + +sentry_dio + + + +/lib/sentry_dio.dart->/lib/src/dio_event_processor.dart + + + + + +/lib/sentry_dio.dart->/lib/src/sentry_dio_extension.dart + + + + + diff --git a/dio/lib/src/sentry_transformer.dart b/dio/lib/src/sentry_transformer.dart index 5b43afbfeb..f5fb7c8ac4 100644 --- a/dio/lib/src/sentry_transformer.dart +++ b/dio/lib/src/sentry_transformer.dart @@ -27,7 +27,7 @@ class SentryTransformer implements Transformer { description: description, ); - span?.setData('http.method', options.method); + span?.setData('http.request.method', options.method); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoHttpDioTransformer; @@ -65,7 +65,7 @@ class SentryTransformer implements Transformer { description: description, ); - span?.setData('http.method', options.method); + span?.setData('http.request.method', options.method); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoHttpDioTransformer; diff --git a/dio/lib/src/tracing_client_adapter.dart b/dio/lib/src/tracing_client_adapter.dart index 506339e7d4..0c8def1442 100644 --- a/dio/lib/src/tracing_client_adapter.dart +++ b/dio/lib/src/tracing_client_adapter.dart @@ -46,24 +46,43 @@ class TracingClientAdapter implements HttpClientAdapter { span = null; } - span?.setData('http.method', options.method); + span?.setData('http.request.method', options.method); urlDetails?.applyToSpan(span); ResponseBody? response; try { - if (span != null) { - if (containsTargetOrMatchesRegExp( - // ignore: invalid_use_of_internal_member - _hub.options.tracePropagationTargets, - options.uri.toString(), - )) { - addSentryTraceHeader(span, options.headers); - addBaggageHeader( + if (containsTargetOrMatchesRegExp( + // ignore: invalid_use_of_internal_member + _hub.options.tracePropagationTargets, + options.uri.toString(), + )) { + if (span != null) { + addSentryTraceHeaderFromSpan(span, options.headers); + addBaggageHeaderFromSpan( span, options.headers, // ignore: invalid_use_of_internal_member logger: _hub.options.logger, ); + } else { + // ignore: invalid_use_of_internal_member + final scope = _hub.scope; + // ignore: invalid_use_of_internal_member + final propagationContext = scope.propagationContext; + + final traceHeader = propagationContext.toSentryTrace(); + addSentryTraceHeader(traceHeader, options.headers); + + final baggage = propagationContext.baggage; + if (baggage != null) { + final baggageHeader = SentryBaggageHeader.fromBaggage(baggage); + addBaggageHeader( + baggageHeader, + options.headers, + // ignore: invalid_use_of_internal_member + logger: _hub.options.logger, + ); + } } } diff --git a/dio/lib/src/version.dart b/dio/lib/src/version.dart index 0efaa7daaa..175e956f04 100644 --- a/dio/lib/src/version.dart +++ b/dio/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.9.0'; +const String sdkVersion = '7.16.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_dio'; diff --git a/dio/pubspec.yaml b/dio/pubspec.yaml index 1343b6127b..e1f02a0123 100644 --- a/dio/pubspec.yaml +++ b/dio/pubspec.yaml @@ -1,21 +1,21 @@ name: sentry_dio description: An integration which adds support for performance tracing for the Dio package. -version: 7.9.0 +version: 7.16.0 homepage: https://docs.sentry.io/platforms/dart/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues -documentation: https://docs.sentry.io/platforms/dart/configuration/integrations/dio/ +documentation: https://docs.sentry.io/platforms/dart/integrations/dio/ environment: sdk: '>=2.17.0 <4.0.0' dependencies: dio: ^5.0.0 - sentry: 7.9.0 + sentry: 7.16.0 dev_dependencies: meta: ^1.3.0 - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.21.1 coverage: ^1.3.0 mockito: ^5.1.0 diff --git a/dio/test/sentry_transformer_test.dart b/dio/test/sentry_transformer_test.dart index 492f6e9b23..ffa793c791 100644 --- a/dio/test/sentry_transformer_test.dart +++ b/dio/test/sentry_transformer_test.dart @@ -39,7 +39,7 @@ void main() { expect(span.status, SpanStatus.ok()); expect(span.context.operation, 'serialize.http.client'); expect(span.context.description, 'GET https://example.com'); - expect(span.data['http.method'], 'GET'); + expect(span.data['http.request.method'], 'GET'); expect(span.data['url'], 'https://example.com'); expect(span.data['http.query'], 'foo=bar'); expect(span.data['http.fragment'], 'baz'); @@ -67,7 +67,7 @@ void main() { expect(span.status, SpanStatus.internalError()); expect(span.context.operation, 'serialize.http.client'); expect(span.context.description, 'GET https://example.com'); - expect(span.data['http.method'], 'GET'); + expect(span.data['http.request.method'], 'GET'); expect(span.data['url'], 'https://example.com'); expect(span.data['http.query'], 'foo=bar'); expect(span.data['http.fragment'], 'baz'); @@ -96,7 +96,7 @@ void main() { expect(span.status, SpanStatus.ok()); expect(span.context.operation, 'serialize.http.client'); expect(span.context.description, 'GET https://example.com'); - expect(span.data['http.method'], 'GET'); + expect(span.data['http.request.method'], 'GET'); expect(span.data['url'], 'https://example.com'); expect(span.data['http.query'], 'foo=bar'); expect(span.data['http.fragment'], 'baz'); @@ -126,7 +126,7 @@ void main() { expect(span.status, SpanStatus.internalError()); expect(span.context.operation, 'serialize.http.client'); expect(span.context.description, 'GET https://example.com'); - expect(span.data['http.method'], 'GET'); + expect(span.data['http.request.method'], 'GET'); expect(span.data['url'], 'https://example.com'); expect(span.data['http.query'], 'foo=bar'); expect(span.data['http.fragment'], 'baz'); diff --git a/dio/test/tracing_client_adapter_test.dart b/dio/test/tracing_client_adapter_test.dart index e0d07d527d..f67ec4c14d 100644 --- a/dio/test/tracing_client_adapter_test.dart +++ b/dio/test/tracing_client_adapter_test.dart @@ -43,7 +43,7 @@ void main() { expect(span.status, SpanStatus.ok()); expect(span.context.operation, 'http.client'); expect(span.context.description, 'GET https://example.com'); - expect(span.data['http.method'], 'GET'); + expect(span.data['http.request.method'], 'GET'); expect(span.data['url'], 'https://example.com'); expect(span.data['http.query'], 'foo=bar'); expect(span.data['http.fragment'], 'baz'); @@ -127,25 +127,48 @@ void main() { ); }); - test('captured span do not add headers if NoOp', () async { + test('do not throw if no span bound to the scope', () async { + final sut = fixture.getSut( + client: fixture.getClient(statusCode: 200, reason: 'OK'), + ); + + await sut.get(requestOptions); + }); + + test('set headers from propagationContext when tracing is disabled', + () async { + fixture._options.enableTracing = false; final sut = fixture.getSut( client: fixture.getClient(statusCode: 200, reason: 'OK'), ); - await fixture._hub - .configureScope((scope) => scope.span = NoOpSentrySpan()); + + final propagationContext = fixture._hub.scope.propagationContext; + propagationContext.baggage = SentryBaggage({'foo': 'bar'}); final response = await sut.get(requestOptions); - expect(response.headers['baggage'], null); - expect(response.headers['sentry-trace'], null); + expect( + response.headers['sentry-trace'], + [propagationContext.toSentryTrace().value], + ); + expect(response.headers['baggage'], ['foo=bar']); }); - test('do not throw if no span bound to the scope', () async { + test('set headers from propagationContext when no transaction', () async { final sut = fixture.getSut( client: fixture.getClient(statusCode: 200, reason: 'OK'), ); - await sut.get(requestOptions); + final propagationContext = fixture._hub.scope.propagationContext; + propagationContext.baggage = SentryBaggage({'foo': 'bar'}); + + final response = await sut.get(requestOptions); + + expect( + response.headers['sentry-trace'], + [propagationContext.toSentryTrace().value], + ); + expect(response.headers['baggage'], ['foo=bar']); }); }); } diff --git a/docs/new-package-release-checklist.md b/docs/new-package-release-checklist.md new file mode 100644 index 0000000000..0a7cd19821 --- /dev/null +++ b/docs/new-package-release-checklist.md @@ -0,0 +1,57 @@ +# New Package Release Checklist + +This page serves as a checklist of what to do when releasing a new package for the first time. + +## Release Preparation + +- [ ] Make sure the project is set up + - [ ] The package only exports the public API + - [ ] The package contains an example folder + - [ ] The package contains a README.md file + - [ ] CI badges show a status + - [ ] The package contains a CHANGELOG.md file (symlink to the root changelog) + - [ ] The package contains a dartdoc_options.yaml file (symlink to the root file) + - [ ] The package contains a LICENSE (default is `MIT`) + - [ ] The package contains a pubspec.yaml file + - [ ] The package contains a analysis_options.yaml file + +- [ ] Update the [Flutter example](https://github.com/getsentry/sentry-dart/tree/main/flutter/example) to use your new package if applicable + +- [ ] Make sure your new package has a `version.dart` in the `lib/src` folder. + - This is used to set the version and package in the `Hub`. See this [example](https://github.com/getsentry/sentry-dart/blob/8609bd8dd7ea572e5d241a59643c7570e5621bda/sqflite/lib/src/sentry_database.dart#L69). + - The version will be updated to the newest version after triggering the release process. + +- [ ] Create a new workflow called `your-package-name.yml` for building and testing the package. + +- [ ] Excluding `your-package-name.yml`, add the package to the `paths-ignore` section of all package workflow files. + - For examples see `sqflite.yml`, `dio.yml` etc... + +- [ ] Add an entry to [diagram.yml](https://github.com/getsentry/sentry-dart/blob/main/.github/workflows/diagrams.yml) for your package. + +- [ ] In the root `.gitignore` file add the package coverage as ignored. + +The `analyze` workflow will fail in your PR and in the main branch because the package is not released yet and the `pubspec.yaml` is not 'valid' according to the analyzer. +This is expected - it will succeed after the release. +- [ ] Make sure the analyze workflow doesn't have other failures, only the one mentioned above. + +- [ ] **Very important**: add your package to `scripts/bump-version.sh`. + +## Doing the Release + +Do these steps in the **correct order** + +- [ ] Add your package only as a `pub-dev` target in `.craft.yml`. (**not registry**) + - The release process might fail if you add it to the registry at this point. +- [ ] Trigger the release + - [ ] Check that the release bot successfully updated the versions in `version.dart` and `pubspec.yaml` in the release branch. + +## After the first release + +- [ ] Check if package is succesfully released on `pub.dev` +- [ ] Add the package to the Sentry Release Registry + - Instructions on how to do this can be found [here](https://github.com/getsentry/sentry-release-registry#adding-new-sdks) + - [Example PR](https://github.com/getsentry/sentry-release-registry/pull/136) +- [ ] Add an entry to `.craft.yml` for the package in the `registry` section. + - Now all future releases will be added to the registry automatically. +- [ ] Update the repo's `README.md` +- [ ] Prepare and merge [Sentry documentation](https://github.com/getsentry/sentry-docs/) diff --git a/drift/.gitignore b/drift/.gitignore new file mode 100644 index 0000000000..ba521d5a39 --- /dev/null +++ b/drift/.gitignore @@ -0,0 +1,14 @@ +# Omit committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ diff --git a/drift/CHANGELOG.md b/drift/CHANGELOG.md new file mode 120000 index 0000000000..04c99a55ca --- /dev/null +++ b/drift/CHANGELOG.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/drift/LICENSE b/drift/LICENSE new file mode 100644 index 0000000000..2a6964d84d --- /dev/null +++ b/drift/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/drift/README.md b/drift/README.md new file mode 100644 index 0000000000..2a572aba02 --- /dev/null +++ b/drift/README.md @@ -0,0 +1,82 @@ +

+ + + +
+

+ +Sentry integration for `drift` package +=========== + +| package | build | pub | likes | popularity | pub points | +|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------| ------- | +| sentry_drift | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-drift) | [![pub package](https://img.shields.io/pub/v/sentry_drift.svg)](https://pub.dev/packages/sentry_drift) | [![likes](https://img.shields.io/pub/likes/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![pub points](https://img.shields.io/pub/points/sentry_drift)](https://pub.dev/packages/sentry_drift/score) + +Integration for the [`drift`](https://pub.dev/packages/drift) package. + +#### Usage + +- Sign up for a Sentry.io account and get a DSN at https://sentry.io. + +- Follow the installing instructions on [pub.dev](https://pub.dev/packages/sentry/install). + +- Initialize the Sentry SDK using the DSN issued by Sentry.io. + +- Call... + +```dart +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_drift/sentry_drift.dart'; + +import 'your_database.dart'; + +Future main() async { + // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io + const dsn = + 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; + + await Sentry.init( + (options) { + options.dsn = dsn; + options.tracesSampleRate = 1.0; + options.debug = true; + }, + appRunner: runApp, // Init your App. + ); +} + +Future runApp() async { + final tr = + Sentry.startTransaction('drift', 'op', bindToScope: true); + final executor = SentryQueryExecutor( + () => NativeDatabase.memory(), + databaseName: 'my_db_name', + ); + final db = AppDatabase(executor); + + await db.into(db.todoItems).insert( + TodoItemsCompanion.insert( + title: 'This is a test thing', + content: 'test', + ), + ); + + final items = await db.select(db.todoItems).get(); + print(items); + + await db.close(); + + await tr.finish(status: const SpanStatus.ok()); +} +``` + +#### Resources + +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) +* [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/drift/analysis_options.yaml b/drift/analysis_options.yaml new file mode 100644 index 0000000000..c5f7c0d066 --- /dev/null +++ b/drift/analysis_options.yaml @@ -0,0 +1,33 @@ +include: package:lints/recommended.yaml + +analyzer: + language: + strict-casts: true + strict-inference: true + strict-raw-types: true + errors: + # treat missing required parameters as a warning (not a hint) + missing_required_param: error + # treat missing returns as a warning (not a hint) + missing_return: error + # allow having TODOs in the code + todo: ignore + # allow self-reference to deprecated members (we do this because otherwise we have + # to annotate every member in every test, assert, etc, when we deprecate something) + deprecated_member_use_from_same_package: warning + # ignore sentry/path on pubspec as we change it on deployment + invalid_dependency: ignore + exclude: + - example/** + - test/mocks/mocks.mocks.dart + +linter: + rules: + - prefer_final_locals + - public_member_api_docs + - prefer_single_quotes + - prefer_relative_imports + - unnecessary_brace_in_string_interps + - implementation_imports + - require_trailing_commas + - unawaited_futures diff --git a/drift/dartdoc_options.yaml b/drift/dartdoc_options.yaml new file mode 120000 index 0000000000..7cbb8c0d74 --- /dev/null +++ b/drift/dartdoc_options.yaml @@ -0,0 +1 @@ +../dart/dartdoc_options.yaml \ No newline at end of file diff --git a/drift/example/database.dart b/drift/example/database.dart new file mode 100644 index 0000000000..71a467b984 --- /dev/null +++ b/drift/example/database.dart @@ -0,0 +1,21 @@ +import 'dart:io'; + +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; + +part 'database.g.dart'; + +class TodoItems extends Table { + IntColumn get id => integer().autoIncrement()(); + TextColumn get title => text().withLength(min: 6, max: 32)(); + TextColumn get content => text().named('body')(); + IntColumn get category => integer().nullable()(); +} + +@DriftDatabase(tables: [TodoItems]) +class AppDatabase extends _$AppDatabase { + AppDatabase(super.e); + + @override + int get schemaVersion => 1; +} diff --git a/drift/example/database.g.dart b/drift/example/database.g.dart new file mode 100644 index 0000000000..1f9d234456 --- /dev/null +++ b/drift/example/database.g.dart @@ -0,0 +1,269 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'database.dart'; + +// ignore_for_file: type=lint +class $TodoItemsTable extends TodoItems + with TableInfo<$TodoItemsTable, TodoItem> { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + $TodoItemsTable(this.attachedDatabase, [this._alias]); + static const VerificationMeta _idMeta = const VerificationMeta('id'); + @override + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + static const VerificationMeta _titleMeta = const VerificationMeta('title'); + @override + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + static const VerificationMeta _contentMeta = + const VerificationMeta('content'); + @override + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + static const VerificationMeta _categoryMeta = + const VerificationMeta('category'); + @override + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + @override + List get $columns => [id, title, content, category]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'todo_items'; + @override + VerificationContext validateIntegrity(Insertable instance, + {bool isInserting = false}) { + final context = VerificationContext(); + final data = instance.toColumns(true); + if (data.containsKey('id')) { + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); + } + if (data.containsKey('title')) { + context.handle( + _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta)); + } else if (isInserting) { + context.missing(_titleMeta); + } + if (data.containsKey('body')) { + context.handle(_contentMeta, + content.isAcceptableOrUnknown(data['body']!, _contentMeta)); + } else if (isInserting) { + context.missing(_contentMeta); + } + if (data.containsKey('category')) { + context.handle(_categoryMeta, + category.isAcceptableOrUnknown(data['category']!, _categoryMeta)); + } + return context; + } + + @override + Set get $primaryKey => {id}; + @override + TodoItem map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return TodoItem( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + content: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body'])!, + category: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}category']), + ); + } + + @override + $TodoItemsTable createAlias(String alias) { + return $TodoItemsTable(attachedDatabase, alias); + } +} + +class TodoItem extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final int? category; + const TodoItem( + {required this.id, + required this.title, + required this.content, + this.category}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + return map; + } + + TodoItemsCompanion toCompanion(bool nullToAbsent) { + return TodoItemsCompanion( + id: Value(id), + title: Value(title), + content: Value(content), + category: category == null && nullToAbsent + ? const Value.absent() + : Value(category), + ); + } + + factory TodoItem.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return TodoItem( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + category: serializer.fromJson(json['category']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'category': serializer.toJson(category), + }; + } + + TodoItem copyWith( + {int? id, + String? title, + String? content, + Value category = const Value.absent()}) => + TodoItem( + id: id ?? this.id, + title: title ?? this.title, + content: content ?? this.content, + category: category.present ? category.value : this.category, + ); + @override + String toString() { + return (StringBuffer('TodoItem(') + ..write('id: $id, ') + ..write('title: $title, ') + ..write('content: $content, ') + ..write('category: $category') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(id, title, content, category); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is TodoItem && + other.id == this.id && + other.title == this.title && + other.content == this.content && + other.category == this.category); +} + +class TodoItemsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value content; + final Value category; + const TodoItemsCompanion({ + this.id = const Value.absent(), + this.title = const Value.absent(), + this.content = const Value.absent(), + this.category = const Value.absent(), + }); + TodoItemsCompanion.insert({ + this.id = const Value.absent(), + required String title, + required String content, + this.category = const Value.absent(), + }) : title = Value(title), + content = Value(content); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? category, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (title != null) 'title': title, + if (content != null) 'body': content, + if (category != null) 'category': category, + }); + } + + TodoItemsCompanion copyWith( + {Value? id, + Value? title, + Value? content, + Value? category}) { + return TodoItemsCompanion( + id: id ?? this.id, + title: title ?? this.title, + content: content ?? this.content, + category: category ?? this.category, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('TodoItemsCompanion(') + ..write('id: $id, ') + ..write('title: $title, ') + ..write('content: $content, ') + ..write('category: $category') + ..write(')')) + .toString(); + } +} + +abstract class _$AppDatabase extends GeneratedDatabase { + _$AppDatabase(QueryExecutor e) : super(e); + late final $TodoItemsTable todoItems = $TodoItemsTable(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [todoItems]; +} diff --git a/drift/example/example.dart b/drift/example/example.dart new file mode 100644 index 0000000000..bfe8b6d8e6 --- /dev/null +++ b/drift/example/example.dart @@ -0,0 +1,44 @@ +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_drift/sentry_drift.dart'; + +import 'database.dart'; + +Future main() async { + // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io + const dsn = + 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; + + await Sentry.init( + (options) { + options.dsn = dsn; + options.tracesSampleRate = 1.0; + options.debug = true; + }, + appRunner: runApp, // Init your App. + ); +} + +Future runApp() async { + final tr = Sentry.startTransaction('drift', 'op', bindToScope: true); + final executor = SentryQueryExecutor( + () => NativeDatabase.memory(), + databaseName: 'your_db_name', + ); + final db = AppDatabase(executor); + + await db.into(db.todoItems).insert( + TodoItemsCompanion.insert( + title: 'This is a test thing', + content: 'test', + ), + ); + + final items = await db.select(db.todoItems).get(); + print(items); + + await db.close(); + + await tr.finish(status: const SpanStatus.ok()); +} diff --git a/drift/lib/sentry_drift.dart b/drift/lib/sentry_drift.dart new file mode 100644 index 0000000000..ba84220b42 --- /dev/null +++ b/drift/lib/sentry_drift.dart @@ -0,0 +1,3 @@ +library sentry_drift; + +export 'src/sentry_query_executor.dart'; diff --git a/drift/lib/src/sentry_query_executor.dart b/drift/lib/src/sentry_query_executor.dart new file mode 100644 index 0000000000..6f09906970 --- /dev/null +++ b/drift/lib/src/sentry_query_executor.dart @@ -0,0 +1,183 @@ +import 'dart:async'; + +import 'package:drift/drift.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'version.dart'; +import 'sentry_span_helper.dart'; +import 'sentry_transaction_executor.dart'; + +/// Signature of a function that opens a database connection when instructed to. +typedef DatabaseOpener = FutureOr Function(); + +/// The Sentry Query Executor. +/// +/// If the constructor parameter queryExecutor is null, [LazyDatabase] will be +/// used as a default. +@experimental +class SentryQueryExecutor extends QueryExecutor { + Hub _hub; + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbDriftQueryExecutor, + ); + + final QueryExecutor _executor; + + final String _dbName; + + @internal + // ignore: public_member_api_docs + static const dbNameKey = 'db.name'; + + @internal + // ignore: public_member_api_docs + static const dbOp = 'db'; + + @internal + // ignore: public_member_api_docs + static const dbSystemKey = 'db.system'; + + @internal + // ignore: public_member_api_docs + static const dbSystem = 'sqlite'; + + bool _isOpen = false; + + /// Declares a [SentryQueryExecutor] that will run [opener] when the database is + /// first requested to be opened. You must specify the same [dialect] as the + /// underlying database has + SentryQueryExecutor( + DatabaseOpener opener, { + @internal Hub? hub, + @internal QueryExecutor? queryExecutor, + required String databaseName, + }) : _hub = hub ?? HubAdapter(), + _dbName = databaseName, + _executor = queryExecutor ?? LazyDatabase(opener) { + // ignore: invalid_use_of_internal_member + final options = _hub.options; + options.sdk.addIntegration('SentryDriftTracing'); + options.sdk.addPackage(packageName, sdkVersion); + _spanHelper.setHub(_hub); + } + + /// @nodoc + @internal + void setHub(Hub hub) { + _hub = hub; + _spanHelper.setHub(hub); + } + + @override + TransactionExecutor beginTransaction() { + final transactionExecutor = _executor.beginTransaction(); + final sentryTransactionExecutor = SentryTransactionExecutor( + transactionExecutor, + _hub, + dbName: _dbName, + ); + sentryTransactionExecutor.beginTransaction(); + return sentryTransactionExecutor; + } + + @override + Future runBatched(BatchedStatements statements) { + return _spanHelper.asyncWrapInSpan( + statements.toString(), + () async { + return await _executor.runBatched(statements); + }, + dbName: _dbName, + ); + } + + @override + Future ensureOpen(QueryExecutorUser user) { + if (_isOpen) { + return Future.value(true); + } + return _spanHelper.asyncWrapInSpan( + 'Open DB: $_dbName', + () async { + final res = await _executor.ensureOpen(user); + _isOpen = true; + return res; + }, + dbName: _dbName, + ); + } + + @override + Future runCustom(String statement, [List? args]) { + return _spanHelper.asyncWrapInSpan( + statement, + () async { + return await _executor.runCustom(statement, args); + }, + dbName: _dbName, + ); + } + + @override + Future runDelete(String statement, List args) { + return _spanHelper.asyncWrapInSpan( + statement, + () async { + return await _executor.runDelete(statement, args); + }, + dbName: _dbName, + ); + } + + @override + Future runInsert(String statement, List args) { + return _spanHelper.asyncWrapInSpan( + statement, + () async { + return await _executor.runInsert(statement, args); + }, + dbName: _dbName, + ); + } + + @override + Future>> runSelect( + String statement, + List args, + ) { + return _spanHelper.asyncWrapInSpan( + statement, + () async { + return await _executor.runSelect(statement, args); + }, + dbName: _dbName, + ); + } + + @override + Future runUpdate(String statement, List args) { + return _spanHelper.asyncWrapInSpan( + statement, + () async { + return await _executor.runUpdate(statement, args); + }, + dbName: _dbName, + ); + } + + @override + Future close() { + return _spanHelper.asyncWrapInSpan( + 'Close DB: $_dbName', + () async { + return await _executor.close(); + }, + dbName: _dbName, + ); + } + + @override + SqlDialect get dialect => _executor.dialect; +} diff --git a/drift/lib/src/sentry_span_helper.dart b/drift/lib/src/sentry_span_helper.dart new file mode 100644 index 0000000000..762bd24d08 --- /dev/null +++ b/drift/lib/src/sentry_span_helper.dart @@ -0,0 +1,155 @@ +import 'package:meta/meta.dart'; + +import 'package:sentry/sentry.dart'; + +import 'sentry_query_executor.dart'; + +/// @nodoc +@internal +class SentrySpanHelper { + /// @nodoc + Hub _hub = HubAdapter(); + + /// @nodoc + final String _origin; + + /// @nodoc + SentrySpanHelper(this._origin); + + /// @nodoc + void setHub(Hub hub) { + _hub = hub; + } + + /// @nodoc + @internal + Future asyncWrapInSpan( + String description, + Future Function() execute, { + String? dbName, + bool useTransactionSpan = false, + }) async { + ISentrySpan? currentSpan = _hub.getSpan(); + if (useTransactionSpan) { + currentSpan = transactionSpan; + } + final span = currentSpan?.startChild( + SentryQueryExecutor.dbOp, + description: description, + ); + + // ignore: invalid_use_of_internal_member + span?.origin = _origin; + + span?.setData( + SentryQueryExecutor.dbSystemKey, + SentryQueryExecutor.dbSystem, + ); + + if (dbName != null) { + span?.setData(SentryQueryExecutor.dbNameKey, dbName); + } + + try { + final result = await execute(); + span?.status = SpanStatus.ok(); + + return result; + } catch (exception) { + span?.throwable = exception; + span?.status = SpanStatus.internalError(); + + rethrow; + } finally { + await span?.finish(); + } + } + + /// This span is used for the database transaction. + @internal + ISentrySpan? transactionSpan; + + /// @nodoc + @internal + T beginTransaction( + String description, + T Function() execute, { + String? dbName, + }) { + final currentSpan = _hub.getSpan(); + final span = currentSpan?.startChild( + SentryQueryExecutor.dbOp, + description: description, + ); + + // ignore: invalid_use_of_internal_member + span?.origin = _origin; + + span?.setData( + SentryQueryExecutor.dbSystemKey, + SentryQueryExecutor.dbSystem, + ); + + if (dbName != null) { + span?.setData(SentryQueryExecutor.dbNameKey, dbName); + } + + try { + final result = execute(); + span?.status = SpanStatus.unknown(); + + return result; + } catch (exception) { + span?.throwable = exception; + span?.status = SpanStatus.internalError(); + + rethrow; + } finally { + transactionSpan = span; + } + } + + /// @nodoc + @internal + Future finishTransaction( + Future Function() execute, { + String? dbName, + }) async { + try { + final result = await execute(); + transactionSpan?.status = SpanStatus.ok(); + + return result; + } catch (exception) { + transactionSpan?.throwable = exception; + transactionSpan?.status = SpanStatus.internalError(); + + rethrow; + } finally { + await transactionSpan?.finish(); + transactionSpan = null; + } + } + + /// @nodoc + @internal + Future abortTransaction( + Future Function() execute, { + String? dbName, + }) async { + try { + final result = await execute(); + transactionSpan?.status = SpanStatus.aborted(); + + return result; + } catch (exception) { + transactionSpan?.throwable = exception; + transactionSpan?.status = SpanStatus.internalError(); + + rethrow; + } finally { + await transactionSpan?.finish(); + transactionSpan = null; + } + } +} diff --git a/drift/lib/src/sentry_transaction_executor.dart b/drift/lib/src/sentry_transaction_executor.dart new file mode 100644 index 0000000000..afd7625524 --- /dev/null +++ b/drift/lib/src/sentry_transaction_executor.dart @@ -0,0 +1,155 @@ +import 'package:drift/backends.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'sentry_span_helper.dart'; + +/// @nodoc +@internal +class SentryTransactionExecutor extends TransactionExecutor { + final TransactionExecutor _executor; + + final Hub _hub; + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + + final String? _dbName; + + bool _isOpen = false; + + final _withinTransactionDescription = 'Within transaction: '; + + /// @nodoc + SentryTransactionExecutor(this._executor, Hub hub, {@internal String? dbName}) + : _hub = hub, + _dbName = dbName { + _spanHelper.setHub(_hub); + } + + @override + TransactionExecutor beginTransaction() { + return _spanHelper.beginTransaction( + 'transaction', + () { + return _executor.beginTransaction(); + }, + dbName: _dbName, + ); + } + + @override + Future rollback() { + return _spanHelper.abortTransaction(() async { + return await _executor.rollback(); + }); + } + + @override + Future send() { + return _spanHelper.finishTransaction(() async { + return await _executor.send(); + }); + } + + @override + SqlDialect get dialect => _executor.dialect; + + @override + Future ensureOpen(QueryExecutorUser user) { + if (_isOpen) { + return Future.value(true); + } + return _spanHelper.asyncWrapInSpan( + 'Open transaction', + () async { + final res = await _executor.ensureOpen(user); + _isOpen = true; + return res; + }, + dbName: _dbName, + ); + } + + @override + Future runBatched(BatchedStatements statements) { + return _spanHelper.asyncWrapInSpan( + 'batch', + () async { + return await _executor.runBatched(statements); + }, + dbName: _dbName, + ); + } + + @override + Future runCustom(String statement, [List? args]) { + return _spanHelper.asyncWrapInSpan( + _spanDescriptionForOperations(statement), + () async { + return _executor.runCustom(statement, args); + }, + dbName: _dbName, + useTransactionSpan: true, + ); + } + + @override + Future runDelete(String statement, List args) { + return _spanHelper.asyncWrapInSpan( + _spanDescriptionForOperations(statement), + () async { + return _executor.runDelete(statement, args); + }, + dbName: _dbName, + useTransactionSpan: true, + ); + } + + @override + Future runInsert(String statement, List args) { + return _spanHelper.asyncWrapInSpan( + _spanDescriptionForOperations(statement), + () async { + return _executor.runInsert(statement, args); + }, + dbName: _dbName, + useTransactionSpan: true, + ); + } + + @override + Future>> runSelect( + String statement, + List args, + ) { + return _spanHelper.asyncWrapInSpan( + _spanDescriptionForOperations(statement), + () async { + return _executor.runSelect(statement, args); + }, + dbName: _dbName, + useTransactionSpan: true, + ); + } + + @override + Future runUpdate(String statement, List args) { + return _spanHelper.asyncWrapInSpan( + _spanDescriptionForOperations(statement), + () async { + return _executor.runUpdate(statement, args); + }, + dbName: _dbName, + useTransactionSpan: true, + ); + } + + @override + bool get supportsNestedTransactions => _executor.supportsNestedTransactions; + + String _spanDescriptionForOperations(String operation) { + return '$_withinTransactionDescription$operation'; + } +} diff --git a/drift/lib/src/version.dart b/drift/lib/src/version.dart new file mode 100644 index 0000000000..2795a157be --- /dev/null +++ b/drift/lib/src/version.dart @@ -0,0 +1,5 @@ +/// The SDK version reported to Sentry.io in the submitted events. +const String sdkVersion = '7.16.0'; + +/// The package name reported to Sentry.io in the submitted events. +const String packageName = 'pub:sentry_drift'; diff --git a/drift/pubspec.yaml b/drift/pubspec.yaml new file mode 100644 index 0000000000..92323b4f63 --- /dev/null +++ b/drift/pubspec.yaml @@ -0,0 +1,28 @@ +name: sentry_drift +description: An integration which adds support for performance tracing for the drift package. +version: 7.16.0 +homepage: https://docs.sentry.io/platforms/flutter/ +repository: https://github.com/getsentry/sentry-dart +issue_tracker: https://github.com/getsentry/sentry-dart/issues + +environment: + sdk: '>=2.17.0 <4.0.0' + flutter: '>=3.3.0' + +dependencies: + sentry: 7.16.0 + meta: ^1.3.0 + drift: ^2.13.0 + +dev_dependencies: + lints: ^3.0.0 + flutter_test: + sdk: flutter + coverage: ^1.3.0 + mockito: ^5.1.0 + build_runner: ^2.4.6 + drift_dev: ^2.13.0 + yaml: ^3.1.0 # needed for version match (code and pubspec) + sqlite3_flutter_libs: ^0.5.0 + sqlite3: ^2.1.0 + archive: ^3.1.2 \ No newline at end of file diff --git a/drift/pubspec_overrides.yaml b/drift/pubspec_overrides.yaml new file mode 100644 index 0000000000..16e71d16f0 --- /dev/null +++ b/drift/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + sentry: + path: ../dart diff --git a/drift/test/mocks/mocks.dart b/drift/test/mocks/mocks.dart new file mode 100644 index 0000000000..4842f97455 --- /dev/null +++ b/drift/test/mocks/mocks.dart @@ -0,0 +1,10 @@ +import 'package:drift/drift.dart'; +import 'package:mockito/annotations.dart'; +import 'package:sentry/sentry.dart'; + +@GenerateMocks([ + Hub, + LazyDatabase, + TransactionExecutor, +]) +void main() {} diff --git a/drift/test/mocks/mocks.mocks.dart b/drift/test/mocks/mocks.mocks.dart new file mode 100644 index 0000000000..f6a88c359a --- /dev/null +++ b/drift/test/mocks/mocks.mocks.dart @@ -0,0 +1,769 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in sentry_drift/test/mocks/mocks.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; + +import 'package:drift/backends.dart' as _i3; +import 'package:drift/drift.dart' as _i6; +import 'package:mockito/mockito.dart' as _i1; +import 'package:sentry/sentry.dart' as _i2; +import 'package:sentry/src/profiling.dart' as _i4; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeSentryOptions_0 extends _i1.SmartFake implements _i2.SentryOptions { + _FakeSentryOptions_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSentryId_1 extends _i1.SmartFake implements _i2.SentryId { + _FakeSentryId_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeScope_2 extends _i1.SmartFake implements _i2.Scope { + _FakeScope_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeHub_3 extends _i1.SmartFake implements _i2.Hub { + _FakeHub_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeISentrySpan_4 extends _i1.SmartFake implements _i2.ISentrySpan { + _FakeISentrySpan_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeQueryExecutor_5 extends _i1.SmartFake implements _i3.QueryExecutor { + _FakeQueryExecutor_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTransactionExecutor_6 extends _i1.SmartFake + implements _i3.TransactionExecutor { + _FakeTransactionExecutor_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Hub]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockHub extends _i1.Mock implements _i2.Hub { + MockHub() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.SentryOptions get options => (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeSentryOptions_0( + this, + Invocation.getter(#options), + ), + ) as _i2.SentryOptions); + + @override + bool get isEnabled => (super.noSuchMethod( + Invocation.getter(#isEnabled), + returnValue: false, + ) as bool); + + @override + _i2.SentryId get lastEventId => (super.noSuchMethod( + Invocation.getter(#lastEventId), + returnValue: _FakeSentryId_1( + this, + Invocation.getter(#lastEventId), + ), + ) as _i2.SentryId); + + @override + _i2.Scope get scope => (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_2( + this, + Invocation.getter(#scope), + ), + ) as _i2.Scope); + + @override + set profilerFactory(_i4.SentryProfilerFactory? value) => super.noSuchMethod( + Invocation.setter( + #profilerFactory, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future<_i2.SentryId> captureEvent( + _i2.SentryEvent? event, { + dynamic stackTrace, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureEvent, + [event], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureEvent, + [event], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + _i5.Future<_i2.SentryId> captureException( + dynamic throwable, { + dynamic stackTrace, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureException, + [throwable], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureException, + [throwable], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + _i5.Future<_i2.SentryId> captureMessage( + String? message, { + _i2.SentryLevel? level, + String? template, + List? params, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + _i5.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => + (super.noSuchMethod( + Invocation.method( + #captureUserFeedback, + [userFeedback], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future addBreadcrumb( + _i2.Breadcrumb? crumb, { + _i2.Hint? hint, + }) => + (super.noSuchMethod( + Invocation.method( + #addBreadcrumb, + [crumb], + {#hint: hint}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + void bindClient(_i2.SentryClient? client) => super.noSuchMethod( + Invocation.method( + #bindClient, + [client], + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Hub clone() => (super.noSuchMethod( + Invocation.method( + #clone, + [], + ), + returnValue: _FakeHub_3( + this, + Invocation.method( + #clone, + [], + ), + ), + ) as _i2.Hub); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.FutureOr configureScope(_i2.ScopeCallback? callback) => + (super.noSuchMethod(Invocation.method( + #configureScope, + [callback], + )) as _i5.FutureOr); + + @override + _i2.ISentrySpan startTransaction( + String? name, + String? operation, { + String? description, + DateTime? startTimestamp, + bool? bindToScope, + bool? waitForChildren, + Duration? autoFinishAfter, + bool? trimEnd, + _i2.OnTransactionFinish? onFinish, + Map? customSamplingContext, + }) => + (super.noSuchMethod( + Invocation.method( + #startTransaction, + [ + name, + operation, + ], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + returnValue: _FakeISentrySpan_4( + this, + Invocation.method( + #startTransaction, + [ + name, + operation, + ], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + ), + ) as _i2.ISentrySpan); + + @override + _i2.ISentrySpan startTransactionWithContext( + _i2.SentryTransactionContext? transactionContext, { + Map? customSamplingContext, + DateTime? startTimestamp, + bool? bindToScope, + bool? waitForChildren, + Duration? autoFinishAfter, + bool? trimEnd, + _i2.OnTransactionFinish? onFinish, + }) => + (super.noSuchMethod( + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + returnValue: _FakeISentrySpan_4( + this, + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + ), + ) as _i2.ISentrySpan); + + @override + _i5.Future<_i2.SentryId> captureTransaction( + _i2.SentryTransaction? transaction, { + _i2.SentryTraceContextHeader? traceContext, + }) => + (super.noSuchMethod( + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext}, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext}, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + void setSpanContext( + dynamic throwable, + _i2.ISentrySpan? span, + String? transaction, + ) => + super.noSuchMethod( + Invocation.method( + #setSpanContext, + [ + throwable, + span, + transaction, + ], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [LazyDatabase]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockLazyDatabase extends _i1.Mock implements _i6.LazyDatabase { + MockLazyDatabase() { + _i1.throwOnMissingStub(this); + } + + @override + _i6.DatabaseOpener get opener => (super.noSuchMethod( + Invocation.getter(#opener), + returnValue: () => + _i5.Future<_i3.QueryExecutor>.value(_FakeQueryExecutor_5( + this, + Invocation.getter(#opener), + )), + ) as _i6.DatabaseOpener); + + @override + _i3.SqlDialect get dialect => (super.noSuchMethod( + Invocation.getter(#dialect), + returnValue: _i3.SqlDialect.sqlite, + ) as _i3.SqlDialect); + + @override + _i3.TransactionExecutor beginTransaction() => (super.noSuchMethod( + Invocation.method( + #beginTransaction, + [], + ), + returnValue: _FakeTransactionExecutor_6( + this, + Invocation.method( + #beginTransaction, + [], + ), + ), + ) as _i3.TransactionExecutor); + + @override + _i5.Future ensureOpen(_i3.QueryExecutorUser? user) => + (super.noSuchMethod( + Invocation.method( + #ensureOpen, + [user], + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + + @override + _i5.Future runBatched(_i3.BatchedStatements? statements) => + (super.noSuchMethod( + Invocation.method( + #runBatched, + [statements], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future runCustom( + String? statement, [ + List? args, + ]) => + (super.noSuchMethod( + Invocation.method( + #runCustom, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future runDelete( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runDelete, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future runInsert( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runInsert, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future>> runSelect( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runSelect, + [ + statement, + args, + ], + ), + returnValue: _i5.Future>>.value( + >[]), + ) as _i5.Future>>); + + @override + _i5.Future runUpdate( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runUpdate, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} + +/// A class which mocks [TransactionExecutor]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTransactionExecutor extends _i1.Mock + implements _i3.TransactionExecutor { + MockTransactionExecutor() { + _i1.throwOnMissingStub(this); + } + + @override + bool get supportsNestedTransactions => (super.noSuchMethod( + Invocation.getter(#supportsNestedTransactions), + returnValue: false, + ) as bool); + + @override + _i3.SqlDialect get dialect => (super.noSuchMethod( + Invocation.getter(#dialect), + returnValue: _i3.SqlDialect.sqlite, + ) as _i3.SqlDialect); + + @override + _i5.Future send() => (super.noSuchMethod( + Invocation.method( + #send, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future rollback() => (super.noSuchMethod( + Invocation.method( + #rollback, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future ensureOpen(_i3.QueryExecutorUser? user) => + (super.noSuchMethod( + Invocation.method( + #ensureOpen, + [user], + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + + @override + _i5.Future>> runSelect( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runSelect, + [ + statement, + args, + ], + ), + returnValue: _i5.Future>>.value( + >[]), + ) as _i5.Future>>); + + @override + _i5.Future runInsert( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runInsert, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future runUpdate( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runUpdate, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future runDelete( + String? statement, + List? args, + ) => + (super.noSuchMethod( + Invocation.method( + #runDelete, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future runCustom( + String? statement, [ + List? args, + ]) => + (super.noSuchMethod( + Invocation.method( + #runCustom, + [ + statement, + args, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future runBatched(_i3.BatchedStatements? statements) => + (super.noSuchMethod( + Invocation.method( + #runBatched, + [statements], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i3.TransactionExecutor beginTransaction() => (super.noSuchMethod( + Invocation.method( + #beginTransaction, + [], + ), + returnValue: _FakeTransactionExecutor_6( + this, + Invocation.method( + #beginTransaction, + [], + ), + ), + ) as _i3.TransactionExecutor); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} diff --git a/drift/test/sentry_database_test.dart b/drift/test/sentry_database_test.dart new file mode 100644 index 0000000000..1a2f594007 --- /dev/null +++ b/drift/test/sentry_database_test.dart @@ -0,0 +1,683 @@ +// ignore_for_file: invalid_use_of_internal_member + +@TestOn('vm') + +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry/src/sentry_tracer.dart'; +import 'package:sentry_drift/src/sentry_query_executor.dart'; +import 'package:sentry_drift/src/sentry_transaction_executor.dart'; +import 'package:sentry_drift/src/version.dart'; +import 'package:sqlite3/open.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'test_database.dart'; +import 'utils/windows_helper.dart'; + +void main() { + open.overrideFor(OperatingSystem.windows, openOnWindows); + + final expectedInsertStatement = + 'INSERT INTO "todo_items" ("title", "body") VALUES (?, ?)'; + final expectedUpdateStatement = + 'UPDATE "todo_items" SET "title" = ?, "body" = ? WHERE "title" = ?;'; + final expectedSelectStatement = 'SELECT * FROM todo_items'; + final expectedDeleteStatement = 'DELETE FROM "todo_items";'; + final expectedCloseStatement = 'Close DB: ${Fixture.dbName}'; + final expectedOpenStatement = 'Open DB: ${Fixture.dbName}'; + final expectedTransactionStatement = 'transaction'; + final withinTransactionDescription = 'Within transaction: '; + + void verifySpan( + String description, + SentrySpan? span, { + String origin = SentryTraceOrigins.autoDbDriftQueryExecutor, + SpanStatus? status, + }) { + status ??= SpanStatus.ok(); + expect(span?.context.operation, SentryQueryExecutor.dbOp); + expect(span?.context.description, description); + expect(span?.status, status); + expect(span?.origin, origin); + expect( + span?.data[SentryQueryExecutor.dbSystemKey], + SentryQueryExecutor.dbSystem, + ); + expect( + span?.data[SentryQueryExecutor.dbNameKey], + Fixture.dbName, + ); + } + + void verifyErrorSpan( + String description, + Exception exception, + SentrySpan? span, { + String origin = SentryTraceOrigins.autoDbDriftQueryExecutor, + }) { + expect(span?.context.operation, SentryQueryExecutor.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + expect(span?.origin, origin); + expect( + span?.data[SentryQueryExecutor.dbSystemKey], + SentryQueryExecutor.dbSystem, + ); + expect( + span?.data[SentryQueryExecutor.dbNameKey], + Fixture.dbName, + ); + + expect(span?.throwable, exception); + } + + Future insertRow(AppDatabase sut, {bool withError = false}) { + if (withError) { + return sut.into(sut.todoItems).insert( + TodoItemsCompanion.insert( + title: '', + content: '', + ), + ); + } else { + return sut.into(sut.todoItems).insert( + TodoItemsCompanion.insert( + title: 'todo: finish drift setup', + content: 'We can now write queries and define our own tables.', + ), + ); + } + } + + Future updateRow(AppDatabase sut, {bool withError = false}) { + if (withError) { + return (sut.update(sut.todoItems) + ..where((tbl) => tbl.title.equals('doesnt exist'))) + .write( + TodoItemsCompanion( + title: Value('after update'), + content: Value('We can now write queries and define our own tables.'), + ), + ); + } else { + return (sut.update(sut.todoItems) + ..where((tbl) => tbl.title.equals('todo: finish drift setup'))) + .write( + TodoItemsCompanion( + title: Value('after update'), + content: Value('We can now write queries and define our own tables.'), + ), + ); + } + } + + group('adds span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('open span is only added once', () async { + final sut = fixture.sut; + + await insertRow(sut); + await insertRow(sut); + await insertRow(sut); + + final openSpansCount = fixture.tracer.children + .where( + (element) => element.context.description == expectedOpenStatement, + ) + .length; + + expect(openSpansCount, 1); + }); + + test('insert adds span', () async { + final sut = fixture.sut; + + await insertRow(sut); + + verifySpan( + expectedInsertStatement, + fixture.getCreatedSpan(), + ); + }); + + test('update adds span', () async { + final sut = fixture.sut; + + await insertRow(sut); + await updateRow(sut); + + verifySpan( + expectedUpdateStatement, + fixture.getCreatedSpan(), + ); + }); + + test('custom adds span', () async { + final sut = fixture.sut; + + await sut.customStatement('SELECT * FROM todo_items'); + + verifySpan( + expectedSelectStatement, + fixture.getCreatedSpan(), + ); + }); + + test('delete adds span', () async { + final sut = fixture.sut; + + await insertRow(sut); + await fixture.sut.delete(fixture.sut.todoItems).go(); + + verifySpan( + expectedDeleteStatement, + fixture.getCreatedSpan(), + ); + }); + + test('transaction adds insert spans', () async { + final sut = fixture.sut; + + await sut.transaction(() async { + await insertRow(sut); + await insertRow(sut); + }); + + final insertSpanCount = fixture.tracer.children + .where( + (element) => + element.context.description == + '$withinTransactionDescription$expectedInsertStatement', + ) + .length; + expect(insertSpanCount, 2); + + verifySpan( + '$withinTransactionDescription$expectedInsertStatement', + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + + verifySpan( + expectedTransactionStatement, + fixture.getCreatedSpanByDescription(expectedTransactionStatement), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('transaction adds update spans', () async { + final sut = fixture.sut; + + await sut.transaction(() async { + await insertRow(sut); + await updateRow(sut); + }); + + final updateSpanCount = fixture.tracer.children + .where( + (element) => + element.context.description == + '$withinTransactionDescription$expectedUpdateStatement', + ) + .length; + expect(updateSpanCount, 1); + + verifySpan( + '$withinTransactionDescription$expectedUpdateStatement', + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + + verifySpan( + expectedTransactionStatement, + fixture.getCreatedSpanByDescription(expectedTransactionStatement), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('transaction adds delete spans', () async { + final sut = fixture.sut; + + await sut.transaction(() async { + await insertRow(sut); + await fixture.sut.delete(fixture.sut.todoItems).go(); + }); + + final deleteSpanCount = fixture.tracer.children + .where( + (element) => + element.context.description == + '$withinTransactionDescription$expectedDeleteStatement', + ) + .length; + expect(deleteSpanCount, 1); + + verifySpan( + '$withinTransactionDescription$expectedDeleteStatement', + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + + verifySpan( + expectedTransactionStatement, + fixture.getCreatedSpanByDescription(expectedTransactionStatement), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('transaction adds custom spans', () async { + final sut = fixture.sut; + + await sut.transaction(() async { + await insertRow(sut); + await sut.customStatement('SELECT * FROM todo_items'); + }); + + final customSpanCount = fixture.tracer.children + .where( + (element) => + element.context.description == + '$withinTransactionDescription$expectedSelectStatement', + ) + .length; + expect(customSpanCount, 1); + + verifySpan( + '$withinTransactionDescription$expectedSelectStatement', + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + + verifySpan( + expectedTransactionStatement, + fixture.getCreatedSpanByDescription(expectedTransactionStatement), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('transaction rollback adds span', () async { + final sut = fixture.sut; + + await insertRow(sut); + await insertRow(sut); + + try { + await sut.transaction(() async { + await insertRow(sut, withError: true); + }); + } catch (_) {} + + verifySpan( + expectedTransactionStatement, + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + status: SpanStatus.aborted(), + ); + }); + + test('batch adds span', () async { + final sut = fixture.sut; + + await sut.batch((batch) async { + await insertRow(sut); + await insertRow(sut); + }); + + verifySpan( + 'batch', + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('close adds span', () async { + final sut = fixture.sut; + + await sut.close(); + + verifySpan( + 'Close DB: ${Fixture.dbName}', + fixture.getCreatedSpan(), + ); + }); + + test('open adds span', () async { + final sut = fixture.sut; + + // SentryDriftDatabase is by default lazily opened by default so it won't + // create a span until it is actually used. + await sut.select(sut.todoItems).get(); + + verifySpan( + expectedOpenStatement, + fixture.getCreatedSpanByDescription(expectedOpenStatement), + ); + }); + }); + + group('does not add span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('does not add open span if db is not used', () async { + fixture.sut; + + expect(fixture.tracer.children.isEmpty, true); + }); + + test('batch does not add span for failed operations', () async { + final sut = fixture.sut; + + try { + await sut.batch((batch) async { + await insertRow(sut, withError: true); + await insertRow(sut); + }); + } catch (_) {} + + expect(fixture.tracer.children.isEmpty, true); + }); + }); + + group('adds error span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockLazyDatabase.ensureOpen(any)) + .thenAnswer((_) => Future.value(true)); + + await fixture.setUp(injectMock: true); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing runInsert throws error span', () async { + when(fixture.mockLazyDatabase.runInsert(any, any)) + .thenThrow(fixture.exception); + + try { + await insertRow(fixture.sut); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedInsertStatement, + fixture.exception, + fixture.getCreatedSpan(), + ); + }); + + test('throwing runUpdate throws error span', () async { + when(fixture.mockLazyDatabase.runUpdate(any, any)) + .thenThrow(fixture.exception); + + try { + await updateRow(fixture.sut); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedUpdateStatement, + fixture.exception, + fixture.getCreatedSpan(), + ); + }); + + test('throwing runCustom throws error span', () async { + when(fixture.mockLazyDatabase.runCustom(any, any)) + .thenThrow(fixture.exception); + + try { + await fixture.sut.customStatement('SELECT * FROM todo_items'); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedSelectStatement, + fixture.exception, + fixture.getCreatedSpan(), + ); + }); + + test('throwing transaction throws error span', () async { + final mockTransactionExecutor = MockTransactionExecutor(); + when(mockTransactionExecutor.beginTransaction()) + .thenThrow(fixture.exception); + + try { + // We need to move it inside the try/catch becaue SentryTransactionExecutor + // starts beginTransaction() directly after init + final SentryTransactionExecutor transactionExecutor = + SentryTransactionExecutor( + mockTransactionExecutor, + fixture.hub, + dbName: Fixture.dbName, + ); + + when(fixture.mockLazyDatabase.beginTransaction()) + .thenReturn(transactionExecutor); + + await fixture.sut.transaction(() async { + await insertRow(fixture.sut); + }); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedTransactionStatement, + fixture.exception, + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('throwing batch throws error span', () async { + final mockTransactionExecutor = MockTransactionExecutor(); + when(mockTransactionExecutor.beginTransaction()) + .thenThrow(fixture.exception); + + // We need to move it inside the try/catch becaue SentryTransactionExecutor + // starts beginTransaction() directly after init + final SentryTransactionExecutor transactionExecutor = + SentryTransactionExecutor( + mockTransactionExecutor, + fixture.hub, + dbName: Fixture.dbName, + ); + + when(fixture.mockLazyDatabase.beginTransaction()) + .thenReturn(transactionExecutor); + + when(fixture.mockLazyDatabase.runInsert(any, any)) + .thenAnswer((realInvocation) => Future.value(1)); + + try { + await fixture.sut.batch((batch) async { + await insertRow(fixture.sut); + }); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedTransactionStatement, + fixture.exception, + fixture.getCreatedSpan(), + origin: SentryTraceOrigins.autoDbDriftTransactionExecutor, + ); + }); + + test('throwing close throws error span', () async { + when(fixture.mockLazyDatabase.close()).thenThrow(fixture.exception); + when(fixture.mockLazyDatabase.runInsert(any, any)) + .thenAnswer((_) => Future.value(1)); + + try { + await insertRow(fixture.sut); + await fixture.sut.close(); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedCloseStatement, + fixture.exception, + fixture.getCreatedSpan(), + ); + + when(fixture.mockLazyDatabase.close()).thenAnswer((_) => Future.value()); + }); + + test('throwing ensureOpen throws error span', () async { + when(fixture.mockLazyDatabase.ensureOpen(any)) + .thenThrow(fixture.exception); + + try { + await fixture.sut.select(fixture.sut.todoItems).get(); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedOpenStatement, + fixture.exception, + fixture.getCreatedSpanByDescription(expectedOpenStatement), + ); + }); + + test('throwing runDelete throws error span', () async { + when(fixture.mockLazyDatabase.runDelete(any, any)) + .thenThrow(fixture.exception); + + try { + await fixture.sut.delete(fixture.sut.todoItems).go(); + } catch (exception) { + expect(exception, fixture.exception); + } + + verifyErrorSpan( + expectedDeleteStatement, + fixture.exception, + fixture.getCreatedSpan(), + ); + }); + }); + + group('integrations', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('adds integration', () { + expect( + fixture.options.sdk.integrations.contains('SentryDriftTracing'), + true, + ); + }); + + test('adds package', () { + expect( + fixture.options.sdk.packages.any( + (element) => + element.name == packageName && element.version == sdkVersion, + ), + true, + ); + }); + }); +} + +class Fixture { + final options = SentryOptions(); + final hub = MockHub(); + static final dbName = 'people-drift-impl'; + final exception = Exception('fixture-exception'); + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late AppDatabase sut; + final mockLazyDatabase = MockLazyDatabase(); + + Future setUp({bool injectMock = false}) async { + sut = AppDatabase(openConnection(injectMock: injectMock)); + } + + Future tearDown() async { + await sut.close(); + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + SentrySpan? getCreatedSpanByDescription(String description) { + return tracer.children + .firstWhere((element) => element.context.description == description); + } + + SentryQueryExecutor openConnection({bool injectMock = false}) { + if (injectMock) { + final executor = + SentryQueryExecutor(() => mockLazyDatabase, databaseName: dbName); + executor.setHub(hub); + return executor; + } else { + return SentryQueryExecutor( + () { + return NativeDatabase.memory(); + }, + hub: hub, + databaseName: dbName, + ); + } + } +} diff --git a/drift/test/sqlite3.dll b/drift/test/sqlite3.dll new file mode 100644 index 0000000000..1239c35203 Binary files /dev/null and b/drift/test/sqlite3.dll differ diff --git a/drift/test/test_database.dart b/drift/test/test_database.dart new file mode 100644 index 0000000000..4bf7d7a55a --- /dev/null +++ b/drift/test/test_database.dart @@ -0,0 +1,18 @@ +import 'package:drift/drift.dart'; + +part 'test_database.g.dart'; + +class TodoItems extends Table { + IntColumn get id => integer().autoIncrement()(); + TextColumn get title => text().withLength(min: 6, max: 32)(); + TextColumn get content => text().named('body')(); + IntColumn get category => integer().nullable()(); +} + +@DriftDatabase(tables: [TodoItems]) +class AppDatabase extends _$AppDatabase { + AppDatabase(super.e); + + @override + int get schemaVersion => 1; +} diff --git a/drift/test/test_database.g.dart b/drift/test/test_database.g.dart new file mode 100644 index 0000000000..65430026da --- /dev/null +++ b/drift/test/test_database.g.dart @@ -0,0 +1,269 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'test_database.dart'; + +// ignore_for_file: type=lint +class $TodoItemsTable extends TodoItems + with TableInfo<$TodoItemsTable, TodoItem> { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + $TodoItemsTable(this.attachedDatabase, [this._alias]); + static const VerificationMeta _idMeta = const VerificationMeta('id'); + @override + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + static const VerificationMeta _titleMeta = const VerificationMeta('title'); + @override + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + static const VerificationMeta _contentMeta = + const VerificationMeta('content'); + @override + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + static const VerificationMeta _categoryMeta = + const VerificationMeta('category'); + @override + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + @override + List get $columns => [id, title, content, category]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'todo_items'; + @override + VerificationContext validateIntegrity(Insertable instance, + {bool isInserting = false}) { + final context = VerificationContext(); + final data = instance.toColumns(true); + if (data.containsKey('id')) { + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); + } + if (data.containsKey('title')) { + context.handle( + _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta)); + } else if (isInserting) { + context.missing(_titleMeta); + } + if (data.containsKey('body')) { + context.handle(_contentMeta, + content.isAcceptableOrUnknown(data['body']!, _contentMeta)); + } else if (isInserting) { + context.missing(_contentMeta); + } + if (data.containsKey('category')) { + context.handle(_categoryMeta, + category.isAcceptableOrUnknown(data['category']!, _categoryMeta)); + } + return context; + } + + @override + Set get $primaryKey => {id}; + @override + TodoItem map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return TodoItem( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + content: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body'])!, + category: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}category']), + ); + } + + @override + $TodoItemsTable createAlias(String alias) { + return $TodoItemsTable(attachedDatabase, alias); + } +} + +class TodoItem extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final int? category; + const TodoItem( + {required this.id, + required this.title, + required this.content, + this.category}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + return map; + } + + TodoItemsCompanion toCompanion(bool nullToAbsent) { + return TodoItemsCompanion( + id: Value(id), + title: Value(title), + content: Value(content), + category: category == null && nullToAbsent + ? const Value.absent() + : Value(category), + ); + } + + factory TodoItem.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return TodoItem( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + category: serializer.fromJson(json['category']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'category': serializer.toJson(category), + }; + } + + TodoItem copyWith( + {int? id, + String? title, + String? content, + Value category = const Value.absent()}) => + TodoItem( + id: id ?? this.id, + title: title ?? this.title, + content: content ?? this.content, + category: category.present ? category.value : this.category, + ); + @override + String toString() { + return (StringBuffer('TodoItem(') + ..write('id: $id, ') + ..write('title: $title, ') + ..write('content: $content, ') + ..write('category: $category') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(id, title, content, category); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is TodoItem && + other.id == this.id && + other.title == this.title && + other.content == this.content && + other.category == this.category); +} + +class TodoItemsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value content; + final Value category; + const TodoItemsCompanion({ + this.id = const Value.absent(), + this.title = const Value.absent(), + this.content = const Value.absent(), + this.category = const Value.absent(), + }); + TodoItemsCompanion.insert({ + this.id = const Value.absent(), + required String title, + required String content, + this.category = const Value.absent(), + }) : title = Value(title), + content = Value(content); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? category, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (title != null) 'title': title, + if (content != null) 'body': content, + if (category != null) 'category': category, + }); + } + + TodoItemsCompanion copyWith( + {Value? id, + Value? title, + Value? content, + Value? category}) { + return TodoItemsCompanion( + id: id ?? this.id, + title: title ?? this.title, + content: content ?? this.content, + category: category ?? this.category, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('TodoItemsCompanion(') + ..write('id: $id, ') + ..write('title: $title, ') + ..write('content: $content, ') + ..write('category: $category') + ..write(')')) + .toString(); + } +} + +abstract class _$AppDatabase extends GeneratedDatabase { + _$AppDatabase(QueryExecutor e) : super(e); + late final $TodoItemsTable todoItems = $TodoItemsTable(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [todoItems]; +} diff --git a/drift/test/utils/windows_helper.dart b/drift/test/utils/windows_helper.dart new file mode 100644 index 0000000000..e77fb03bed --- /dev/null +++ b/drift/test/utils/windows_helper.dart @@ -0,0 +1,8 @@ +import 'dart:ffi'; +import 'dart:io'; + +DynamicLibrary openOnWindows() { + final scriptDir = File(Platform.script.toFilePath()).parent; + final libraryNextToScript = File('${scriptDir.path}/test/sqlite3.dll'); + return DynamicLibrary.open(libraryNextToScript.path); +} diff --git a/e2e_test/bin/e2e_test.dart b/e2e_test/bin/e2e_test.dart index 785f98ea72..d8d315c5e3 100644 --- a/e2e_test/bin/e2e_test.dart +++ b/e2e_test/bin/e2e_test.dart @@ -20,7 +20,7 @@ void main(List arguments) async { } final options = SentryOptions(dsn: _exampleDsn) // ignore: invalid_use_of_internal_member - ..devMode = true; + ..automatedTestMode = true; await Sentry.init( (options) { options.dsn = _exampleDsn; diff --git a/file/class-diagram.svg b/file/class-diagram.svg new file mode 100644 index 0000000000..e8497bd57d --- /dev/null +++ b/file/class-diagram.svg @@ -0,0 +1,111 @@ + + + + + + + + +cluster~ + +file + + +cluster~/lib + +lib + + +cluster~/lib/src + +src + + + +/lib/sentry_file.dart + +sentry_file + + + +/lib/src/sentry_file.dart + +sentry_file + + + +/lib/sentry_file.dart->/lib/src/sentry_file.dart + + + + + +/lib/src/sentry_io_overrides.dart + +sentry_io_overrides + + + +/lib/sentry_file.dart->/lib/src/sentry_io_overrides.dart + + + + + +/lib/src/sentry_io_overrides_integration.dart + +sentry_io_overrides_integration + + + +/lib/sentry_file.dart->/lib/src/sentry_io_overrides_integration.dart + + + + + +/lib/src/sentry_file_extension.dart + +sentry_file_extension + + + +/lib/sentry_file.dart->/lib/src/sentry_file_extension.dart + + + + + +/lib/src/version.dart + +version + + + +/lib/src/sentry_file.dart->/lib/src/version.dart + + + + + +/lib/src/sentry_io_overrides.dart->/lib/sentry_file.dart + + + + + +/lib/src/sentry_io_overrides_integration.dart->/lib/src/sentry_io_overrides.dart + + + + + +/lib/src/sentry_file_extension.dart->/lib/sentry_file.dart + + + + + diff --git a/file/lib/src/sentry_file.dart b/file/lib/src/sentry_file.dart index 4b7659dc0c..de0004c938 100644 --- a/file/lib/src/sentry_file.dart +++ b/file/lib/src/sentry_file.dart @@ -215,7 +215,8 @@ import 'version.dart'; typedef Callback = FutureOr Function(); /// The Sentry wrapper for the File IO implementation that creates a span -/// out of the active transaction in the scope. +/// out of the active transaction in the scope and a breadcrumb, which gets +/// added to the hub. /// The span is started before the operation is executed and finished after. /// The File tracing isn't available for Web. /// @@ -228,7 +229,7 @@ typedef Callback = FutureOr Function(); /// final sentryFile = SentryFile(file); /// // span starts /// await sentryFile.writeAsString('Hello World'); -/// // span finishes +/// // span finishes, adds breadcrumb /// ``` /// /// All the copy, create, delete, open, rename, read, and write operations are @@ -425,8 +426,13 @@ class SentryFile implements File { span?.origin = SentryTraceOrigins.autoFile; span?.setData('file.async', true); + + final Map breadcrumbData = {}; + breadcrumbData['file.async'] = true; + if (_hub.options.sendDefaultPii) { span?.setData('file.path', absolute.path); + breadcrumbData['file.path'] = absolute.path; } T data; try { @@ -453,6 +459,7 @@ class SentryFile implements File { if (length != null) { span?.setData('file.size', length); + breadcrumbData['file.size'] = length; } span?.status = SpanStatus.ok(); @@ -462,6 +469,14 @@ class SentryFile implements File { rethrow; } finally { await span?.finish(); + + await _hub.addBreadcrumb( + Breadcrumb( + message: desc, + data: breadcrumbData, + category: operation, + ), + ); } return data; } @@ -475,8 +490,12 @@ class SentryFile implements File { span?.origin = SentryTraceOrigins.autoFile; span?.setData('file.async', false); + final Map breadcrumbData = {}; + breadcrumbData['file.async'] = false; + if (_hub.options.sendDefaultPii) { span?.setData('file.path', absolute.path); + breadcrumbData['file.path'] = absolute.path; } T data; @@ -504,6 +523,7 @@ class SentryFile implements File { if (length != null) { span?.setData('file.size', length); + breadcrumbData['file.size'] = length; } span?.status = SpanStatus.ok(); @@ -513,6 +533,14 @@ class SentryFile implements File { rethrow; } finally { span?.finish(); + + _hub.addBreadcrumb( + Breadcrumb( + message: desc, + data: breadcrumbData, + category: operation, + ), + ); } return data; } diff --git a/file/lib/src/version.dart b/file/lib/src/version.dart index 5b59773228..a2a31b3a5e 100644 --- a/file/lib/src/version.dart +++ b/file/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.9.0'; +const String sdkVersion = '7.16.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_file'; diff --git a/file/pubspec.yaml b/file/pubspec.yaml index d6fcad6e27..509e596a13 100644 --- a/file/pubspec.yaml +++ b/file/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_file description: An integration which adds support for performance tracing for dart.io.File. -version: 7.9.0 +version: 7.16.0 homepage: https://docs.sentry.io/platforms/dart/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -10,11 +10,11 @@ environment: sdk: '>=2.19.0 <4.0.0' dependencies: - sentry: 7.9.0 + sentry: 7.16.0 meta: ^1.3.0 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.21.1 coverage: ^1.3.0 mockito: ^5.1.0 diff --git a/file/test/mock_sentry_client.dart b/file/test/mock_sentry_client.dart index c68fde9b47..4a4a28142d 100644 --- a/file/test/mock_sentry_client.dart +++ b/file/test/mock_sentry_client.dart @@ -14,7 +14,7 @@ class MockSentryClient with NoSuchMethodProvider implements SentryClient { SentryTraceContextHeader? traceContext, }) async { captureTransactionCalls - .add(CaptureTransactionCall(transaction, traceContext)); + .add(CaptureTransactionCall(transaction, traceContext, scope)); return transaction.eventId; } } @@ -22,6 +22,7 @@ class MockSentryClient with NoSuchMethodProvider implements SentryClient { class CaptureTransactionCall { final SentryTransaction transaction; final SentryTraceContextHeader? traceContext; + final Scope? scope; - CaptureTransactionCall(this.transaction, this.traceContext); + CaptureTransactionCall(this.transaction, this.traceContext, this.scope); } diff --git a/file/test/sentry_file_test.dart b/file/test/sentry_file_test.dart index a3fc47f670..3f7135de54 100644 --- a/file/test/sentry_file_test.dart +++ b/file/test/sentry_file_test.dart @@ -36,6 +36,20 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _asserBreadcrumb(bool async) { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.category, 'file.copy'); + expect(breadcrumb?.data?['file.size'], 7); + expect(breadcrumb?.data?['file.async'], async); + expect(breadcrumb?.message, 'testfile.txt'); + expect( + (breadcrumb?.data?['file.path'] as String) + .endsWith('test_resources/testfile.txt'), + true); + } + test('async', () async { final file = File('test_resources/testfile.txt'); @@ -56,6 +70,7 @@ void main() { expect(sut.uri.toFilePath(), isNot(newFile.uri.toFilePath())); _assertSpan(true); + _asserBreadcrumb(true); await newFile.delete(); }); @@ -80,6 +95,7 @@ void main() { expect(sut.uri.toFilePath(), isNot(newFile.uri.toFilePath())); _assertSpan(false); + _asserBreadcrumb(false); newFile.deleteSync(); }); @@ -107,6 +123,20 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _assertBreadcrumb(bool async, {int? size = 0}) { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.category, 'file.write'); + expect(breadcrumb?.data?['file.size'], size); + expect(breadcrumb?.data?['file.async'], async); + expect(breadcrumb?.message, 'testfile_create.txt'); + expect( + (breadcrumb?.data?['file.path'] as String) + .endsWith('test_resources/testfile_create.txt'), + true); + } + test('async', () async { final file = File('test_resources/testfile_create.txt'); expect(await file.exists(), false); @@ -126,6 +156,7 @@ void main() { expect(await newFile.exists(), true); _assertSpan(true); + _assertBreadcrumb(true); await newFile.delete(); }); @@ -149,6 +180,7 @@ void main() { expect(sut.existsSync(), true); _assertSpan(false); + _assertBreadcrumb(false); sut.deleteSync(); }); @@ -176,6 +208,20 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _assertBreadcrumb(bool async, {int? size = 0}) { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.category, 'file.delete'); + expect(breadcrumb?.data?['file.size'], size); + expect(breadcrumb?.data?['file.async'], async); + expect(breadcrumb?.message, 'testfile_delete.txt'); + expect( + (breadcrumb?.data?['file.path'] as String) + .endsWith('test_resources/testfile_delete.txt'), + true); + } + test('async', () async { final file = File('test_resources/testfile_delete.txt'); await file.create(); @@ -196,6 +242,7 @@ void main() { expect(await newFile.exists(), false); _assertSpan(true); + _assertBreadcrumb(true); }); test('sync', () async { @@ -218,6 +265,7 @@ void main() { expect(sut.existsSync(), false); _assertSpan(false); + _assertBreadcrumb(false); }); }); @@ -243,6 +291,20 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _assertBreadcrumb() { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.category, 'file.open'); + expect(breadcrumb?.data?['file.size'], 3535); + expect(breadcrumb?.data?['file.async'], true); + expect(breadcrumb?.message, 'sentry.png'); + expect( + (breadcrumb?.data?['file.path'] as String) + .endsWith('test_resources/sentry.png'), + true); + } + test('async', () async { final file = File('test_resources/sentry.png'); @@ -261,6 +323,7 @@ void main() { await newFile.close(); _assertSpan(); + _assertBreadcrumb(); }); }); @@ -286,6 +349,20 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _assertBreadcrumb(String fileName, bool async, {int? size = 0}) { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.category, 'file.read'); + expect(breadcrumb?.data?['file.size'], size); + expect(breadcrumb?.data?['file.async'], async); + expect(breadcrumb?.message, fileName); + expect( + (breadcrumb?.data?['file.path'] as String) + .endsWith('test_resources/$fileName'), + true); + } + test('as bytes async', () async { final file = File('test_resources/sentry.png'); @@ -302,6 +379,7 @@ void main() { await tr.finish(); _assertSpan('sentry.png', true, size: 3535); + _assertBreadcrumb('sentry.png', true, size: 3535); }); test('as bytes sync', () async { @@ -320,6 +398,7 @@ void main() { await tr.finish(); _assertSpan('sentry.png', false, size: 3535); + _assertBreadcrumb('sentry.png', false, size: 3535); }); test('lines async', () async { @@ -338,6 +417,7 @@ void main() { await tr.finish(); _assertSpan('testfile.txt', true, size: 7); + _assertBreadcrumb('testfile.txt', true, size: 7); }); test('lines sync', () async { @@ -356,6 +436,7 @@ void main() { await tr.finish(); _assertSpan('testfile.txt', false, size: 7); + _assertBreadcrumb('testfile.txt', false, size: 7); }); test('string async', () async { @@ -374,6 +455,7 @@ void main() { await tr.finish(); _assertSpan('testfile.txt', true, size: 7); + _assertBreadcrumb('testfile.txt', true, size: 7); }); test('string sync', () async { @@ -392,6 +474,7 @@ void main() { await tr.finish(); _assertSpan('testfile.txt', false, size: 7); + _assertBreadcrumb('testfile.txt', false, size: 7); }); }); @@ -416,6 +499,20 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _assertBreadcrumb(bool async, String name) { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.category, 'file.rename'); + expect(breadcrumb?.data?['file.size'], 0); + expect(breadcrumb?.data?['file.async'], async); + expect(breadcrumb?.message, name); + expect( + (breadcrumb?.data?['file.path'] as String) + .endsWith('test_resources/$name'), + true); + } + test('async', () async { final file = File('test_resources/old_name.txt'); await file.create(); @@ -438,6 +535,7 @@ void main() { expect(sut.uri.toFilePath(), isNot(newFile.uri.toFilePath())); _assertSpan(true, 'old_name.txt'); + _assertBreadcrumb(true, 'old_name.txt'); await newFile.delete(); }); @@ -464,6 +562,7 @@ void main() { expect(sut.uri.toFilePath(), isNot(newFile.uri.toFilePath())); _assertSpan(false, 'old_name.txt'); + _assertBreadcrumb(false, 'old_name.txt'); newFile.deleteSync(); }); @@ -485,6 +584,14 @@ void main() { expect(span.origin, SentryTraceOrigins.autoFile); } + void _assertBreadcrumb(bool async) { + final call = fixture.client.captureTransactionCalls.first; + final breadcrumb = call.scope?.breadcrumbs.first; + + expect(breadcrumb?.data?['file.async'], async); + expect(breadcrumb?.data?['file.path'], null); + } + test('does not add file path if sendDefaultPii is disabled async', () async { final file = File('test_resources/testfile.txt'); @@ -501,6 +608,7 @@ void main() { await tr.finish(); _assertSpan(true); + _assertBreadcrumb(true); }); test('does not add file path if sendDefaultPii is disabled sync', () async { @@ -518,6 +626,7 @@ void main() { await tr.finish(); _assertSpan(false); + _assertBreadcrumb(false); }); test('add SentryFileTracing integration', () async { diff --git a/flutter/.gitignore b/flutter/.gitignore index f0f719b22d..068bf84155 100644 --- a/flutter/.gitignore +++ b/flutter/.gitignore @@ -10,3 +10,4 @@ build/ .cxx/ .vscode/launch.json +cocoa_bindings_temp diff --git a/flutter/README.md b/flutter/README.md index ed8b2d2007..b6b7f55d8b 100644 --- a/flutter/README.md +++ b/flutter/README.md @@ -99,7 +99,7 @@ runApp( ); ``` -This adds performance tracing for all `AssetBundle` usages, where the `AssetBundle` is accessed with `DefaultAssetBunlde.of(context)`. +This adds performance tracing for all `AssetBundle` usages, where the `AssetBundle` is accessed with `DefaultAssetBundle.of(context)`. This includes all of Flutters internal access of `AssetBundle`s, like `Image.asset` for example. ##### Tracking HTTP events @@ -127,8 +127,9 @@ Or [try out the Alpha version of the Sentry Dart Plugin](https://github.com/gets #### Resources -* [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/flutter/) -* [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks) -* [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) * [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) * [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) diff --git a/flutter/analysis_options.yaml b/flutter/analysis_options.yaml index 47255eaaa4..d95702842f 100644 --- a/flutter/analysis_options.yaml +++ b/flutter/analysis_options.yaml @@ -1,6 +1,8 @@ include: package:flutter_lints/flutter.yaml analyzer: + exclude: + - test/*.mocks.dart language: strict-casts: true strict-inference: true diff --git a/flutter/android/build.gradle b/flutter/android/build.gradle index 5e40acda85..5bb8ed8a20 100644 --- a/flutter/android/build.gradle +++ b/flutter/android/build.gradle @@ -60,6 +60,9 @@ android { } dependencies { - api 'io.sentry:sentry-android:6.28.0' + api 'io.sentry:sentry-android:7.3.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + // Required -- JUnit 4 framework + testImplementation "junit:junit:4.13.2" } diff --git a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutter.kt b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutter.kt new file mode 100644 index 0000000000..c06a8b0dc2 --- /dev/null +++ b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutter.kt @@ -0,0 +1,134 @@ +package io.sentry.flutter + +import io.sentry.SentryLevel +import io.sentry.android.core.BuildConfig +import io.sentry.android.core.SentryAndroidOptions +import io.sentry.protocol.SdkVersion +import java.util.Locale + +class SentryFlutter( + private val androidSdk: String, + private val nativeSdk: String, +) { + var autoPerformanceTracingEnabled = false + + fun updateOptions( + options: SentryAndroidOptions, + data: Map, + ) { + data.getIfNotNull("dsn") { + options.dsn = it + } + data.getIfNotNull("debug") { + options.isDebug = it + } + data.getIfNotNull("environment") { + options.environment = it + } + data.getIfNotNull("release") { + options.release = it + } + data.getIfNotNull("dist") { + options.dist = it + } + data.getIfNotNull("enableAutoSessionTracking") { + options.isEnableAutoSessionTracking = it + } + data.getIfNotNull("autoSessionTrackingIntervalMillis") { + options.sessionTrackingIntervalMillis = it + } + data.getIfNotNull("anrTimeoutIntervalMillis") { + options.anrTimeoutIntervalMillis = it + } + data.getIfNotNull("attachThreads") { + options.isAttachThreads = it + } + data.getIfNotNull("attachStacktrace") { + options.isAttachStacktrace = it + } + data.getIfNotNull("enableAutoNativeBreadcrumbs") { + options.isEnableActivityLifecycleBreadcrumbs = it + options.isEnableAppLifecycleBreadcrumbs = it + options.isEnableSystemEventBreadcrumbs = it + options.isEnableAppComponentBreadcrumbs = it + options.isEnableUserInteractionBreadcrumbs = it + } + data.getIfNotNull("maxBreadcrumbs") { + options.maxBreadcrumbs = it + } + data.getIfNotNull("maxCacheItems") { + options.maxCacheItems = it + } + data.getIfNotNull("diagnosticLevel") { + if (options.isDebug) { + val sentryLevel = SentryLevel.valueOf(it.toUpperCase(Locale.ROOT)) + options.setDiagnosticLevel(sentryLevel) + } + } + data.getIfNotNull("anrEnabled") { + options.isAnrEnabled = it + } + data.getIfNotNull("sendDefaultPii") { + options.isSendDefaultPii = it + } + data.getIfNotNull("enableNdkScopeSync") { + options.isEnableScopeSync = it + } + data.getIfNotNull("proguardUuid") { + options.proguardUuid = it + } + + val nativeCrashHandling = (data["enableNativeCrashHandling"] as? Boolean) ?: true + // nativeCrashHandling has priority over anrEnabled + if (!nativeCrashHandling) { + options.isEnableUncaughtExceptionHandler = false + options.isAnrEnabled = false + // if split symbols are enabled, we need Ndk integration so we can't really offer the option + // to turn it off + // options.isEnableNdk = false + } + + data.getIfNotNull("enableAutoPerformanceTracing") { enableAutoPerformanceTracing -> + if (enableAutoPerformanceTracing) { + autoPerformanceTracingEnabled = true + } + } + + data.getIfNotNull("sendClientReports") { + options.isSendClientReports = it + } + + data.getIfNotNull("maxAttachmentSize") { + options.maxAttachmentSize = it + } + + var sdkVersion = options.sdkVersion + if (sdkVersion == null) { + sdkVersion = SdkVersion(androidSdk, BuildConfig.VERSION_NAME) + } else { + sdkVersion.name = androidSdk + } + + options.sdkVersion = sdkVersion + options.sentryClientName = "$androidSdk/${BuildConfig.VERSION_NAME}" + options.nativeSdkName = nativeSdk + + data.getIfNotNull("connectionTimeoutMillis") { + options.connectionTimeoutMillis = it + } + data.getIfNotNull("readTimeoutMillis") { + options.readTimeoutMillis = it + } + } +} + +// Call the `completion` closure if cast to map value with `key` and type `T` is successful. +@Suppress("UNCHECKED_CAST") +private fun Map.getIfNotNull( + key: String, + callback: (T) -> Unit, +) { + (get(key) as? T)?.let { + callback(it) + } +} diff --git a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt index 58423b91fa..602253bbb3 100644 --- a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt +++ b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt @@ -16,36 +16,37 @@ import io.sentry.Hint import io.sentry.HubAdapter import io.sentry.Sentry import io.sentry.SentryEvent -import io.sentry.SentryLevel import io.sentry.SentryOptions import io.sentry.android.core.ActivityFramesTracker -import io.sentry.android.core.AppStartState -import io.sentry.android.core.BuildConfig.VERSION_NAME import io.sentry.android.core.InternalSentrySdk import io.sentry.android.core.LoadClass import io.sentry.android.core.SentryAndroid import io.sentry.android.core.SentryAndroidOptions +import io.sentry.android.core.performance.AppStartMetrics import io.sentry.protocol.DebugImage import io.sentry.protocol.SdkVersion import io.sentry.protocol.SentryId import io.sentry.protocol.User -import java.io.File import java.lang.ref.WeakReference -import java.util.Locale -import java.util.UUID class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { private lateinit var channel: MethodChannel private lateinit var context: Context + private lateinit var sentryFlutter: SentryFlutter private var activity: WeakReference? = null private var framesTracker: ActivityFramesTracker? = null - private var autoPerformanceTracingEnabled = false override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { context = flutterPluginBinding.applicationContext channel = MethodChannel(flutterPluginBinding.binaryMessenger, "sentry_flutter") channel.setMethodCallHandler(this) + + sentryFlutter = + SentryFlutter( + androidSdk = androidSdk, + nativeSdk = nativeSdk, + ) } override fun onMethodCall(call: MethodCall, result: Result) { @@ -109,90 +110,26 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { } SentryAndroid.init(context) { options -> - args.getIfNotNull("dsn") { options.dsn = it } - args.getIfNotNull("debug") { options.isDebug = it } - args.getIfNotNull("environment") { options.environment = it } - args.getIfNotNull("release") { options.release = it } - args.getIfNotNull("dist") { options.dist = it } - args.getIfNotNull("enableAutoSessionTracking") { - options.isEnableAutoSessionTracking = it - } - args.getIfNotNull("autoSessionTrackingIntervalMillis") { - options.sessionTrackingIntervalMillis = it - } - args.getIfNotNull("anrTimeoutIntervalMillis") { - options.anrTimeoutIntervalMillis = it - } - args.getIfNotNull("attachThreads") { options.isAttachThreads = it } - args.getIfNotNull("attachStacktrace") { options.isAttachStacktrace = it } - args.getIfNotNull("enableAutoNativeBreadcrumbs") { - options.isEnableActivityLifecycleBreadcrumbs = it - options.isEnableAppLifecycleBreadcrumbs = it - options.isEnableSystemEventBreadcrumbs = it - options.isEnableAppComponentBreadcrumbs = it - options.isEnableUserInteractionBreadcrumbs = it - } - args.getIfNotNull("maxBreadcrumbs") { options.maxBreadcrumbs = it } - args.getIfNotNull("maxCacheItems") { options.maxCacheItems = it } - args.getIfNotNull("diagnosticLevel") { - if (options.isDebug) { - val sentryLevel = SentryLevel.valueOf(it.toUpperCase(Locale.ROOT)) - options.setDiagnosticLevel(sentryLevel) - } - } - args.getIfNotNull("anrEnabled") { options.isAnrEnabled = it } - args.getIfNotNull("sendDefaultPii") { options.isSendDefaultPii = it } - args.getIfNotNull("enableNdkScopeSync") { options.isEnableScopeSync = it } - args.getIfNotNull("proguardUuid") { options.proguardUuid = it } - - val nativeCrashHandling = (args["enableNativeCrashHandling"] as? Boolean) ?: true - // nativeCrashHandling has priority over anrEnabled - if (!nativeCrashHandling) { - options.isEnableUncaughtExceptionHandler = false - options.isAnrEnabled = false - // if split symbols are enabled, we need Ndk integration so we can't really offer the option - // to turn it off - // options.isEnableNdk = false - } + sentryFlutter.updateOptions(options, args) - args.getIfNotNull("enableAutoPerformanceTracing") { enableAutoPerformanceTracing -> - if (enableAutoPerformanceTracing) { - autoPerformanceTracingEnabled = true - framesTracker = ActivityFramesTracker(LoadClass(), options) - } + if (sentryFlutter.autoPerformanceTracingEnabled) { + framesTracker = ActivityFramesTracker(LoadClass(), options) } - args.getIfNotNull("sendClientReports") { options.isSendClientReports = it } - - args.getIfNotNull("maxAttachmentSize") { options.maxAttachmentSize = it } - - var sdkVersion = options.sdkVersion - if (sdkVersion == null) { - sdkVersion = SdkVersion(androidSdk, VERSION_NAME) - } else { - sdkVersion.name = androidSdk - } - - options.sdkVersion = sdkVersion - options.sentryClientName = "$androidSdk/$VERSION_NAME" - options.nativeSdkName = nativeSdk options.beforeSend = BeforeSendCallbackImpl(options.sdkVersion) - - args.getIfNotNull("connectionTimeoutMillis") { options.connectionTimeoutMillis = it } - args.getIfNotNull("readTimeoutMillis") { options.readTimeoutMillis = it } - - // missing proxy } result.success("") } private fun fetchNativeAppStart(result: Result) { - if (!autoPerformanceTracingEnabled) { + if (!sentryFlutter.autoPerformanceTracingEnabled) { result.success(null) return } - val appStartTime = AppStartState.getInstance().appStartTime - val isColdStart = AppStartState.getInstance().isColdStart + + val appStartTime = AppStartMetrics.getInstance().appStartTimeSpan.startTimestamp + val isColdStart = + AppStartMetrics.getInstance().appStartType == AppStartMetrics.AppStartType.COLD if (appStartTime == null) { Log.w("Sentry", "App start won't be sent due to missing appStartTime") @@ -204,14 +141,14 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { val appStartTimeMillis = DateUtils.nanosToMillis(appStartTime.nanoTimestamp().toDouble()) val item = mapOf( "appStartTime" to appStartTimeMillis, - "isColdStart" to isColdStart + "isColdStart" to isColdStart, ) result.success(item) } } private fun beginNativeFrames(result: Result) { - if (!autoPerformanceTracingEnabled) { + if (!sentryFlutter.autoPerformanceTracingEnabled) { result.success(null) return } @@ -224,7 +161,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { private fun endNativeFrames(id: String?, result: Result) { val activity = activity?.get() - if (!autoPerformanceTracingEnabled || activity == null || id == null) { + if (!sentryFlutter.autoPerformanceTracingEnabled || activity == null || id == null) { if (id == null) { Log.w("Sentry", "Parameter id cannot be null when calling endNativeFrames.") } @@ -245,7 +182,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { val frames = mapOf( "totalFrames" to total, "slowFrames" to slow, - "frozenFrames" to frozen + "frozenFrames" to frozen, ) result.success(frames) } @@ -396,7 +333,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { } private class BeforeSendCallbackImpl( - private val sdkVersion: SdkVersion? + private val sdkVersion: SdkVersion?, ) : SentryOptions.BeforeSendCallback { override fun execute(event: SentryEvent, hint: Hint): SentryEvent { setEventOriginTag(event) @@ -424,7 +361,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { private fun setEventEnvironmentTag( event: SentryEvent, origin: String = "android", - environment: String + environment: String, ) { event.setTag("event.origin", origin) event.setTag("event.environment", environment) @@ -451,18 +388,12 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { return } val currentScope = InternalSentrySdk.getCurrentScope() - val serializedScope = InternalSentrySdk.serializeScope( - context, - options, - currentScope - ) + val serializedScope = + InternalSentrySdk.serializeScope( + context, + options, + currentScope, + ) result.success(serializedScope) } } - -// Call the `completion` closure if cast to map value with `key` and type `T` is successful. -private fun Map.getIfNotNull(key: String, callback: (T) -> Unit) { - (get(key) as? T)?.let { - callback(it) - } -} diff --git a/flutter/android/src/test/kotlin/io/sentry/flutter/SentryFlutterTest.kt b/flutter/android/src/test/kotlin/io/sentry/flutter/SentryFlutterTest.kt new file mode 100644 index 0000000000..724559bb76 --- /dev/null +++ b/flutter/android/src/test/kotlin/io/sentry/flutter/SentryFlutterTest.kt @@ -0,0 +1,138 @@ +package io.sentry.flutter + +import io.sentry.SentryLevel +import io.sentry.android.core.BuildConfig +import io.sentry.android.core.SentryAndroidOptions +import org.junit.Assert.assertEquals +import org.junit.Before +import org.junit.Test + +class SentryFlutterTest { + private lateinit var fixture: Fixture + + @Before + fun before() { + fixture = Fixture() + } + + @Test + fun updateOptions() { + // Given + val sut = fixture.getSut() + + // When + sut.updateOptions(fixture.options, fixture.data) + + // Then + assertEquals("fixture-dsn", fixture.options.dsn) + assertEquals(true, fixture.options.isDebug) + assertEquals("fixture-environment", fixture.options.environment) + assertEquals("fixture-release", fixture.options.release) + assertEquals("fixture-dist", fixture.options.dist) + assertEquals(false, fixture.options.isEnableAutoSessionTracking) + assertEquals(9001L, fixture.options.sessionTrackingIntervalMillis) + assertEquals(9002L, fixture.options.anrTimeoutIntervalMillis) + assertEquals(true, fixture.options.isAttachThreads) + assertEquals(false, fixture.options.isAttachStacktrace) + assertEquals(false, fixture.options.isEnableActivityLifecycleBreadcrumbs) + assertEquals(false, fixture.options.isEnableAppLifecycleBreadcrumbs) + assertEquals(false, fixture.options.isEnableSystemEventBreadcrumbs) + assertEquals(false, fixture.options.isEnableAppComponentBreadcrumbs) + assertEquals(false, fixture.options.isEnableUserInteractionBreadcrumbs) + assertEquals(9003, fixture.options.maxBreadcrumbs) + assertEquals(9004, fixture.options.maxCacheItems) + assertEquals(false, fixture.options.isAnrEnabled) + assertEquals(true, fixture.options.isSendDefaultPii) + assertEquals(false, fixture.options.isEnableScopeSync) + assertEquals("fixture-proguardUuid", fixture.options.proguardUuid) + assertEquals(false, fixture.options.isSendClientReports) + assertEquals(9005L, fixture.options.maxAttachmentSize) + + assertEquals("sentry.java.android.flutter", fixture.options.sdkVersion?.name) + assertEquals(BuildConfig.VERSION_NAME, fixture.options.sdkVersion?.version) + assertEquals( + "sentry.java.android.flutter/${BuildConfig.VERSION_NAME}", + fixture.options.sentryClientName, + ) + assertEquals("fixture-nativeSdk", fixture.options.nativeSdkName) + + assertEquals(true, sut.autoPerformanceTracingEnabled) + + assertEquals(9006, fixture.options.connectionTimeoutMillis) + assertEquals(9007, fixture.options.readTimeoutMillis) + } + + @Test + fun initNativeSdkDiagnosticLevel() { + // Given + val sut = fixture.getSut() + fixture.options.isDebug = true + + // When + sut.updateOptions( + fixture.options, + mapOf( + "diagnosticLevel" to "warning", + ), + ) + + // Then + assertEquals(SentryLevel.WARNING, fixture.options.diagnosticLevel) + } + + @Test + fun initNativeSdkEnableNativeCrashHandling() { + // Given + val sut = fixture.getSut() + + // When + sut.updateOptions( + fixture.options, + mapOf( + "enableNativeCrashHandling" to false, + ), + ) + + // Then + assertEquals(false, fixture.options.isEnableUncaughtExceptionHandler) + assertEquals(false, fixture.options.isAnrEnabled) + } +} + +class Fixture { + var options = SentryAndroidOptions() + + val data = + mapOf( + "dsn" to "fixture-dsn", + "debug" to true, + "environment" to "fixture-environment", + "release" to "fixture-release", + "dist" to "fixture-dist", + "enableAutoSessionTracking" to false, + "autoSessionTrackingIntervalMillis" to 9001L, + "anrTimeoutIntervalMillis" to 9002L, + "attachThreads" to true, + "attachStacktrace" to false, + "enableAutoNativeBreadcrumbs" to false, + "maxBreadcrumbs" to 9003, + "maxCacheItems" to 9004, + "anrEnabled" to false, + "sendDefaultPii" to true, + "enableNdkScopeSync" to false, + "proguardUuid" to "fixture-proguardUuid", + "enableNativeCrashHandling" to false, + "sendClientReports" to false, + "maxAttachmentSize" to 9005L, + "enableAutoPerformanceTracing" to true, + "connectionTimeoutMillis" to 9006, + "readTimeoutMillis" to 9007, + ) + + fun getSut(): SentryFlutter { + return SentryFlutter( + androidSdk = "sentry.java.android.flutter", + nativeSdk = "fixture-nativeSdk", + ) + } +} diff --git a/flutter/class-diagram.svg b/flutter/class-diagram.svg new file mode 100644 index 0000000000..511429f7f8 --- /dev/null +++ b/flutter/class-diagram.svg @@ -0,0 +1,869 @@ + + + + + + + + +cluster~ + +flutter + + +cluster~/lib + +lib + + +cluster~/lib/src + +src + + +cluster~/lib/src/renderer + +renderer + + +cluster~/lib/src/screenshot + +screenshot + + +cluster~/lib/src/user_interaction + +user_interaction + + +cluster~/lib/src/event_processor + +event_processor + + +cluster~/lib/src/navigation + +navigation + + +cluster~/lib/src/view_hierarchy + +view_hierarchy + + +cluster~/lib/src/jvm + +jvm + + +cluster~/lib/src/native + +native + + +cluster~/lib/src/native/cocoa + +cocoa + + +cluster~/lib/src/integrations + +integrations + + + +/lib/sentry_flutter.dart + +sentry_flutter + + + +/lib/src/sentry_flutter.dart + +sentry_flutter + + + +/lib/sentry_flutter.dart->/lib/src/sentry_flutter.dart + + + + + +/lib/src/screenshot/sentry_screenshot_widget.dart + +sentry_screenshot_widget + + + +/lib/sentry_flutter.dart->/lib/src/screenshot/sentry_screenshot_widget.dart + + + + + +/lib/src/screenshot/sentry_screenshot_quality.dart + +sentry_screenshot_quality + + + +/lib/sentry_flutter.dart->/lib/src/screenshot/sentry_screenshot_quality.dart + + + + + +/lib/src/flutter_sentry_attachment.dart + +flutter_sentry_attachment + + + +/lib/sentry_flutter.dart->/lib/src/flutter_sentry_attachment.dart + + + + + +/lib/src/binding_wrapper.dart + +binding_wrapper + + + +/lib/sentry_flutter.dart->/lib/src/binding_wrapper.dart + + + + + +/lib/src/user_interaction/sentry_user_interaction_widget.dart + +sentry_user_interaction_widget + + + +/lib/sentry_flutter.dart->/lib/src/user_interaction/sentry_user_interaction_widget.dart + + + + + +/lib/src/sentry_asset_bundle.dart + +sentry_asset_bundle + + + +/lib/sentry_flutter.dart->/lib/src/sentry_asset_bundle.dart + + + + + +/lib/src/navigation/sentry_navigator_observer.dart + +sentry_navigator_observer + + + +/lib/sentry_flutter.dart->/lib/src/navigation/sentry_navigator_observer.dart + + + + + +/lib/src/sentry_flutter_options.dart + +sentry_flutter_options + + + +/lib/sentry_flutter.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/on_error_integration.dart + +on_error_integration + + + +/lib/sentry_flutter.dart->/lib/src/integrations/on_error_integration.dart + + + + + +/lib/src/integrations/load_release_integration.dart + +load_release_integration + + + +/lib/sentry_flutter.dart->/lib/src/integrations/load_release_integration.dart + + + + + +/lib/src/renderer/renderer.dart + +renderer + + + +/lib/src/renderer/unknown_renderer.dart + +unknown_renderer + + + +/lib/src/renderer/unknown_renderer.dart->/lib/src/renderer/renderer.dart + + + + + +/lib/src/renderer/io_renderer.dart + +io_renderer + + + +/lib/src/renderer/io_renderer.dart->/lib/src/renderer/renderer.dart + + + + + +/lib/src/renderer/html_renderer.dart + +html_renderer + + + +/lib/src/renderer/html_renderer.dart->/lib/src/renderer/renderer.dart + + + + + +/lib/src/version.dart + +version + + + +/lib/src/sentry_flutter.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/sentry_flutter.dart->/lib/src/renderer/renderer.dart + + + + + +/lib/src/sentry_flutter.dart->/lib/src/version.dart + + + + + +/lib/src/file_system_transport.dart + +file_system_transport + + + +/lib/src/sentry_flutter.dart->/lib/src/file_system_transport.dart + + + + + +/lib/src/event_processor/flutter_exception_event_processor.dart + +flutter_exception_event_processor + + + +/lib/src/sentry_flutter.dart->/lib/src/event_processor/flutter_exception_event_processor.dart + + + + + +/lib/src/event_processor/flutter_enricher_event_processor.dart + +flutter_enricher_event_processor + + + +/lib/src/sentry_flutter.dart->/lib/src/event_processor/flutter_enricher_event_processor.dart + + + + + +/lib/src/event_processor/platform_exception_event_processor.dart + +platform_exception_event_processor + + + +/lib/src/sentry_flutter.dart->/lib/src/event_processor/platform_exception_event_processor.dart + + + + + +/lib/src/event_processor/android_platform_exception_event_processor.dart + +android_platform_exception_event_processor + + + +/lib/src/sentry_flutter.dart->/lib/src/event_processor/android_platform_exception_event_processor.dart + + + + + +/lib/src/view_hierarchy/view_hierarchy_integration.dart + +view_hierarchy_integration + + + +/lib/src/sentry_flutter.dart->/lib/src/view_hierarchy/view_hierarchy_integration.dart + + + + + +/lib/src/native/native_scope_observer.dart + +native_scope_observer + + + +/lib/src/sentry_flutter.dart->/lib/src/native/native_scope_observer.dart + + + + + +/lib/src/native/sentry_native_channel.dart + +sentry_native_channel + + + +/lib/src/sentry_flutter.dart->/lib/src/native/sentry_native_channel.dart + + + + + +/lib/src/native/sentry_native.dart + +sentry_native + + + +/lib/src/sentry_flutter.dart->/lib/src/native/sentry_native.dart + + + + + +/lib/src/integrations/screenshot_integration.dart + +screenshot_integration + + + +/lib/src/sentry_flutter.dart->/lib/src/integrations/screenshot_integration.dart + + + + + +/lib/src/integrations/integrations.dart + +integrations + + + +/lib/src/sentry_flutter.dart->/lib/src/integrations/integrations.dart + + + + + +/lib/src/binding_wrapper.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/user_interaction/sentry_user_interaction_widget.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/user_interaction/user_interaction_widget.dart + +user_interaction_widget + + + +/lib/src/user_interaction/sentry_user_interaction_widget.dart->/lib/src/user_interaction/user_interaction_widget.dart + + + + + +/lib/src/widget_utils.dart + +widget_utils + + + +/lib/src/user_interaction/sentry_user_interaction_widget.dart->/lib/src/widget_utils.dart + + + + + +/lib/src/event_processor/screenshot_event_processor.dart + +screenshot_event_processor + + + +/lib/src/event_processor/screenshot_event_processor.dart->/lib/src/renderer/renderer.dart + + + + + +/lib/src/event_processor/screenshot_event_processor.dart->/lib/src/screenshot/sentry_screenshot_widget.dart + + + + + +/lib/src/event_processor/screenshot_event_processor.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/event_processor/flutter_enricher_event_processor.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/event_processor/android_platform_exception_event_processor.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/jvm/jvm_exception.dart + +jvm_exception + + + +/lib/src/event_processor/android_platform_exception_event_processor.dart->/lib/src/jvm/jvm_exception.dart + + + + + +/lib/src/jvm/jvm_frame.dart + +jvm_frame + + + +/lib/src/event_processor/android_platform_exception_event_processor.dart->/lib/src/jvm/jvm_frame.dart + + + + + +/lib/src/event_processor/native_app_start_event_processor.dart + +native_app_start_event_processor + + + +/lib/src/event_processor/native_app_start_event_processor.dart->/lib/src/native/sentry_native.dart + + + + + +/lib/src/navigation/sentry_navigator_observer.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/navigation/sentry_navigator_observer.dart->/lib/src/native/sentry_native.dart + + + + + +/lib/src/sentry_flutter_options.dart->/lib/src/renderer/renderer.dart + + + + + +/lib/src/sentry_flutter_options.dart->/lib/src/screenshot/sentry_screenshot_quality.dart + + + + + +/lib/src/sentry_flutter_options.dart->/lib/src/binding_wrapper.dart + + + + + +/lib/src/widgets_binding_observer.dart + +widgets_binding_observer + + + +/lib/src/widgets_binding_observer.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/view_hierarchy/view_hierarchy_integration.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/view_hierarchy/view_hierarchy_event_processor.dart + +view_hierarchy_event_processor + + + +/lib/src/view_hierarchy/view_hierarchy_integration.dart->/lib/src/view_hierarchy/view_hierarchy_event_processor.dart + + + + + +/lib/src/view_hierarchy/sentry_tree_walker.dart + +sentry_tree_walker + + + +/lib/src/view_hierarchy/sentry_tree_walker.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/view_hierarchy/sentry_tree_walker.dart->/lib/src/widget_utils.dart + + + + + +/lib/src/view_hierarchy/view_hierarchy_event_processor.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/view_hierarchy/view_hierarchy_event_processor.dart->/lib/src/view_hierarchy/sentry_tree_walker.dart + + + + + +/lib/src/jvm/jvm_exception.dart->/lib/src/jvm/jvm_frame.dart + + + + + +/lib/src/native/method_channel_helper.dart + +method_channel_helper + + + +/lib/src/native/native_scope_observer.dart->/lib/src/native/sentry_native.dart + + + + + +/lib/src/native/sentry_native_channel.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/native/sentry_native_channel.dart->/lib/src/native/method_channel_helper.dart + + + + + +/lib/src/native/sentry_native_channel.dart->/lib/src/native/sentry_native.dart + + + + + +/lib/src/native/sentry_native.dart->/lib/sentry_flutter.dart + + + + + +/lib/src/native/sentry_native.dart->/lib/src/native/sentry_native_channel.dart + + + + + +/lib/src/native/cocoa/binding.dart + +binding + + + +/lib/src/integrations/load_image_list_integration.dart + +load_image_list_integration + + + +/lib/src/integrations/load_image_list_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/load_contexts_integration.dart + +load_contexts_integration + + + +/lib/src/integrations/load_contexts_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/on_error_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/widgets_binding_integration.dart + +widgets_binding_integration + + + +/lib/src/integrations/widgets_binding_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/widgets_binding_integration.dart->/lib/src/widgets_binding_observer.dart + + + + + +/lib/src/integrations/native_app_start_integration.dart + +native_app_start_integration + + + +/lib/src/integrations/native_app_start_integration.dart->/lib/src/event_processor/native_app_start_event_processor.dart + + + + + +/lib/src/integrations/native_app_start_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/native_app_start_integration.dart->/lib/src/native/sentry_native.dart + + + + + +/lib/src/integrations/load_release_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/flutter_error_integration.dart + +flutter_error_integration + + + +/lib/src/integrations/flutter_error_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/debug_print_integration.dart + +debug_print_integration + + + +/lib/src/integrations/debug_print_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/screenshot_integration.dart->/lib/src/event_processor/screenshot_event_processor.dart + + + + + +/lib/src/integrations/screenshot_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/load_image_list_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/load_contexts_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/on_error_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/widgets_binding_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/native_app_start_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/load_release_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/flutter_error_integration.dart + + + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/debug_print_integration.dart + + + + + +/lib/src/integrations/widgets_flutter_binding_integration.dart + +widgets_flutter_binding_integration + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/widgets_flutter_binding_integration.dart + + + + + +/lib/src/integrations/native_sdk_integration.dart + +native_sdk_integration + + + +/lib/src/integrations/integrations.dart->/lib/src/integrations/native_sdk_integration.dart + + + + + +/lib/src/integrations/widgets_flutter_binding_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/src/integrations/native_sdk_integration.dart->/lib/src/sentry_flutter_options.dart + + + + + +/lib/sentry_flutter_web.dart + +sentry_flutter_web + + + diff --git a/flutter/config/detekt-bl.xml b/flutter/config/detekt-bl.xml index c8da2b8940..bfd59bc97e 100644 --- a/flutter/config/detekt-bl.xml +++ b/flutter/config/detekt-bl.xml @@ -2,9 +2,8 @@ - ComplexMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$override fun onMethodCall(call: MethodCall, result: Result) - ComplexMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$private fun setUser(user: Map<String, Any?>?, result: Result) - LongMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$private fun initNativeSdk(call: MethodCall, result: Result) + CyclomaticComplexMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$override fun onMethodCall(call: MethodCall, result: Result) + LongMethod:SentryFlutter.kt$SentryFlutter$fun updateOptions( options: SentryAndroidOptions, data: Map<String, Any>, ) MagicNumber:MainActivity.kt$MainActivity$6_000 TooGenericExceptionCaught:MainActivity.kt$MainActivity$e: Exception TooGenericExceptionThrown:MainActivity.kt$MainActivity$throw Exception("Catch this java exception thrown from Kotlin thread!") diff --git a/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt b/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt index 14f222d254..7966a33655 100644 --- a/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt +++ b/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt @@ -11,37 +11,33 @@ class MainActivity : FlutterActivity() { override fun configureFlutterEngine(flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine) - MethodChannel(flutterEngine.dartExecutor.binaryMessenger, _channel).setMethodCallHandler { - call, result -> + MethodChannel( + flutterEngine.dartExecutor.binaryMessenger, + _channel, + ).setMethodCallHandler { call, result -> // Note: this method is invoked on the main thread. when (call.method) { - "throw" -> { + "throw" -> thread(isDaemon = true) { throw Exception("Catch this java exception thrown from Kotlin thread!") } - } - "anr" -> { - Thread.sleep(6_000) - } - "capture" -> { + + "anr" -> Thread.sleep(6_000) + + "capture" -> try { throw RuntimeException("Catch this java exception!") } catch (e: Exception) { Sentry.captureException(e) } - } - "crash" -> { - crash() - } - "cpp_capture_message" -> { - message() - } - "platform_exception" -> { - throw RuntimeException("Catch this platform exception!") - } - else -> { - result.notImplemented() - } + + "crash" -> crash() + + "cpp_capture_message" -> message() + + "platform_exception" -> throw RuntimeException("Catch this platform exception!") + + else -> result.notImplemented() } result.success("") } diff --git a/flutter/example/android/build.gradle b/flutter/example/android/build.gradle index 71b614b7a1..e628374358 100644 --- a/flutter/example/android/build.gradle +++ b/flutter/example/android/build.gradle @@ -1,5 +1,6 @@ buildscript { ext.kotlin_version = '1.6.21' + repositories { google() mavenCentral() @@ -31,3 +32,4 @@ subprojects { tasks.register("clean", Delete) { delete rootProject.buildDir } + diff --git a/flutter/example/integration_test/all.dart b/flutter/example/integration_test/all.dart new file mode 100644 index 0000000000..69cc5a6641 --- /dev/null +++ b/flutter/example/integration_test/all.dart @@ -0,0 +1,8 @@ +// Workaround for https://github.com/flutter/flutter/issues/101031 +import 'integration_test.dart' as a; +import 'profiling_test.dart' as b; + +void main() { + a.main(); + b.main(); +} diff --git a/flutter/example/integration_test/integration_test.dart b/flutter/example/integration_test/integration_test.dart index 9dc182111a..732228e5fb 100644 --- a/flutter/example/integration_test/integration_test.dart +++ b/flutter/example/integration_test/integration_test.dart @@ -10,9 +10,9 @@ import 'package:sentry_flutter_example/main.dart'; import 'package:http/http.dart'; void main() { - const org = 'sentry-sdks'; - const slug = 'sentry-flutter'; - const authToken = String.fromEnvironment('SENTRY_AUTH_TOKEN'); + // const org = 'sentry-sdks'; + // const slug = 'sentry-flutter'; + // const authToken = String.fromEnvironment('SENTRY_AUTH_TOKEN'); const fakeDsn = 'https://abc@def.ingest.sentry.io/1234567'; TestWidgetsFlutterBinding.ensureInitialized(); @@ -141,59 +141,59 @@ void main() { await transaction.finish(); }); - group('e2e', () { - var output = find.byKey(const Key('output')); - late Fixture fixture; - - setUp(() { - fixture = Fixture(); - }); - - testWidgets('captureException', (tester) async { - await setupSentryAndApp(tester, - dsn: exampleDsn, beforeSendCallback: fixture.beforeSend); - - await tester.tap(find.text('captureException')); - await tester.pumpAndSettle(); - - final text = output.evaluate().single.widget as Text; - final id = text.data!; - - final uri = Uri.parse( - 'https://sentry.io/api/0/projects/$org/$slug/events/$id/', - ); - expect(authToken, isNotEmpty); - - final event = await fixture.poll(uri, authToken); - expect(event, isNotNull); - - final sentEvent = fixture.sentEvent; - expect(sentEvent, isNotNull); - - final tags = event!["tags"] as List; - - expect(sentEvent!.eventId.toString(), event["id"]); - expect("_Exception: Exception: captureException", event["title"]); - expect(sentEvent.release, event["release"]["version"]); - expect( - 2, - (tags.firstWhere((e) => e["value"] == sentEvent.environment) as Map) - .length); - expect(sentEvent.fingerprint, event["fingerprint"] ?? []); - expect( - 2, - (tags.firstWhere((e) => e["value"] == SentryLevel.error.name) as Map) - .length); - expect(sentEvent.logger, event["logger"]); - - final dist = tags.firstWhere((element) => element['key'] == 'dist'); - expect('1', dist['value']); - - final environment = - tags.firstWhere((element) => element['key'] == 'environment'); - expect('integration', environment['value']); - }); - }); + // group('e2e', () { + // var output = find.byKey(const Key('output')); + // late Fixture fixture; + // + // setUp(() { + // fixture = Fixture(); + // }); + // + // testWidgets('captureException', (tester) async { + // await setupSentryAndApp(tester, + // dsn: exampleDsn, beforeSendCallback: fixture.beforeSend); + // + // await tester.tap(find.text('captureException')); + // await tester.pumpAndSettle(); + // + // final text = output.evaluate().single.widget as Text; + // final id = text.data!; + // + // final uri = Uri.parse( + // 'https://sentry.io/api/0/projects/$org/$slug/events/$id/', + // ); + // expect(authToken, isNotEmpty); + // + // final event = await fixture.poll(uri, authToken); + // expect(event, isNotNull); + // + // final sentEvent = fixture.sentEvent; + // expect(sentEvent, isNotNull); + // + // final tags = event!["tags"] as List; + // + // expect(sentEvent!.eventId.toString(), event["id"]); + // expect("_Exception: Exception: captureException", event["title"]); + // expect(sentEvent.release, event["release"]["version"]); + // expect( + // 2, + // (tags.firstWhere((e) => e["value"] == sentEvent.environment) as Map) + // .length); + // expect(sentEvent.fingerprint, event["fingerprint"] ?? []); + // expect( + // 2, + // (tags.firstWhere((e) => e["value"] == SentryLevel.error.name) as Map) + // .length); + // expect(sentEvent.logger, event["logger"]); + // + // final dist = tags.firstWhere((element) => element['key'] == 'dist'); + // expect('1', dist['value']); + // + // final environment = + // tags.firstWhere((element) => element['key'] == 'environment'); + // expect('integration', environment['value']); + // }); + // }); } class Fixture { diff --git a/flutter/example/integration_test/profiling_test.dart b/flutter/example/integration_test/profiling_test.dart new file mode 100644 index 0000000000..e6c1db8bbd --- /dev/null +++ b/flutter/example/integration_test/profiling_test.dart @@ -0,0 +1,66 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; +import '../../../dart/test/mocks/mock_transport.dart'; + +void main() { + final transport = MockTransport(); + + setUp(() async { + await SentryFlutter.init((options) { + // ignore: invalid_use_of_internal_member + options.automatedTestMode = true; + options.dsn = 'https://abc@def.ingest.sentry.io/1234567'; + options.debug = true; + options.transport = transport; + options.tracesSampleRate = 1.0; + options.profilesSampleRate = 1.0; + }); + }); + + tearDown(() async { + await Sentry.close(); + transport.reset(); + }); + + test('native binding is initialized', () async { + // ignore: invalid_use_of_internal_member + expect(SentryFlutter.native, isNotNull); + }); + + test('profile is captured', () async { + final tx = Sentry.startTransaction("name", "op"); + await Future.delayed(const Duration(milliseconds: 1000)); + await tx.finish(); + expect(transport.calls, 1); + + final envelope = transport.envelopes.first; + expect(envelope.items.length, 2); + expect(envelope.items[0].header.type, "transaction"); + expect(await envelope.items[0].header.length(), greaterThan(0)); + expect(envelope.items[1].header.type, "profile"); + expect(await envelope.items[1].header.length(), greaterThan(0)); + + final txJson = utf8.decode(await envelope.items[0].dataFactory()); + final txData = json.decode(txJson) as Map; + + final profileJson = utf8.decode(await envelope.items[1].dataFactory()); + final profileData = json.decode(profileJson) as Map; + + expect(txData["event_id"], isNotNull); + expect(txData["event_id"], profileData["transaction"]["id"]); + expect(txData["contexts"]["trace"]["trace_id"], isNotNull); + expect(txData["contexts"]["trace"]["trace_id"], + profileData["transaction"]["trace_id"]); + expect(profileData["debug_meta"]["images"], isNotEmpty); + expect(profileData["profile"]["thread_metadata"], isNotEmpty); + expect(profileData["profile"]["samples"], isNotEmpty); + expect(profileData["profile"]["stacks"], isNotEmpty); + expect(profileData["profile"]["frames"], isNotEmpty); + }, + skip: (Platform.isMacOS || Platform.isIOS) + ? false + : "Profiling is not supported on this platform"); +} diff --git a/flutter/example/ios/Podfile b/flutter/example/ios/Podfile index 313ea4a153..877d653518 100644 --- a/flutter/example/ios/Podfile +++ b/flutter/example/ios/Podfile @@ -32,10 +32,19 @@ target 'Runner' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + + # Configure test target + target 'RunnerTests' do + inherit! :search_paths + end + end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' + end end end diff --git a/flutter/example/ios/Runner.xcodeproj/project.pbxproj b/flutter/example/ios/Runner.xcodeproj/project.pbxproj index b9f077ebb4..29c58327af 100644 --- a/flutter/example/ios/Runner.xcodeproj/project.pbxproj +++ b/flutter/example/ios/Runner.xcodeproj/project.pbxproj @@ -7,16 +7,28 @@ objects = { /* Begin PBXBuildFile section */ + 0E6A6386E49E9527E131F978 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 804FA4C73FD409C61067DA3C /* Pods_RunnerTests.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 15A74CDF250075770078F130 /* Buggy.m in Sources */ = {isa = PBXBuildFile; fileRef = 15A74CDE250075770078F130 /* Buggy.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 4DFA0D3B754F0E702B3CB4B1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B1A3E5A486E474A287B9BF /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 92B25CED2A80EB3100884BDF /* SentryFlutterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92B25CEC2A80EB3100884BDF /* SentryFlutterTests.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 92B25CEE2A80EB3100884BDF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -37,11 +49,15 @@ 15A74CDE250075770078F130 /* Buggy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Buggy.m; sourceTree = ""; }; 38199AEAF0F80C193173BC10 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3CEA108DF90E0A3E0A377D59 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 4F22DC026405C7E7F57CEBA6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 768362D06CA53D13052997C4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 804FA4C73FD409C61067DA3C /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 92B25CEA2A80EB3100884BDF /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 92B25CEC2A80EB3100884BDF /* SentryFlutterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryFlutterTests.swift; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -50,9 +66,19 @@ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C4B1A3E5A486E474A287B9BF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F2579A3BD1D48D0BC33E4ADF /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + FDFDFB8E5235EA47CE65FBC5 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 92B25CE72A80EB3100884BDF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0E6A6386E49E9527E131F978 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -70,10 +96,21 @@ 38199AEAF0F80C193173BC10 /* Pods-Runner.debug.xcconfig */, 4F22DC026405C7E7F57CEBA6 /* Pods-Runner.release.xcconfig */, 768362D06CA53D13052997C4 /* Pods-Runner.profile.xcconfig */, + F2579A3BD1D48D0BC33E4ADF /* Pods-RunnerTests.debug.xcconfig */, + FDFDFB8E5235EA47CE65FBC5 /* Pods-RunnerTests.release.xcconfig */, + 3CEA108DF90E0A3E0A377D59 /* Pods-RunnerTests.profile.xcconfig */, ); path = Pods; sourceTree = ""; }; + 92B25CEB2A80EB3100884BDF /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 92B25CEC2A80EB3100884BDF /* SentryFlutterTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -90,6 +127,7 @@ children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, + 92B25CEB2A80EB3100884BDF /* RunnerTests */, 97C146EF1CF9000F007C117D /* Products */, 2BEB9477FF568D2F04848764 /* Pods */, EDEF7FDEB4F4BFCED18D7311 /* Frameworks */, @@ -100,6 +138,7 @@ isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, + 92B25CEA2A80EB3100884BDF /* RunnerTests.xctest */, ); name = Products; sourceTree = ""; @@ -125,6 +164,7 @@ isa = PBXGroup; children = ( C4B1A3E5A486E474A287B9BF /* Pods_Runner.framework */, + 804FA4C73FD409C61067DA3C /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -132,6 +172,25 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 92B25CE92A80EB3100884BDF /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 92B25CF32A80EB3100884BDF /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 95EC4C94BEBF8B73E55C82BD /* [CP] Check Pods Manifest.lock */, + 92B25CE62A80EB3100884BDF /* Sources */, + 92B25CE72A80EB3100884BDF /* Frameworks */, + 92B25CE82A80EB3100884BDF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 92B25CEF2A80EB3100884BDF /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 92B25CEA2A80EB3100884BDF /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; @@ -161,9 +220,14 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1300; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { + 92B25CE92A80EB3100884BDF = { + CreatedOnToolsVersion = 14.3.1; + TestTargetID = 97C146ED1CF9000F007C117D; + }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; @@ -184,11 +248,19 @@ projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, + 92B25CE92A80EB3100884BDF /* RunnerTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 92B25CE82A80EB3100884BDF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -239,7 +311,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; 4D812E05A580E1EFEF066A51 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; @@ -258,6 +330,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 95EC4C94BEBF8B73E55C82BD /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -271,11 +365,19 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 92B25CE62A80EB3100884BDF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 92B25CED2A80EB3100884BDF /* SentryFlutterTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -288,6 +390,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 92B25CEF2A80EB3100884BDF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 92B25CEE2A80EB3100884BDF /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -389,6 +499,90 @@ }; name = Profile; }; + 92B25CF02A80EB3100884BDF /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F2579A3BD1D48D0BC33E4ADF /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.flutter.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 92B25CF12A80EB3100884BDF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FDFDFB8E5235EA47CE65FBC5 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.flutter.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 92B25CF22A80EB3100884BDF /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3CEA108DF90E0A3E0A377D59 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 97JCY7859U; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.sentry.flutter.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -562,6 +756,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 92B25CF32A80EB3100884BDF /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 92B25CF02A80EB3100884BDF /* Debug */, + 92B25CF12A80EB3100884BDF /* Release */, + 92B25CF22A80EB3100884BDF /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a335..0fa7c24eb1 100644 --- a/flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + + + SentryFlutter { + return SentryFlutter() + } + } +} diff --git a/flutter/example/lib/auto_close_screen.dart b/flutter/example/lib/auto_close_screen.dart new file mode 100644 index 0000000000..15e8fac1fb --- /dev/null +++ b/flutter/example/lib/auto_close_screen.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:sentry/sentry.dart'; + +/// This screen is only used to demonstrate how route navigation works. +/// Init will create a child span and pop the screen after 3 seconds. +/// Afterwards the transaction should be seen on the performance page. +class AutoCloseScreen extends StatefulWidget { + const AutoCloseScreen({super.key}); + + @override + AutoCloseScreenState createState() => AutoCloseScreenState(); +} + +class AutoCloseScreenState extends State { + static const delayInSeconds = 3; + + @override + void initState() { + super.initState(); + _doComplexOperationThenClose(); + } + + Future _doComplexOperationThenClose() async { + final activeSpan = Sentry.getSpan(); + final childSpan = activeSpan?.startChild('complex operation', + description: 'running a $delayInSeconds seconds operation'); + await Future.delayed(const Duration(seconds: delayInSeconds)); + childSpan?.finish(); + // ignore: use_build_context_synchronously + Navigator.of(context).pop(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Delayed Screen'), + ), + body: const Center( + child: Text( + 'This screen will automatically close in $delayInSeconds seconds...', + textAlign: TextAlign.center, + ), + ), + ); + } +} diff --git a/flutter/example/lib/drift/connection/connection.dart b/flutter/example/lib/drift/connection/connection.dart new file mode 100644 index 0000000000..7ef7ddc757 --- /dev/null +++ b/flutter/example/lib/drift/connection/connection.dart @@ -0,0 +1 @@ +export 'unsupported.dart' if (dart.library.ffi) 'native.dart'; diff --git a/flutter/example/lib/drift/connection/native.dart b/flutter/example/lib/drift/connection/native.dart new file mode 100644 index 0000000000..fb9987412e --- /dev/null +++ b/flutter/example/lib/drift/connection/native.dart @@ -0,0 +1,7 @@ +import 'package:drift/backends.dart'; +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; + +QueryExecutor inMemoryExecutor() { + return NativeDatabase.memory(); +} diff --git a/flutter/example/lib/drift/connection/unsupported.dart b/flutter/example/lib/drift/connection/unsupported.dart new file mode 100644 index 0000000000..87b9b45143 --- /dev/null +++ b/flutter/example/lib/drift/connection/unsupported.dart @@ -0,0 +1,17 @@ +import 'package:drift/drift.dart'; + +Never _unsupported() { + throw UnsupportedError( + 'No suitable database implementation was found on this platform.'); +} + +// Depending on the platform the app is compiled to, the following stubs will +// be replaced with the methods in native.dart or web.dart + +QueryExecutor inMemoryExecutor() { + return _unsupported(); +} + +Future validateDatabaseSchema(GeneratedDatabase database) async { + _unsupported(); +} diff --git a/flutter/example/lib/drift/database.dart b/flutter/example/lib/drift/database.dart new file mode 100644 index 0000000000..914a87ca1a --- /dev/null +++ b/flutter/example/lib/drift/database.dart @@ -0,0 +1,18 @@ +import 'package:drift/drift.dart'; + +part 'database.g.dart'; + +class TodoItems extends Table { + IntColumn get id => integer().autoIncrement()(); + TextColumn get title => text().withLength(min: 6, max: 32)(); + TextColumn get content => text().named('body')(); + IntColumn get category => integer().nullable()(); +} + +@DriftDatabase(tables: [TodoItems]) +class AppDatabase extends _$AppDatabase { + AppDatabase(super.e); + + @override + int get schemaVersion => 1; +} diff --git a/flutter/example/lib/drift/database.g.dart b/flutter/example/lib/drift/database.g.dart new file mode 100644 index 0000000000..1f9d234456 --- /dev/null +++ b/flutter/example/lib/drift/database.g.dart @@ -0,0 +1,269 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'database.dart'; + +// ignore_for_file: type=lint +class $TodoItemsTable extends TodoItems + with TableInfo<$TodoItemsTable, TodoItem> { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + $TodoItemsTable(this.attachedDatabase, [this._alias]); + static const VerificationMeta _idMeta = const VerificationMeta('id'); + @override + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: + GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + static const VerificationMeta _titleMeta = const VerificationMeta('title'); + @override + late final GeneratedColumn title = GeneratedColumn( + 'title', aliasedName, false, + additionalChecks: + GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 32), + type: DriftSqlType.string, + requiredDuringInsert: true); + static const VerificationMeta _contentMeta = + const VerificationMeta('content'); + @override + late final GeneratedColumn content = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, requiredDuringInsert: true); + static const VerificationMeta _categoryMeta = + const VerificationMeta('category'); + @override + late final GeneratedColumn category = GeneratedColumn( + 'category', aliasedName, true, + type: DriftSqlType.int, requiredDuringInsert: false); + @override + List get $columns => [id, title, content, category]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'todo_items'; + @override + VerificationContext validateIntegrity(Insertable instance, + {bool isInserting = false}) { + final context = VerificationContext(); + final data = instance.toColumns(true); + if (data.containsKey('id')) { + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); + } + if (data.containsKey('title')) { + context.handle( + _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta)); + } else if (isInserting) { + context.missing(_titleMeta); + } + if (data.containsKey('body')) { + context.handle(_contentMeta, + content.isAcceptableOrUnknown(data['body']!, _contentMeta)); + } else if (isInserting) { + context.missing(_contentMeta); + } + if (data.containsKey('category')) { + context.handle(_categoryMeta, + category.isAcceptableOrUnknown(data['category']!, _categoryMeta)); + } + return context; + } + + @override + Set get $primaryKey => {id}; + @override + TodoItem map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return TodoItem( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + title: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}title'])!, + content: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body'])!, + category: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}category']), + ); + } + + @override + $TodoItemsTable createAlias(String alias) { + return $TodoItemsTable(attachedDatabase, alias); + } +} + +class TodoItem extends DataClass implements Insertable { + final int id; + final String title; + final String content; + final int? category; + const TodoItem( + {required this.id, + required this.title, + required this.content, + this.category}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['title'] = Variable(title); + map['body'] = Variable(content); + if (!nullToAbsent || category != null) { + map['category'] = Variable(category); + } + return map; + } + + TodoItemsCompanion toCompanion(bool nullToAbsent) { + return TodoItemsCompanion( + id: Value(id), + title: Value(title), + content: Value(content), + category: category == null && nullToAbsent + ? const Value.absent() + : Value(category), + ); + } + + factory TodoItem.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return TodoItem( + id: serializer.fromJson(json['id']), + title: serializer.fromJson(json['title']), + content: serializer.fromJson(json['content']), + category: serializer.fromJson(json['category']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'title': serializer.toJson(title), + 'content': serializer.toJson(content), + 'category': serializer.toJson(category), + }; + } + + TodoItem copyWith( + {int? id, + String? title, + String? content, + Value category = const Value.absent()}) => + TodoItem( + id: id ?? this.id, + title: title ?? this.title, + content: content ?? this.content, + category: category.present ? category.value : this.category, + ); + @override + String toString() { + return (StringBuffer('TodoItem(') + ..write('id: $id, ') + ..write('title: $title, ') + ..write('content: $content, ') + ..write('category: $category') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(id, title, content, category); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is TodoItem && + other.id == this.id && + other.title == this.title && + other.content == this.content && + other.category == this.category); +} + +class TodoItemsCompanion extends UpdateCompanion { + final Value id; + final Value title; + final Value content; + final Value category; + const TodoItemsCompanion({ + this.id = const Value.absent(), + this.title = const Value.absent(), + this.content = const Value.absent(), + this.category = const Value.absent(), + }); + TodoItemsCompanion.insert({ + this.id = const Value.absent(), + required String title, + required String content, + this.category = const Value.absent(), + }) : title = Value(title), + content = Value(content); + static Insertable custom({ + Expression? id, + Expression? title, + Expression? content, + Expression? category, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (title != null) 'title': title, + if (content != null) 'body': content, + if (category != null) 'category': category, + }); + } + + TodoItemsCompanion copyWith( + {Value? id, + Value? title, + Value? content, + Value? category}) { + return TodoItemsCompanion( + id: id ?? this.id, + title: title ?? this.title, + content: content ?? this.content, + category: category ?? this.category, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (title.present) { + map['title'] = Variable(title.value); + } + if (content.present) { + map['body'] = Variable(content.value); + } + if (category.present) { + map['category'] = Variable(category.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('TodoItemsCompanion(') + ..write('id: $id, ') + ..write('title: $title, ') + ..write('content: $content, ') + ..write('category: $category') + ..write(')')) + .toString(); + } +} + +abstract class _$AppDatabase extends GeneratedDatabase { + _$AppDatabase(QueryExecutor e) : super(e); + late final $TodoItemsTable todoItems = $TodoItemsTable(this); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [todoItems]; +} diff --git a/flutter/example/lib/isar/user.dart b/flutter/example/lib/isar/user.dart new file mode 100644 index 0000000000..f255d2389d --- /dev/null +++ b/flutter/example/lib/isar/user.dart @@ -0,0 +1,12 @@ +import 'package:isar/isar.dart'; + +part 'user.g.dart'; + +@collection +class User { + Id id = Isar.autoIncrement; + + String? name; + + int? age; +} diff --git a/flutter/example/lib/isar/user.g.dart b/flutter/example/lib/isar/user.g.dart new file mode 100644 index 0000000000..c4d7ef985f --- /dev/null +++ b/flutter/example/lib/isar/user.g.dart @@ -0,0 +1,553 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types + +extension GetUserCollection on Isar { + IsarCollection get users => this.collection(); +} + +final UserSchema = CollectionSchema( + name: r'User', + id: BigInt.parse("-7838171048429979076").toInt(), + properties: { + r'age': PropertySchema( + id: BigInt.parse("0").toInt(), + name: r'age', + type: IsarType.long, + ), + r'name': PropertySchema( + id: BigInt.parse("1").toInt(), + name: r'name', + type: IsarType.string, + ) + }, + estimateSize: _userEstimateSize, + serialize: _userSerialize, + deserialize: _userDeserialize, + deserializeProp: _userDeserializeProp, + idName: r'id', + indexes: {}, + links: {}, + embeddedSchemas: {}, + getId: _userGetId, + getLinks: _userGetLinks, + attach: _userAttach, + version: '3.1.0', +); + +int _userEstimateSize( + User object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.name; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + return bytesCount; +} + +void _userSerialize( + User object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeLong(offsets[0], object.age); + writer.writeString(offsets[1], object.name); +} + +User _userDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = User(); + object.age = reader.readLongOrNull(offsets[0]); + object.id = id; + object.name = reader.readStringOrNull(offsets[1]); + return object; +} + +P _userDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readLongOrNull(offset)) as P; + case 1: + return (reader.readStringOrNull(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _userGetId(User object) { + return object.id; +} + +List> _userGetLinks(User object) { + return []; +} + +void _userAttach(IsarCollection col, Id id, User object) { + object.id = id; +} + +extension UserQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension UserQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension UserQueryFilter on QueryBuilder { + QueryBuilder ageIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'age', + )); + }); + } + + QueryBuilder ageIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'age', + )); + }); + } + + QueryBuilder ageEqualTo(int? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'age', + value: value, + )); + }); + } + + QueryBuilder ageGreaterThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'age', + value: value, + )); + }); + } + + QueryBuilder ageLessThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'age', + value: value, + )); + }); + } + + QueryBuilder ageBetween( + int? lower, + int? upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'age', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder nameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'name', + )); + }); + } + + QueryBuilder nameIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'name', + )); + }); + } + + QueryBuilder nameEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'name', + value: '', + )); + }); + } + + QueryBuilder nameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'name', + value: '', + )); + }); + } +} + +extension UserQueryObject on QueryBuilder {} + +extension UserQueryLinks on QueryBuilder {} + +extension UserQuerySortBy on QueryBuilder { + QueryBuilder sortByAge() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.asc); + }); + } + + QueryBuilder sortByAgeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.desc); + }); + } + + QueryBuilder sortByName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.asc); + }); + } + + QueryBuilder sortByNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.desc); + }); + } +} + +extension UserQuerySortThenBy on QueryBuilder { + QueryBuilder thenByAge() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.asc); + }); + } + + QueryBuilder thenByAgeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.desc); + }); + } + + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.asc); + }); + } + + QueryBuilder thenByNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.desc); + }); + } +} + +extension UserQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByAge() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'age'); + }); + } + + QueryBuilder distinctByName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'name', caseSensitive: caseSensitive); + }); + } +} + +extension UserQueryProperty on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder ageProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'age'); + }); + } + + QueryBuilder nameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'name'); + }); + } +} diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index 6d657a589e..26bbdce6d8 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -7,7 +7,10 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:logging/logging.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:sentry_drift/sentry_drift.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:sentry_isar/sentry_isar.dart'; import 'package:sentry_sqflite/sentry_sqflite.dart'; import 'package:sqflite/sqflite.dart'; // import 'package:sqflite_common_ffi/sqflite_ffi.dart'; @@ -15,27 +18,35 @@ import 'package:sqflite/sqflite.dart'; import 'package:universal_platform/universal_platform.dart'; import 'package:feedback/feedback.dart' as feedback; import 'package:provider/provider.dart'; +import 'auto_close_screen.dart'; +import 'drift/database.dart'; +import 'drift/connection/connection.dart'; +import 'isar/user.dart'; import 'user_feedback_dialog.dart'; import 'package:dio/dio.dart'; import 'package:sentry_dio/sentry_dio.dart'; import 'package:sentry_logging/sentry_logging.dart'; +import 'package:sentry_hive/sentry_hive.dart'; // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io const String exampleDsn = 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; +/// This is an exampleUrl that will be used to demonstrate how http requests are captured. +const String exampleUrl = 'https://jsonplaceholder.typicode.com/todos/'; + const _channel = MethodChannel('example.flutter.sentry.io'); var _isIntegrationTest = false; +final GlobalKey navigatorKey = GlobalKey(); + Future main() async { await setupSentry( () => runApp( - SentryScreenshotWidget( - child: SentryUserInteractionWidget( - child: DefaultAssetBundle( - bundle: SentryAssetBundle(), - child: const MyApp(), - ), + SentryWidget( + child: DefaultAssetBundle( + bundle: SentryAssetBundle(), + child: const MyApp(), ), ), ), @@ -48,6 +59,7 @@ Future setupSentry(AppRunner appRunner, String dsn, await SentryFlutter.init((options) { options.dsn = exampleDsn; options.tracesSampleRate = 1.0; + options.profilesSampleRate = 1.0; options.reportPackages = false; options.addInAppInclude('sentry_flutter_example'); options.considerInAppFramesByDefault = false; @@ -93,6 +105,7 @@ class _MyAppState extends State { create: (_) => ThemeProvider(), child: Builder( builder: (context) => MaterialApp( + navigatorKey: navigatorKey, navigatorObservers: [ SentryNavigatorObserver(), ], @@ -105,6 +118,30 @@ class _MyAppState extends State { } } +class TooltipButton extends StatelessWidget { + final String text; + final String buttonTitle; + final void Function()? onPressed; + + const TooltipButton( + {required this.onPressed, + required this.buttonTitle, + required this.text, + Key? key}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Tooltip( + message: text, + child: ElevatedButton( + onPressed: onPressed, + key: key, + child: Text(buttonTitle), + )); + } +} + class MainScaffold extends StatelessWidget { const MainScaffold({ Key? key, @@ -147,67 +184,121 @@ class MainScaffold extends StatelessWidget { child: Column( children: [ if (_isIntegrationTest) const IntegrationTestWidget(), - const Center(child: Text('Trigger an action:\n')), - ElevatedButton( - onPressed: () => sqfliteTest(), - child: const Text('sqflite'), + const Center(child: Text('Trigger an action.\n')), + const Padding( + padding: EdgeInsets.all(15), //apply padding to all four sides + child: Center( + child: Text( + 'Long press a button to see more information. (hover on web)')), + ), + TooltipButton( + onPressed: () => navigateToAutoCloseScreen(context), + text: + 'Pushes a screen and creates a transaction named \'AutoCloseScreen\' with a child span that finishes after 3 seconds. \nAfter the screen has popped the transaction can then be seen on the performance page.', + buttonTitle: 'Route Navigation Observer', + ), + if (!UniversalPlatform.isWeb) + TooltipButton( + onPressed: driftTest, + text: + 'Executes CRUD operations on an in-memory with Drift and sends the created transaction to Sentry.', + buttonTitle: 'drift', + ), + if (!UniversalPlatform.isWeb) + TooltipButton( + onPressed: hiveTest, + text: + 'Executes CRUD operations on an in-memory with Hive and sends the created transaction to Sentry.', + buttonTitle: 'hive', + ), + if (!UniversalPlatform.isWeb) + TooltipButton( + onPressed: isarTest, + text: + 'Executes CRUD operations on an in-memory with Isart and sends the created transaction to Sentry.', + buttonTitle: 'isar', + ), + TooltipButton( + onPressed: sqfliteTest, + text: + 'Executes CRUD operations on an in-memory with Hive and sends the created transaction to Sentry.', + buttonTitle: 'sqflite', ), - ElevatedButton( + TooltipButton( onPressed: () => SecondaryScaffold.openSecondaryScaffold(context), - child: const Text('Open another Scaffold'), + text: + 'Demonstrates how the router integration adds a navigation event to the breadcrumbs that can be seen when throwing an exception for example.', + buttonTitle: 'Open another Scaffold', ), - ElevatedButton( - onPressed: () => tryCatch(), - key: const Key('dart_try_catch'), - child: const Text('Dart: try catch'), + const TooltipButton( + onPressed: tryCatch, + key: Key('dart_try_catch'), + text: 'Creates a caught exception and sends it to Sentry.', + buttonTitle: 'Dart: try catch', ), - ElevatedButton( - onPressed: () => Scaffold.of(context).showBottomSheet( - (context) => const Text('Scaffold error'), - ), - child: const Text('Flutter error : Scaffold.of()'), + TooltipButton( + onPressed: () => Scaffold.of(context) + .showBottomSheet((context) => const Text('Scaffold error')), + text: + 'Creates an uncaught exception and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Flutter error : Scaffold.of()', ), - ElevatedButton( + TooltipButton( // Warning : not captured if a debugger is attached // https://github.com/flutter/flutter/issues/48972 onPressed: () => throw Exception('Throws onPressed'), - child: const Text('Dart: throw onPressed'), + text: + 'Creates an uncaught exception and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Dart: throw onPressed', ), - ElevatedButton( + TooltipButton( + // Warning : not captured if a debugger is attached + // https://github.com/flutter/flutter/issues/48972 onPressed: () { - // Only relevant in debug builds - // Warning : not captured if a debugger is attached - // https://github.com/flutter/flutter/issues/48972 assert(false, 'assert failure'); }, - child: const Text('Dart: assert'), + text: + 'Creates an uncaught exception and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Dart: assert', ), // Calling the SDK with an appRunner will handle errors from Futures // in SDKs runZonedGuarded onError handler - ElevatedButton( + TooltipButton( onPressed: () async => asyncThrows(), - child: const Text('Dart: async throws'), + text: + 'Creates an async uncaught exception and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Dart: async throws', ), - ElevatedButton( + TooltipButton( onPressed: () async => { await Future.microtask( () => throw StateError('Failure in a microtask'), ) }, - child: const Text('Dart: Fail in microtask.'), + text: + 'Creates an uncaught exception in a microtask and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Dart: Fail in microtask', ), - ElevatedButton( - onPressed: () async => {await compute(loop, 10)}, - child: const Text('Dart: Fail in compute'), + TooltipButton( + onPressed: () async => { + await compute(loop, 10), + }, + text: + 'Creates an uncaught exception in a compute isolate and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Dart: Fail in compute', ), - ElevatedButton( - onPressed: () => Future.delayed( - const Duration(milliseconds: 100), - () => throw Exception('Throws in Future.delayed'), - ), - child: const Text('Throws in Future.delayed'), + TooltipButton( + onPressed: () async => { + await Future.delayed( + const Duration(milliseconds: 100), + () => throw StateError('Failure in a Future.delayed'), + ), + }, + text: + 'Creates an uncaught exception in a Future.delayed and sends it to Sentry. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Throws in Future.delayed', ), - ElevatedButton( + TooltipButton( onPressed: () { // modeled after a real exception FlutterError.onError?.call(FlutterErrorDetails( @@ -225,9 +316,11 @@ class MainScaffold extends StatelessWidget { ], )); }, - child: const Text('Capture from FlutterError.onError'), + text: + 'Creates a FlutterError and passes it to FlutterError.onError callback. This demonstrates how our flutter error integration catches unhandled exceptions.', + buttonTitle: 'Capture from FlutterError.onError', ), - ElevatedButton( + TooltipButton( onPressed: () { // Only usable on Flutter >= 3.3 // and needs the following additional setup: @@ -239,41 +332,41 @@ class MainScaffold extends StatelessWidget { StackTrace.current, ); }, - child: const Text('Capture from PlatformDispatcher.onError'), + text: + 'This is only usable on Flutter >= 3.3 and requires additional setup: options.addIntegration(OnErrorIntegration());', + buttonTitle: 'Capture from PlatformDispatcher.onError', ), - ElevatedButton( - key: const Key('view hierarchy'), - onPressed: () => {}, - child: const Visibility( - visible: true, - child: Opacity( - opacity: 0.5, - child: Text('view hierarchy'), - ), - ), - ), - ElevatedButton( + TooltipButton( onPressed: () => makeWebRequest(context), - child: const Text('Dart: Web request'), + text: + 'Attaches web request related spans to the transaction and send it to Sentry.', + buttonTitle: 'Dart: Web request', ), - ElevatedButton( - onPressed: () => showDialogWithTextAndImage(context), - child: const Text('Flutter: Load assets'), - ), - ElevatedButton( + TooltipButton( + onPressed: () => makeWebRequestWithDio(context), key: const Key('dio_web_request'), - onPressed: () async => await makeWebRequestWithDio(context), - child: const Text('Dio: Web request'), + text: + 'Attaches web request related spans to the transaction and send it to Sentry.', + buttonTitle: 'Dio: Web request', + ), + + TooltipButton( + onPressed: () => showDialogWithTextAndImage(context), + text: + 'Attaches asset bundle related spans to the transaction and send it to Sentry.', + buttonTitle: 'Flutter: Load assets', ), - ElevatedButton( + TooltipButton( onPressed: () { // ignore: avoid_print print('A print breadcrumb'); Sentry.captureMessage('A message with a print() Breadcrumb'); }, - child: const Text('Record print() as breadcrumb'), + text: + 'Sends a captureMessage to Sentry with a breadcrumb created by a print() statement.', + buttonTitle: 'Record print() as breadcrumb', ), - ElevatedButton( + TooltipButton( onPressed: () { Sentry.captureMessage( 'This event has an extra tag', @@ -282,10 +375,11 @@ class MainScaffold extends StatelessWidget { }, ); }, - child: - const Text('Capture message with scope with additional tag'), + text: + 'Sends the capture message event with additional Tag to Sentry.', + buttonTitle: 'Capture message with scope with additional tag', ), - ElevatedButton( + TooltipButton( onPressed: () async { final transaction = Sentry.getSpan() ?? Sentry.startTransaction( @@ -327,12 +421,14 @@ class MainScaffold extends StatelessWidget { status: const SpanStatus.internalError()); await Future.delayed(const Duration(milliseconds: 50)); - + // findPrimeNumber(1000000); // Uncomment to see it with profiling await transaction.finish(status: const SpanStatus.ok()); }, - child: const Text('Capture transaction'), + text: + 'Creates a custom transaction, adds child spans and send them to Sentry.', + buttonTitle: 'Capture transaction', ), - ElevatedButton( + TooltipButton( onPressed: () { Sentry.captureMessage( 'This message has an attachment', @@ -348,9 +444,10 @@ class MainScaffold extends StatelessWidget { }, ); }, - child: const Text('Capture message with attachment'), + text: 'Sends the capture message with an attachment to Sentry.', + buttonTitle: 'Capture message with attachment', ), - ElevatedButton( + TooltipButton( onPressed: () { feedback.BetterFeedback.of(context) .show((feedback.UserFeedback feedback) { @@ -374,9 +471,11 @@ class MainScaffold extends StatelessWidget { ); }); }, - child: const Text('Capture message with image attachment'), + text: + 'Sends the capture message with an image attachment to Sentry.', + buttonTitle: 'Capture message with image attachment', ), - ElevatedButton( + TooltipButton( onPressed: () async { final id = await Sentry.captureMessage('UserFeedback'); // ignore: use_build_context_synchronously @@ -392,9 +491,11 @@ class MainScaffold extends StatelessWidget { }, ); }, - child: const Text('Capture User Feedback'), + text: + 'Shows a custom user feedback dialog without an ongoing event that captures and sends user feedback data to Sentry.', + buttonTitle: 'Capture User Feedback', ), - ElevatedButton( + TooltipButton( onPressed: () async { await showDialog( context: context, @@ -403,24 +504,88 @@ class MainScaffold extends StatelessWidget { }, ); }, - child: const Text('Show UserFeedback Dialog without event'), + text: '', + buttonTitle: 'Show UserFeedback Dialog without event', ), - ElevatedButton( + TooltipButton( onPressed: () { final log = Logger('Logging'); log.info('My Logging test'); }, - child: const Text('Logging'), + text: + 'Demonstrates the logging integration. log.info() will create an info event send it to Sentry.', + buttonTitle: 'Logging', ), if (UniversalPlatform.isIOS || UniversalPlatform.isMacOS) const CocoaExample(), if (UniversalPlatform.isAndroid) const AndroidExample(), - ], + ].map((widget) { + if (kIsWeb) { + // Add vertical padding to web so the tooltip doesn't obstruct the clicking of the button below. + return Padding( + padding: const EdgeInsets.only(top: 18.0, bottom: 18.0), + child: widget, + ); + } + return widget; + }).toList(), ), ), ); } + Future isarTest() async { + final tr = Sentry.startTransaction( + 'isarTest', + 'db', + bindToScope: true, + ); + + final dir = await getApplicationDocumentsDirectory(); + + final isar = await SentryIsar.open( + [UserSchema], + directory: dir.path, + ); + + final newUser = User() + ..name = 'Joe Dirt' + ..age = 36; + + await isar.writeTxn(() async { + await isar.users.put(newUser); // insert & update + }); + + final existingUser = await isar.users.get(newUser.id); // get + + await isar.writeTxn(() async { + await isar.users.delete(existingUser!.id); // delete + }); + + await tr.finish(status: const SpanStatus.ok()); + } + + Future hiveTest() async { + final tr = Sentry.startTransaction( + 'hiveTest', + 'db', + bindToScope: true, + ); + + final appDir = await getApplicationDocumentsDirectory(); + SentryHive.init(appDir.path); + + final catsBox = await SentryHive.openBox('cats'); + await catsBox.put('fluffy', {'name': 'Fluffy', 'age': 4}); + await catsBox.put('loki', {'name': 'Loki', 'age': 2}); + await catsBox.clear(); + await catsBox.close(); + + SentryHive.close(); + + await tr.finish(status: const SpanStatus.ok()); + } + Future sqfliteTest() async { final tr = Sentry.startTransaction( 'sqfliteTest', @@ -466,6 +631,34 @@ class MainScaffold extends StatelessWidget { await tr.finish(status: const SpanStatus.ok()); } + + Future driftTest() async { + final tr = Sentry.startTransaction( + 'driftTest', + 'db', + bindToScope: true, + ); + + final executor = SentryQueryExecutor( + () async => inMemoryExecutor(), + databaseName: 'sentry_in_memory_db', + ); + + final db = AppDatabase(executor); + + await db.into(db.todoItems).insert( + TodoItemsCompanion.insert( + title: 'This is a test thing', + content: 'test', + ), + ); + + await db.select(db.todoItems).get(); + + await db.close(); + + await tr.finish(status: const SpanStatus.ok()); + } } extension BuildContextExtension on BuildContext { @@ -526,6 +719,16 @@ class AndroidExample extends StatelessWidget { } } +void navigateToAutoCloseScreen(BuildContext context) { + Navigator.push( + context, + MaterialPageRoute( + settings: const RouteSettings(name: 'AutoCloseScreen'), + builder: (context) => const AutoCloseScreen(), + ), + ); +} + Future tryCatch() async { try { throw StateError('try catch'); @@ -699,7 +902,7 @@ Future makeWebRequest(BuildContext context) async { ); // We don't do any exception handling here. // In case of an exception, let it get caught and reported to Sentry - final response = await client.get(Uri.parse('https://flutter.dev/')); + final response = await client.get(Uri.parse(exampleUrl)); await transaction.finish(status: const SpanStatus.ok()); @@ -711,10 +914,6 @@ Future makeWebRequest(BuildContext context) async { // ignore: use_build_context_synchronously await showDialog( context: context, - // gets tracked if using SentryNavigatorObserver - routeSettings: const RouteSettings( - name: 'flutter.dev dialog', - ), builder: (context) { return AlertDialog( title: Text('Response ${response.statusCode}'), @@ -748,7 +947,7 @@ Future makeWebRequestWithDio(BuildContext context) async { ); Response? response; try { - response = await dio.get('https://flutter.dev/'); + response = await dio.get(exampleUrl); span.status = const SpanStatus.ok(); } catch (exception, stackTrace) { span.throwable = exception; @@ -766,10 +965,6 @@ Future makeWebRequestWithDio(BuildContext context) async { // ignore: use_build_context_synchronously await showDialog( context: context, - // gets tracked if using SentryNavigatorObserver - routeSettings: const RouteSettings( - name: 'flutter.dev dialog', - ), builder: (context) { return AlertDialog( title: Text('Response ${response?.statusCode}'), @@ -855,3 +1050,26 @@ class ThemeProvider extends ChangeNotifier { Future execute(String method) async { await _channel.invokeMethod(method); } + +// Don't inline this one or it shows up as an anonymous closure in profiles. +@pragma("vm:never-inline") +int findPrimeNumber(int n) { + int count = 0; + int a = 2; + while (count < n) { + int b = 2; + bool prime = true; // to check if found a prime + while (b * b <= a) { + if (a % b == 0) { + prime = false; + break; + } + b++; + } + if (prime) { + count++; + } + a++; + } + return a - 1; +} diff --git a/flutter/example/macos/Podfile b/flutter/example/macos/Podfile index fe733905db..6feac427ca 100644 --- a/flutter/example/macos/Podfile +++ b/flutter/example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.13' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -36,5 +36,8 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_macos_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.14' + end end end diff --git a/flutter/example/macos/Runner.xcodeproj/project.pbxproj b/flutter/example/macos/Runner.xcodeproj/project.pbxproj index d74803f7c0..ad9c506c71 100644 --- a/flutter/example/macos/Runner.xcodeproj/project.pbxproj +++ b/flutter/example/macos/Runner.xcodeproj/project.pbxproj @@ -208,8 +208,8 @@ 33CC10E52044A3C60003C045 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -412,7 +412,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -492,7 +492,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -539,7 +539,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 152c342968..99a6840afc 100644 --- a/flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ SentryLevel { + switch diagnosticLevel { + case "fatal": + return .fatal + case "error": + return .error + case "debug": + return .debug + case "warning": + return .warning + case "info": + return .info + default: + return .none + } + } +} diff --git a/flutter/ios/Classes/SentryFlutterPluginApple.swift b/flutter/ios/Classes/SentryFlutterPluginApple.swift index f531fda120..be5e301791 100644 --- a/flutter/ios/Classes/SentryFlutterPluginApple.swift +++ b/flutter/ios/Classes/SentryFlutterPluginApple.swift @@ -39,6 +39,8 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { registrar.addMethodCallDelegate(instance, channel: channel) } + private lazy var sentryFlutter = SentryFlutter() + private func registerObserver() { NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive), @@ -150,6 +152,14 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { let key = arguments?["key"] as? String removeTag(key: key, result: result) + #if !os(tvOS) && !os(watchOS) + case "discardProfiler": + discardProfiler(call, result) + + case "collectProfile": + collectProfile(call, result) + #endif + default: result(FlutterMethodNotImplemented) } @@ -250,7 +260,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { } SentrySDK.start { options in - self.updateOptions(arguments: arguments, options: options) + self.sentryFlutter.update(options: options, with: arguments) if arguments["enableAutoPerformanceTracing"] as? Bool ?? false { PrivateSentrySDKOnly.appStartMeasurementHybridSDKMode = true @@ -307,106 +317,6 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } - // swiftlint:disable:next cyclomatic_complexity - private func updateOptions(arguments: [String: Any], options: Options) { - if let dsn = arguments["dsn"] as? String { - options.dsn = dsn - } - - if let isDebug = arguments["debug"] as? Bool { - options.debug = isDebug - } - - if let environment = arguments["environment"] as? String { - options.environment = environment - } - - if let releaseName = arguments["release"] as? String { - options.releaseName = releaseName - } - - if let enableAutoSessionTracking = arguments["enableAutoSessionTracking"] as? Bool { - options.enableAutoSessionTracking = enableAutoSessionTracking - } - - if let attachStacktrace = arguments["attachStacktrace"] as? Bool { - options.attachStacktrace = attachStacktrace - } - - if let diagnosticLevel = arguments["diagnosticLevel"] as? String, options.debug == true { - options.diagnosticLevel = logLevelFrom(diagnosticLevel: diagnosticLevel) - } - - if let sessionTrackingIntervalMillis = arguments["autoSessionTrackingIntervalMillis"] as? UInt { - options.sessionTrackingIntervalMillis = sessionTrackingIntervalMillis - } - - if let dist = arguments["dist"] as? String { - options.dist = dist - } - - if let enableAutoNativeBreadcrumbs = arguments["enableAutoNativeBreadcrumbs"] as? Bool { - options.enableAutoBreadcrumbTracking = enableAutoNativeBreadcrumbs - } - - if let enableNativeCrashHandling = arguments["enableNativeCrashHandling"] as? Bool { - options.enableCrashHandler = enableNativeCrashHandling - } - - if let maxBreadcrumbs = arguments["maxBreadcrumbs"] as? UInt { - options.maxBreadcrumbs = maxBreadcrumbs - } - - if let sendDefaultPii = arguments["sendDefaultPii"] as? Bool { - options.sendDefaultPii = sendDefaultPii - } - - if let maxCacheItems = arguments["maxCacheItems"] as? UInt { - options.maxCacheItems = maxCacheItems - } - - if let enableWatchdogTerminationTracking = arguments["enableWatchdogTerminationTracking"] as? Bool { - options.enableWatchdogTerminationTracking = enableWatchdogTerminationTracking - } - - if let sendClientReports = arguments["sendClientReports"] as? Bool { - options.sendClientReports = sendClientReports - } - - if let maxAttachmentSize = arguments["maxAttachmentSize"] as? UInt { - options.maxAttachmentSize = maxAttachmentSize - } - - if let captureFailedRequests = arguments["captureFailedRequests"] as? Bool { - options.enableCaptureFailedRequests = captureFailedRequests - } - - if let enableAppHangTracking = arguments["enableAppHangTracking"] as? Bool { - options.enableAppHangTracking = enableAppHangTracking - } - - if let appHangTimeoutIntervalMillis = arguments["appHangTimeoutIntervalMillis"] as? UInt { - options.appHangTimeoutInterval = TimeInterval(appHangTimeoutIntervalMillis) / 1000 - } - } - - private func logLevelFrom(diagnosticLevel: String) -> SentryLevel { - switch diagnosticLevel { - case "fatal": - return .fatal - case "error": - return .error - case "debug": - return .debug - case "warning": - return .warning - case "info": - return .info - default: - return .none - } - } - private func setEventOriginTag(event: Event) { guard let sdk = event.sdk else { return @@ -450,8 +360,8 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { private func captureEnvelope(_ call: FlutterMethodCall, result: @escaping FlutterResult) { guard let arguments = call.arguments as? [Any], !arguments.isEmpty, - let data = (arguments.first as? FlutterStandardTypedData)?.data else { - print("Envelope is null or empty !") + let data = (arguments.first as? FlutterStandardTypedData)?.data else { + print("Envelope is null or empty!") result(FlutterError(code: "2", message: "Envelope is null or empty", details: nil)) return } @@ -483,8 +393,8 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result(item) #else - print("note: appStartMeasurement not available on this platform") - result(nil) + print("note: appStartMeasurement not available on this platform") + result(nil) #endif } @@ -648,6 +558,42 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } } + + private func collectProfile(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { + guard let arguments = call.arguments as? [String: Any], + let traceId = arguments["traceId"] as? String else { + print("Cannot collect profile: trace ID missing") + result(FlutterError(code: "6", message: "Cannot collect profile: trace ID missing", details: nil)) + return + } + + guard let startTime = arguments["startTime"] as? UInt64 else { + print("Cannot collect profile: start time missing") + result(FlutterError(code: "7", message: "Cannot collect profile: start time missing", details: nil)) + return + } + + guard let endTime = arguments["endTime"] as? UInt64 else { + print("Cannot collect profile: end time missing") + result(FlutterError(code: "8", message: "Cannot collect profile: end time missing", details: nil)) + return + } + + let payload = PrivateSentrySDKOnly.collectProfileBetween(startTime, and: endTime, + forTrace: SentryId(uuidString: traceId)) + result(payload) + } + + private func discardProfiler(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { + guard let traceId = call.arguments as? String else { + print("Cannot discard a profiler: trace ID missing") + result(FlutterError(code: "9", message: "Cannot discard a profiler: trace ID missing", details: nil)) + return + } + + PrivateSentrySDKOnly.discardProfiler(forTrace: SentryId(uuidString: traceId)) + result(nil) + } } // swiftlint:enable function_body_length diff --git a/flutter/ios/sentry_flutter.podspec b/flutter/ios/sentry_flutter.podspec index 0b0351bd44..03220ac7bf 100644 --- a/flutter/ios/sentry_flutter.podspec +++ b/flutter/ios/sentry_flutter.podspec @@ -12,7 +12,7 @@ Sentry SDK for Flutter with support to native through sentry-cocoa. :tag => s.version.to_s } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' - s.dependency 'Sentry/HybridSDK', '8.10.0' + s.dependency 'Sentry/HybridSDK', '8.19.0' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '11.0' diff --git a/flutter/lib/sentry_flutter.dart b/flutter/lib/sentry_flutter.dart index c30ca1f5ad..0f43bf741b 100644 --- a/flutter/lib/sentry_flutter.dart +++ b/flutter/lib/sentry_flutter.dart @@ -1,5 +1,7 @@ -// ignore: invalid_export_of_internal_element /// A Flutter client for Sentry.io crash reporting. +library sentry_flutter; + +// ignore: invalid_export_of_internal_element export 'package:sentry/sentry.dart'; export 'src/integrations/load_release_integration.dart'; @@ -13,3 +15,4 @@ export 'src/screenshot/sentry_screenshot_widget.dart'; export 'src/screenshot/sentry_screenshot_quality.dart'; export 'src/user_interaction/sentry_user_interaction_widget.dart'; export 'src/binding_wrapper.dart'; +export 'src/sentry_widget.dart'; diff --git a/flutter/lib/src/event_processor/android_platform_exception_event_processor.dart b/flutter/lib/src/event_processor/android_platform_exception_event_processor.dart index ce77150c40..6570dedd81 100644 --- a/flutter/lib/src/event_processor/android_platform_exception_event_processor.dart +++ b/flutter/lib/src/event_processor/android_platform_exception_event_processor.dart @@ -15,9 +15,6 @@ class AndroidPlatformExceptionEventProcessor implements EventProcessor { final SentryFlutterOptions _options; - // Because of obfuscation, we need to dynamically get the name - static final _platformExceptionType = (PlatformException).toString(); - @override Future apply(SentryEvent event, Hint hint) async { if (event is SentryTransaction) { @@ -29,19 +26,23 @@ class AndroidPlatformExceptionEventProcessor implements EventProcessor { return event; } - final nativeStackTrace = plaformException.stacktrace; - if (nativeStackTrace == null) { - return event; - } - try { // PackageInfo has an internal cache, so no need to do it ourselves. final packageInfo = await PackageInfo.fromPlatform(); + + final nativeStackTrace = + _tryParse(plaformException.stacktrace, packageInfo.packageName); + final messageStackTrace = + _tryParse(plaformException.message, packageInfo.packageName); + + if (nativeStackTrace == null && messageStackTrace == null) { + return event; + } + return _processPlatformException( event, - plaformException, nativeStackTrace, - packageInfo.packageName, + messageStackTrace, ); } catch (e, stackTrace) { _options.logger( @@ -55,25 +56,35 @@ class AndroidPlatformExceptionEventProcessor implements EventProcessor { } } - SentryEvent _processPlatformException( - SentryEvent event, - PlatformException exception, - String nativeStackTrace, + List>? _tryParse( + String? potentialStackTrace, String packageName, ) { - final jvmException = - _JvmExceptionFactory(packageName).fromJvmStackTrace(nativeStackTrace); + if (potentialStackTrace == null) { + return null; + } - final exceptions = _removePlatformExceptionStackTraceFromValue( - event.exceptions, - exception, - ); + return _JvmExceptionFactory(packageName) + .fromJvmStackTrace(potentialStackTrace); + } + SentryEvent _processPlatformException( + SentryEvent event, + List>? nativeStackTrace, + List>? messageStackTrace, + ) { final threads = _markDartThreadsAsNonCrashed(event.threads); - final jvmExceptions = jvmException.map((e) => e.key); + final jvmExceptions = [ + ...?nativeStackTrace?.map((e) => e.key), + ...?messageStackTrace?.map((e) => e.key) + ]; + + var jvmThreads = [ + ...?nativeStackTrace?.map((e) => e.value), + ...?messageStackTrace?.map((e) => e.value), + ]; - var jvmThreads = jvmException.map((e) => e.value).toList(growable: false); if (jvmThreads.isNotEmpty) { // filter potential duplicated threads final first = jvmThreads.first; @@ -84,13 +95,16 @@ class AndroidPlatformExceptionEventProcessor implements EventProcessor { jvmThreads.add(first); } - return event.copyWith(exceptions: [ - ...?exceptions, - ...jvmExceptions, - ], threads: [ - ...?threads, - if (_options.attachThreads) ...jvmThreads, - ]); + return event.copyWith( + exceptions: [ + ...?event.exceptions, + ...jvmExceptions, + ], + threads: [ + ...?threads, + if (_options.attachThreads) ...jvmThreads, + ], + ); } /// If the crash originated on Android, the Dart side didn't crash. @@ -99,60 +113,16 @@ class AndroidPlatformExceptionEventProcessor implements EventProcessor { List? threads, ) { return threads - ?.map((e) => e.copyWith( - crashed: false, - // Isolate is safe to use directly, - // because Android is only run in the dart:io context. - current: e.name == Isolate.current.debugName, - )) + ?.map( + (e) => e.copyWith( + crashed: false, + // Isolate is safe to use directly, + // because Android is only run in the dart:io context. + current: e.name == Isolate.current.debugName, + ), + ) .toList(growable: false); } - - /// Remove the StackTrace from [PlatformException] so the message on Sentry - /// looks much better. - List? _removePlatformExceptionStackTraceFromValue( - List? exceptions, - PlatformException platformException, - ) { - if (exceptions == null || exceptions.isEmpty) { - return null; - } - final exceptionCopy = List.from(exceptions); - - final sentryExceptions = exceptionCopy - .where((element) => element.type == _platformExceptionType); - if (sentryExceptions.isEmpty) { - return null; - } - var sentryException = sentryExceptions.first; - - final exceptionIndex = exceptionCopy.indexOf(sentryException); - exceptionCopy.remove(sentryException); - - // Remove stacktrace, so that the PlatformException value doesn't - // include the chained exception. - // PlatformException.stackTrace is an empty string so that - // PlatformException.toString() results in - // `PlatformException(error, Exception Message, null, )` - // instead of - // `PlatformException(error, Exception Message, null, null)`. - // While `null` for `PlatformException.stackTrace` is technically correct - // it's semantically wrong. - platformException = PlatformException( - code: platformException.code, - details: platformException.details, - message: platformException.message, - stacktrace: '', - ); - - sentryException = sentryException.copyWith( - value: platformException.toString(), - ); - - exceptionCopy.insert(exceptionIndex, sentryException); - - return exceptionCopy; - } } class _JvmExceptionFactory { @@ -161,7 +131,8 @@ class _JvmExceptionFactory { final String nativePackageName; List> fromJvmStackTrace( - String exceptionAsString) { + String exceptionAsString, + ) { final jvmException = JvmException.parse(exceptionAsString); final jvmExceptions = [ jvmException, diff --git a/flutter/lib/src/event_processor/flutter_enricher_event_processor.dart b/flutter/lib/src/event_processor/flutter_enricher_event_processor.dart index 0df522c379..0ea1b731d6 100644 --- a/flutter/lib/src/event_processor/flutter_enricher_event_processor.dart +++ b/flutter/lib/src/event_processor/flutter_enricher_event_processor.dart @@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:sentry/sentry.dart'; +import '../navigation/sentry_navigator_observer.dart'; import '../sentry_flutter_options.dart'; typedef WidgetBindingGetter = WidgetsBinding? Function(); @@ -47,6 +48,11 @@ class FlutterEnricherEventProcessor implements EventProcessor { app: _getApp(event.contexts.app), ); + final app = contexts.app; + if (app != null) { + contexts.app = _appWithCurrentRouteViewName(app); + } + // Flutter has a lot of Accessibility Settings available and exposes them contexts['accessibility'] = _getAccessibilityContext(); @@ -101,7 +107,9 @@ class FlutterEnricherEventProcessor implements EventProcessor { } SentryCulture _getCulture(SentryCulture? culture) { - final languageTag = _window?.locale.toLanguageTag(); + final windowLanguageTag = _window?.locale.toLanguageTag(); + final screenLocale = _retrieveWidgetLocale(_options.navigatorKey); + final languageTag = screenLocale?.toLanguageTag() ?? windowLanguageTag; // Future enhancement: // _window?.locales @@ -126,24 +134,26 @@ class FlutterEnricherEventProcessor implements EventProcessor { // ignore: deprecated_member_use final hasRenderView = _widgetsBinding?.renderViewElement != null; + final renderer = _options.rendererWrapper.getRenderer()?.name; + return { 'has_render_view': hasRenderView.toString(), if (tempDebugBrightnessOverride != null) - 'debug_brightness_override': describeEnum(tempDebugBrightnessOverride), + 'debug_brightness_override': tempDebugBrightnessOverride.name, if (debugPlatformOverride != null) - 'debug_default_target_platform_override': - describeEnum(debugPlatformOverride), + 'debug_default_target_platform_override': debugPlatformOverride.name, if (initialLifecycleState != null && initialLifecycleState.isNotEmpty) 'initial_lifecycle_state': initialLifecycleState, if (defaultRouteName != null && defaultRouteName.isNotEmpty) 'default_route_name': defaultRouteName, if (currentLifecycle != null) - 'current_lifecycle_state': describeEnum(currentLifecycle), + 'current_lifecycle_state': currentLifecycle.name, // Seems to always return false. // Also always fails in tests. // See https://github.com/flutter/flutter/issues/83919 // 'window_is_visible': _window.viewConfiguration.visible, - 'renderer': _options.rendererWrapper.getRenderer().name, + if (renderer != null) 'renderer': renderer, + if (_appFlavor != null) 'appFlavor': _appFlavor!, }; } @@ -237,4 +247,30 @@ class FlutterEnricherEventProcessor implements EventProcessor { inForeground: inForeground, ); } + + SentryApp _appWithCurrentRouteViewName(SentryApp app) { + final currentRouteName = SentryNavigatorObserver.currentRouteName; + if (currentRouteName != null) { + final viewNames = app.viewNames ?? []; + viewNames.add(currentRouteName); + return app.copyWith(viewNames: viewNames); + } else { + return app; + } + } + + Locale? _retrieveWidgetLocale(GlobalKey? navigatorKey) { + final BuildContext? context = navigatorKey?.currentContext; + if (context != null) { + return Localizations.maybeLocaleOf(context); + } + return null; + } } + +/// Copied from https://api.flutter.dev/flutter/services/appFlavor-constant.html +/// As soon as Flutter 3.16 is the minimal supported version of Sentry, this +/// can be replaced with the property from the link above. +const String? _appFlavor = String.fromEnvironment('FLUTTER_APP_FLAVOR') != '' + ? String.fromEnvironment('FLUTTER_APP_FLAVOR') + : null; diff --git a/flutter/lib/src/event_processor/native_app_start_event_processor.dart b/flutter/lib/src/event_processor/native_app_start_event_processor.dart index 0127f36d5a..58ee8fa824 100644 --- a/flutter/lib/src/event_processor/native_app_start_event_processor.dart +++ b/flutter/lib/src/event_processor/native_app_start_event_processor.dart @@ -2,8 +2,7 @@ import 'dart:async'; import 'package:sentry/sentry.dart'; -import '../sentry_native.dart'; -import '../sentry_native_channel.dart'; +import '../native/sentry_native.dart'; /// EventProcessor that enriches [SentryTransaction] objects with app start /// measurement. diff --git a/flutter/lib/src/event_processor/screenshot_event_processor.dart b/flutter/lib/src/event_processor/screenshot_event_processor.dart index 8a68fed1c1..8981afe7b1 100644 --- a/flutter/lib/src/event_processor/screenshot_event_processor.dart +++ b/flutter/lib/src/event_processor/screenshot_event_processor.dart @@ -8,6 +8,7 @@ import '../screenshot/sentry_screenshot_widget.dart'; import '../sentry_flutter_options.dart'; import 'package:flutter/rendering.dart'; import '../renderer/renderer.dart'; +import 'package:flutter/widgets.dart' as widget; class ScreenshotEventProcessor implements EventProcessor { final SentryFlutterOptions _options; @@ -29,12 +30,49 @@ class ScreenshotEventProcessor implements EventProcessor { _hasSentryScreenshotWidget) { return event; } + final beforeScreenshot = _options.beforeScreenshot; + if (beforeScreenshot != null) { + try { + final result = beforeScreenshot(event, hint: hint); + bool takeScreenshot; + if (result is Future) { + takeScreenshot = await result; + } else { + takeScreenshot = result; + } + if (!takeScreenshot) { + return event; + } + } catch (exception, stackTrace) { + _options.logger( + SentryLevel.error, + 'The beforeScreenshot callback threw an exception', + exception: exception, + stackTrace: stackTrace, + ); + // ignore: invalid_use_of_internal_member + if (_options.automatedTestMode) { + rethrow; + } + } + } final renderer = _options.rendererWrapper.getRenderer(); - if (renderer != FlutterRenderer.skia && + + if (_options.platformChecker.isWeb && renderer != FlutterRenderer.canvasKit) { + _options.logger( + SentryLevel.debug, + 'Cannot take screenshot with ${renderer?.name} renderer.', + ); + return event; + } + + if (_options.attachScreenshotOnlyWhenResumed && + widget.WidgetsBinding.instance.lifecycleState != + AppLifecycleState.resumed) { _options.logger(SentryLevel.debug, - 'Cannot take screenshot with ${_options.rendererWrapper.getRenderer().name} renderer.'); + 'Only attaching screenshots when application state is resumed.'); return event; } diff --git a/flutter/lib/src/flutter_sentry_attachment.dart b/flutter/lib/src/flutter_sentry_attachment.dart index 83b75c20bd..2e8d57927a 100644 --- a/flutter/lib/src/flutter_sentry_attachment.dart +++ b/flutter/lib/src/flutter_sentry_attachment.dart @@ -16,8 +16,8 @@ class FlutterSentryAttachment extends SentryAttachment { String? filename, AssetBundle? bundle, String? type, - String? contentType, - bool? addToTransactions, + super.contentType, + super.addToTransactions, }) : super.fromLoader( loader: () async { final data = await (bundle ?? rootBundle).load(key); @@ -28,7 +28,5 @@ class FlutterSentryAttachment extends SentryAttachment { ? Uri.parse(key).pathSegments.last : 'unknown'), attachmentType: type, - contentType: contentType, - addToTransactions: addToTransactions, ); } diff --git a/flutter/lib/src/integrations/connectivity/connectivity_integration.dart b/flutter/lib/src/integrations/connectivity/connectivity_integration.dart new file mode 100644 index 0000000000..c8d0b80c86 --- /dev/null +++ b/flutter/lib/src/integrations/connectivity/connectivity_integration.dart @@ -0,0 +1,36 @@ +import 'package:meta/meta.dart'; +import '../../../sentry_flutter.dart'; +import 'connectivity_provider.dart'; + +class ConnectivityIntegration extends Integration { + Hub? _hub; + ConnectivityProvider? _connectivityProvider; + + @override + void call(Hub hub, SentryFlutterOptions options) { + _hub = hub; + _connectivityProvider = ConnectivityProvider(); + _connectivityProvider?.listen((connectivity) { + addBreadcrumb(connectivity); + }); + options.sdk.addIntegration('connectivityIntegration'); + } + + @override + void close() { + _hub = null; + _connectivityProvider?.cancel(); + } + + @internal + @visibleForTesting + void addBreadcrumb(String connectivity) { + _hub?.addBreadcrumb( + Breadcrumb( + category: 'device.connectivity', + level: SentryLevel.info, + type: 'connectivity', + data: {'connectivity': connectivity}), + ); + } +} diff --git a/flutter/lib/src/integrations/connectivity/connectivity_provider.dart b/flutter/lib/src/integrations/connectivity/connectivity_provider.dart new file mode 100644 index 0000000000..30095dda0d --- /dev/null +++ b/flutter/lib/src/integrations/connectivity/connectivity_provider.dart @@ -0,0 +1,9 @@ +import 'noop_connectivity_provider.dart' + if (dart.library.html) 'web_connectivity_provider.dart'; + +abstract class ConnectivityProvider { + factory ConnectivityProvider() => connectivityProvider(); + + void listen(void Function(String connectivity) onChange); + void cancel(); +} diff --git a/flutter/lib/src/integrations/connectivity/noop_connectivity_provider.dart b/flutter/lib/src/integrations/connectivity/noop_connectivity_provider.dart new file mode 100644 index 0000000000..4276448b7a --- /dev/null +++ b/flutter/lib/src/integrations/connectivity/noop_connectivity_provider.dart @@ -0,0 +1,17 @@ +import 'connectivity_provider.dart'; + +ConnectivityProvider connectivityProvider() { + return NoOpConnectivityProvider(); +} + +class NoOpConnectivityProvider implements ConnectivityProvider { + @override + void listen(void Function(String connectivity) onChange) { + // NoOp + } + + @override + void cancel() { + // NoOp + } +} diff --git a/flutter/lib/src/integrations/connectivity/web_connectivity_provider.dart b/flutter/lib/src/integrations/connectivity/web_connectivity_provider.dart new file mode 100644 index 0000000000..34d0e0ab42 --- /dev/null +++ b/flutter/lib/src/integrations/connectivity/web_connectivity_provider.dart @@ -0,0 +1,32 @@ +import 'dart:async'; +import 'dart:html' as html; + +import 'connectivity_provider.dart'; + +ConnectivityProvider connectivityProvider() { + return WebConnectivityProvider(); +} + +class WebConnectivityProvider implements ConnectivityProvider { + StreamSubscription? _onOnlineSub; + StreamSubscription? _onOfflineSub; + + @override + void listen(void Function(String connectivity) onChange) { + _onOnlineSub = html.window.onOnline.listen((_) { + onChange('wifi'); + }); + _onOfflineSub = html.window.onOffline.listen((_) { + onChange('none'); + }); + } + + @override + void cancel() { + _onOnlineSub?.cancel(); + _onOnlineSub = null; + + _onOfflineSub?.cancel(); + _onOfflineSub = null; + } +} diff --git a/flutter/lib/src/integrations/flutter_error_integration.dart b/flutter/lib/src/integrations/flutter_error_integration.dart index 03f8436bf9..c1a6d57a1d 100644 --- a/flutter/lib/src/integrations/flutter_error_integration.dart +++ b/flutter/lib/src/integrations/flutter_error_integration.dart @@ -60,7 +60,9 @@ class FlutterErrorIntegration implements Integration { var event = SentryEvent( throwable: throwableMechanism, - level: SentryLevel.fatal, + level: options.markAutomaticallyCollectedErrorsAsFatal + ? SentryLevel.fatal + : SentryLevel.error, contexts: flutterErrorDetails.isNotEmpty ? (Contexts()..['flutter_error_details'] = flutterErrorDetails) : null, diff --git a/flutter/lib/src/integrations/load_image_list_integration.dart b/flutter/lib/src/integrations/load_image_list_integration.dart index a06d60d839..ae08d93946 100644 --- a/flutter/lib/src/integrations/load_image_list_integration.dart +++ b/flutter/lib/src/integrations/load_image_list_integration.dart @@ -25,14 +25,25 @@ extension _NeedsSymbolication on SentryEvent { if (this is SentryTransaction) { return false; } - if (exceptions?.isNotEmpty == false) { - return false; - } - final frames = exceptions?.first.stackTrace?.frames; + final frames = _getStacktraceFrames(); if (frames == null) { return false; } - return frames.any((frame) => 'native' == frame.platform); + return frames.any((frame) => 'native' == frame?.platform); + } + + List? _getStacktraceFrames() { + if (exceptions?.isNotEmpty == true) { + return exceptions?.first.stackTrace?.frames; + } + if (threads?.isNotEmpty == true) { + var stacktraces = threads?.map((e) => e.stacktrace); + return stacktraces + ?.where((element) => element != null) + .expand((element) => element!.frames) + .toList(); + } + return null; } } diff --git a/flutter/lib/src/integrations/native_app_start_integration.dart b/flutter/lib/src/integrations/native_app_start_integration.dart index a47eb74717..47bf79dff4 100644 --- a/flutter/lib/src/integrations/native_app_start_integration.dart +++ b/flutter/lib/src/integrations/native_app_start_integration.dart @@ -2,7 +2,7 @@ import 'package:flutter/scheduler.dart'; import 'package:sentry/sentry.dart'; import '../sentry_flutter_options.dart'; -import '../sentry_native.dart'; +import '../native/sentry_native.dart'; import '../event_processor/native_app_start_event_processor.dart'; /// Integration which handles communication with native frameworks in order to diff --git a/flutter/lib/src/jvm/jvm_exception.dart b/flutter/lib/src/jvm/jvm_exception.dart index adaf71cac1..352092b1ed 100644 --- a/flutter/lib/src/jvm/jvm_exception.dart +++ b/flutter/lib/src/jvm/jvm_exception.dart @@ -256,8 +256,12 @@ class JvmException { frames.add(trimmed); } - final thisExceptionFrames = - thisException.map((e) => JvmFrame.parse(e)).toList(growable: false); + final thisExceptionFrames = thisException + // Sometimes stringified exceptions from the native side have + // empty lines. Discard those! + .where((line) => line.trim().isNotEmpty) + .map((e) => JvmFrame.parse(e)) + .toList(growable: false); final suppressedExceptions = supressed .map((e) => JvmException.parse(e.join(_newLine))) diff --git a/flutter/lib/src/native/cocoa/binding.dart b/flutter/lib/src/native/cocoa/binding.dart new file mode 100644 index 0000000000..41350a3a2c --- /dev/null +++ b/flutter/lib/src/native/cocoa/binding.dart @@ -0,0 +1,71894 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint +import 'dart:ffi' as ffi; +import 'package:ffi/ffi.dart' as pkg_ffi; + +/// Sentry Cocoa SDK FFI binding. +class SentryCocoa { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + SentryCocoa(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + SentryCocoa.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer _registerName1(String name) { + final cstr = name.toNativeUtf8(); + final sel = _sel_registerName(cstr.cast()); + pkg_ffi.calloc.free(cstr); + return sel; + } + + ffi.Pointer _sel_registerName( + ffi.Pointer str, + ) { + return __sel_registerName( + str, + ); + } + + late final __sel_registerNamePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sel_registerName'); + late final __sel_registerName = __sel_registerNamePtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _getClass1(String name) { + final cstr = name.toNativeUtf8(); + final clazz = _objc_getClass(cstr.cast()); + pkg_ffi.calloc.free(cstr); + if (clazz == ffi.nullptr) { + throw Exception('Failed to load Objective-C class: $name'); + } + return clazz; + } + + ffi.Pointer _objc_getClass( + ffi.Pointer str, + ) { + return __objc_getClass( + str, + ); + } + + late final __objc_getClassPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_getClass'); + late final __objc_getClass = __objc_getClassPtr + .asFunction Function(ffi.Pointer)>(); + + ffi.Pointer _objc_retain( + ffi.Pointer value, + ) { + return __objc_retain( + value, + ); + } + + late final __objc_retainPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('objc_retain'); + late final __objc_retain = __objc_retainPtr + .asFunction Function(ffi.Pointer)>(); + + void _objc_release( + ffi.Pointer value, + ) { + return __objc_release( + value, + ); + } + + late final __objc_releasePtr = + _lookup)>>( + 'objc_release'); + late final __objc_release = + __objc_releasePtr.asFunction)>(); + + late final _objc_releaseFinalizer2 = + ffi.NativeFinalizer(__objc_releasePtr.cast()); + late final _class_NSObject1 = _getClass1("NSObject"); + late final _sel_load1 = _registerName1("load"); + void _objc_msgSend_1( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1( + obj, + sel, + ); + } + + late final __objc_msgSend_1Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1 = __objc_msgSend_1Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initialize1 = _registerName1("initialize"); + late final _sel_init1 = _registerName1("init"); + instancetype _objc_msgSend_2( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_2( + obj, + sel, + ); + } + + late final __objc_msgSend_2Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_2 = __objc_msgSend_2Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_new1 = _registerName1("new"); + late final _sel_allocWithZone_1 = _registerName1("allocWithZone:"); + instancetype _objc_msgSend_3( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_3( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_3Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_3 = __objc_msgSend_3Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final _sel_alloc1 = _registerName1("alloc"); + late final _sel_dealloc1 = _registerName1("dealloc"); + late final _sel_finalize1 = _registerName1("finalize"); + late final _sel_copy1 = _registerName1("copy"); + late final _sel_mutableCopy1 = _registerName1("mutableCopy"); + late final _sel_copyWithZone_1 = _registerName1("copyWithZone:"); + late final _sel_mutableCopyWithZone_1 = + _registerName1("mutableCopyWithZone:"); + late final _sel_instancesRespondToSelector_1 = + _registerName1("instancesRespondToSelector:"); + bool _objc_msgSend_4( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_4( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_4Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_4 = __objc_msgSend_4Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + bool _objc_msgSend_0( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer clazz, + ) { + return __objc_msgSend_0( + obj, + sel, + clazz, + ); + } + + late final __objc_msgSend_0Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_0 = __objc_msgSend_0Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isKindOfClass_1 = _registerName1("isKindOfClass:"); + late final _class_Protocol1 = _getClass1("Protocol"); + late final _sel_conformsToProtocol_1 = _registerName1("conformsToProtocol:"); + bool _objc_msgSend_5( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protocol, + ) { + return __objc_msgSend_5( + obj, + sel, + protocol, + ); + } + + late final __objc_msgSend_5Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_5 = __objc_msgSend_5Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_methodForSelector_1 = _registerName1("methodForSelector:"); + ffi.Pointer> _objc_msgSend_6( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_6( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_6Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_6 = __objc_msgSend_6Ptr.asFunction< + ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_instanceMethodForSelector_1 = + _registerName1("instanceMethodForSelector:"); + late final _sel_doesNotRecognizeSelector_1 = + _registerName1("doesNotRecognizeSelector:"); + void _objc_msgSend_7( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_7( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_7Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_7 = __objc_msgSend_7Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_forwardingTargetForSelector_1 = + _registerName1("forwardingTargetForSelector:"); + ffi.Pointer _objc_msgSend_8( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_8( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_8Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_8 = __objc_msgSend_8Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSInvocation1 = _getClass1("NSInvocation"); + late final _class_NSMethodSignature1 = _getClass1("NSMethodSignature"); + late final _sel_signatureWithObjCTypes_1 = + _registerName1("signatureWithObjCTypes:"); + ffi.Pointer _objc_msgSend_9( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer types, + ) { + return __objc_msgSend_9( + obj, + sel, + types, + ); + } + + late final __objc_msgSend_9Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberOfArguments1 = _registerName1("numberOfArguments"); + int _objc_msgSend_10( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_10( + obj, + sel, + ); + } + + late final __objc_msgSend_10Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_10 = __objc_msgSend_10Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getArgumentTypeAtIndex_1 = + _registerName1("getArgumentTypeAtIndex:"); + ffi.Pointer _objc_msgSend_11( + ffi.Pointer obj, + ffi.Pointer sel, + int idx, + ) { + return __objc_msgSend_11( + obj, + sel, + idx, + ); + } + + late final __objc_msgSend_11Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_frameLength1 = _registerName1("frameLength"); + late final _sel_isOneway1 = _registerName1("isOneway"); + bool _objc_msgSend_12( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_12( + obj, + sel, + ); + } + + late final __objc_msgSend_12Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodReturnType1 = _registerName1("methodReturnType"); + ffi.Pointer _objc_msgSend_13( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_13( + obj, + sel, + ); + } + + late final __objc_msgSend_13Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodReturnLength1 = _registerName1("methodReturnLength"); + late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_1 = + _registerName1( + "cancelPreviousPerformRequestsWithTarget:selector:object:"); + void _objc_msgSend_14( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTarget, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + ) { + return __objc_msgSend_14( + obj, + sel, + aTarget, + aSelector, + anArgument, + ); + } + + late final __objc_msgSend_14Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cancelPreviousPerformRequestsWithTarget_1 = + _registerName1("cancelPreviousPerformRequestsWithTarget:"); + void _objc_msgSend_15( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTarget, + ) { + return __objc_msgSend_15( + obj, + sel, + aTarget, + ); + } + + late final __objc_msgSend_15Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_accessInstanceVariablesDirectly1 = + _registerName1("accessInstanceVariablesDirectly"); + late final _sel_useStoredAccessor1 = _registerName1("useStoredAccessor"); + late final _class_NSSet1 = _getClass1("NSSet"); + late final _sel_count1 = _registerName1("count"); + late final _sel_member_1 = _registerName1("member:"); + ffi.Pointer _objc_msgSend_16( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ) { + return __objc_msgSend_16( + obj, + sel, + object, + ); + } + + late final __objc_msgSend_16Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSEnumerator1 = _getClass1("NSEnumerator"); + late final _sel_nextObject1 = _registerName1("nextObject"); + late final _sel_allObjects1 = _registerName1("allObjects"); + late final _class_NSString1 = _getClass1("NSString"); + late final _sel_length1 = _registerName1("length"); + late final _sel_characterAtIndex_1 = _registerName1("characterAtIndex:"); + int _objc_msgSend_17( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_17( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_17Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedShort Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSCoder1 = _getClass1("NSCoder"); + late final _sel_encodeValueOfObjCType_at_1 = + _registerName1("encodeValueOfObjCType:at:"); + void _objc_msgSend_18( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + ffi.Pointer addr, + ) { + return __objc_msgSend_18( + obj, + sel, + type, + addr, + ); + } + + late final __objc_msgSend_18Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_18 = __objc_msgSend_18Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSData1 = _getClass1("NSData"); + late final _sel_bytes1 = _registerName1("bytes"); + ffi.Pointer _objc_msgSend_19( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_19( + obj, + sel, + ); + } + + late final __objc_msgSend_19Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_description1 = _registerName1("description"); + ffi.Pointer _objc_msgSend_20( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_20( + obj, + sel, + ); + } + + late final __objc_msgSend_20Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getBytes_length_1 = _registerName1("getBytes:length:"); + void _objc_msgSend_21( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int length, + ) { + return __objc_msgSend_21( + obj, + sel, + buffer, + length, + ); + } + + late final __objc_msgSend_21Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_21 = __objc_msgSend_21Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_getBytes_range_1 = _registerName1("getBytes:range:"); + void _objc_msgSend_22( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + _NSRange range, + ) { + return __objc_msgSend_22( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_22Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + late final _sel_isEqualToData_1 = _registerName1("isEqualToData:"); + bool _objc_msgSend_23( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_23( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_23Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_23 = __objc_msgSend_23Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_subdataWithRange_1 = _registerName1("subdataWithRange:"); + ffi.Pointer _objc_msgSend_24( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_24( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_24Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_writeToFile_atomically_1 = + _registerName1("writeToFile:atomically:"); + bool _objc_msgSend_25( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + ) { + return __objc_msgSend_25( + obj, + sel, + path, + useAuxiliaryFile, + ); + } + + late final __objc_msgSend_25Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _class_NSURL1 = _getClass1("NSURL"); + late final _sel_initWithScheme_host_path_1 = + _registerName1("initWithScheme:host:path:"); + instancetype _objc_msgSend_26( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer scheme, + ffi.Pointer host, + ffi.Pointer path, + ) { + return __objc_msgSend_26( + obj, + sel, + scheme, + host, + path, + ); + } + + late final __objc_msgSend_26Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_isDirectory_relativeToURL_1 = + _registerName1("initFileURLWithPath:isDirectory:relativeToURL:"); + instancetype _objc_msgSend_27( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_27( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_27Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_relativeToURL_1 = + _registerName1("initFileURLWithPath:relativeToURL:"); + instancetype _objc_msgSend_28( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_28( + obj, + sel, + path, + baseURL, + ); + } + + late final __objc_msgSend_28Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_28 = __objc_msgSend_28Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initFileURLWithPath_isDirectory_1 = + _registerName1("initFileURLWithPath:isDirectory:"); + instancetype _objc_msgSend_29( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ) { + return __objc_msgSend_29( + obj, + sel, + path, + isDir, + ); + } + + late final __objc_msgSend_29Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initFileURLWithPath_1 = + _registerName1("initFileURLWithPath:"); + instancetype _objc_msgSend_30( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_30( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_30Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_isDirectory_relativeToURL_1 = + _registerName1("fileURLWithPath:isDirectory:relativeToURL:"); + ffi.Pointer _objc_msgSend_31( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_31( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_31Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_relativeToURL_1 = + _registerName1("fileURLWithPath:relativeToURL:"); + ffi.Pointer _objc_msgSend_32( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_32( + obj, + sel, + path, + baseURL, + ); + } + + late final __objc_msgSend_32Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileURLWithPath_isDirectory_1 = + _registerName1("fileURLWithPath:isDirectory:"); + ffi.Pointer _objc_msgSend_33( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ) { + return __objc_msgSend_33( + obj, + sel, + path, + isDir, + ); + } + + late final __objc_msgSend_33Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_fileURLWithPath_1 = _registerName1("fileURLWithPath:"); + ffi.Pointer _objc_msgSend_34( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_34( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_34Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_34 = __objc_msgSend_34Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = + _registerName1( + "initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); + instancetype _objc_msgSend_35( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_35( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_35Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, ffi.Pointer)>(); + + late final _sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = + _registerName1( + "fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); + ffi.Pointer _objc_msgSend_36( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool isDir, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_36( + obj, + sel, + path, + isDir, + baseURL, + ); + } + + late final __objc_msgSend_36Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_initWithString_1 = _registerName1("initWithString:"); + late final _sel_initWithString_relativeToURL_1 = + _registerName1("initWithString:relativeToURL:"); + late final _sel_URLWithString_1 = _registerName1("URLWithString:"); + late final _sel_URLWithString_relativeToURL_1 = + _registerName1("URLWithString:relativeToURL:"); + late final _sel_initWithDataRepresentation_relativeToURL_1 = + _registerName1("initWithDataRepresentation:relativeToURL:"); + instancetype _objc_msgSend_37( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_37( + obj, + sel, + data, + baseURL, + ); + } + + late final __objc_msgSend_37Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_URLWithDataRepresentation_relativeToURL_1 = + _registerName1("URLWithDataRepresentation:relativeToURL:"); + ffi.Pointer _objc_msgSend_38( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer baseURL, + ) { + return __objc_msgSend_38( + obj, + sel, + data, + baseURL, + ); + } + + late final __objc_msgSend_38Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_38 = __objc_msgSend_38Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1 = + _registerName1("initAbsoluteURLWithDataRepresentation:relativeToURL:"); + late final _sel_absoluteURLWithDataRepresentation_relativeToURL_1 = + _registerName1("absoluteURLWithDataRepresentation:relativeToURL:"); + late final _sel_dataRepresentation1 = _registerName1("dataRepresentation"); + ffi.Pointer _objc_msgSend_39( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_39( + obj, + sel, + ); + } + + late final __objc_msgSend_39Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_absoluteString1 = _registerName1("absoluteString"); + late final _sel_relativeString1 = _registerName1("relativeString"); + late final _sel_baseURL1 = _registerName1("baseURL"); + ffi.Pointer _objc_msgSend_40( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_40( + obj, + sel, + ); + } + + late final __objc_msgSend_40Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_absoluteURL1 = _registerName1("absoluteURL"); + late final _sel_scheme1 = _registerName1("scheme"); + late final _sel_resourceSpecifier1 = _registerName1("resourceSpecifier"); + late final _sel_host1 = _registerName1("host"); + late final _class_NSNumber1 = _getClass1("NSNumber"); + late final _class_NSValue1 = _getClass1("NSValue"); + late final _sel_getValue_size_1 = _registerName1("getValue:size:"); + late final _sel_objCType1 = _registerName1("objCType"); + late final _sel_initWithBytes_objCType_1 = + _registerName1("initWithBytes:objCType:"); + instancetype _objc_msgSend_41( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_41( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_41Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithCoder_1 = _registerName1("initWithCoder:"); + instancetype _objc_msgSend_42( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_42( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_42Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_42 = __objc_msgSend_42Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithBytes_objCType_1 = + _registerName1("valueWithBytes:objCType:"); + ffi.Pointer _objc_msgSend_43( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer type, + ) { + return __objc_msgSend_43( + obj, + sel, + value, + type, + ); + } + + late final __objc_msgSend_43Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_43 = __objc_msgSend_43Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_value_withObjCType_1 = _registerName1("value:withObjCType:"); + late final _sel_valueWithNonretainedObject_1 = + _registerName1("valueWithNonretainedObject:"); + ffi.Pointer _objc_msgSend_44( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_44( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_44Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_44 = __objc_msgSend_44Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_nonretainedObjectValue1 = + _registerName1("nonretainedObjectValue"); + late final _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); + ffi.Pointer _objc_msgSend_45( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pointer, + ) { + return __objc_msgSend_45( + obj, + sel, + pointer, + ); + } + + late final __objc_msgSend_45Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerValue1 = _registerName1("pointerValue"); + late final _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); + bool _objc_msgSend_46( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_46( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_46Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getValue_1 = _registerName1("getValue:"); + void _objc_msgSend_47( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_47( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_47Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_47 = __objc_msgSend_47Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithRange_1 = _registerName1("valueWithRange:"); + ffi.Pointer _objc_msgSend_48( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_48( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_48Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_rangeValue1 = _registerName1("rangeValue"); + void _objc_msgSend_49( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_49( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_49Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_valueWithPoint_1 = _registerName1("valueWithPoint:"); + ffi.Pointer _objc_msgSend_50( + ffi.Pointer obj, + ffi.Pointer sel, + CGPoint point, + ) { + return __objc_msgSend_50( + obj, + sel, + point, + ); + } + + late final __objc_msgSend_50Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, CGPoint)>>('objc_msgSend'); + late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, CGPoint)>(); + + late final _sel_valueWithSize_1 = _registerName1("valueWithSize:"); + ffi.Pointer _objc_msgSend_51( + ffi.Pointer obj, + ffi.Pointer sel, + CGSize size, + ) { + return __objc_msgSend_51( + obj, + sel, + size, + ); + } + + late final __objc_msgSend_51Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, CGSize)>>('objc_msgSend'); + late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, CGSize)>(); + + late final _sel_valueWithRect_1 = _registerName1("valueWithRect:"); + ffi.Pointer _objc_msgSend_52( + ffi.Pointer obj, + ffi.Pointer sel, + CGRect rect, + ) { + return __objc_msgSend_52( + obj, + sel, + rect, + ); + } + + late final __objc_msgSend_52Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, CGRect)>>('objc_msgSend'); + late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, CGRect)>(); + + late final _sel_valueWithEdgeInsets_1 = + _registerName1("valueWithEdgeInsets:"); + ffi.Pointer _objc_msgSend_53( + ffi.Pointer obj, + ffi.Pointer sel, + NSEdgeInsets insets, + ) { + return __objc_msgSend_53( + obj, + sel, + insets, + ); + } + + late final __objc_msgSend_53Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSEdgeInsets)>>('objc_msgSend'); + late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, NSEdgeInsets)>(); + + late final _sel_pointValue1 = _registerName1("pointValue"); + void _objc_msgSend_54( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sizeValue1 = _registerName1("sizeValue"); + void _objc_msgSend_55( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_55( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_55Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rectValue1 = _registerName1("rectValue"); + void _objc_msgSend_56( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_56( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_56Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_edgeInsetsValue1 = _registerName1("edgeInsetsValue"); + void _objc_msgSend_57( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_57( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_57Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keyPathsForValuesAffectingValueForKey_1 = + _registerName1("keyPathsForValuesAffectingValueForKey:"); + ffi.Pointer _objc_msgSend_58( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_58( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_58Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_58 = __objc_msgSend_58Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_automaticallyNotifiesObserversForKey_1 = + _registerName1("automaticallyNotifiesObserversForKey:"); + bool _objc_msgSend_59( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_59( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSArray1 = _getClass1("NSArray"); + late final _sel_objectAtIndex_1 = _registerName1("objectAtIndex:"); + ffi.Pointer _objc_msgSend_60( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_60( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithObjects_count_1 = + _registerName1("initWithObjects:count:"); + instancetype _objc_msgSend_61( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int cnt, + ) { + return __objc_msgSend_61( + obj, + sel, + objects, + cnt, + ); + } + + late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final _sel_arrayByAddingObject_1 = + _registerName1("arrayByAddingObject:"); + ffi.Pointer _objc_msgSend_62( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_62( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_arrayByAddingObjectsFromArray_1 = + _registerName1("arrayByAddingObjectsFromArray:"); + ffi.Pointer _objc_msgSend_63( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_63( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_63Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_componentsJoinedByString_1 = + _registerName1("componentsJoinedByString:"); + ffi.Pointer _objc_msgSend_64( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer separator, + ) { + return __objc_msgSend_64( + obj, + sel, + separator, + ); + } + + late final __objc_msgSend_64Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_containsObject_1 = _registerName1("containsObject:"); + late final _sel_descriptionWithLocale_1 = + _registerName1("descriptionWithLocale:"); + ffi.Pointer _objc_msgSend_65( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_65( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_65Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptionWithLocale_indent_1 = + _registerName1("descriptionWithLocale:indent:"); + ffi.Pointer _objc_msgSend_66( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + int level, + ) { + return __objc_msgSend_66( + obj, + sel, + locale, + level, + ); + } + + late final __objc_msgSend_66Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_firstObjectCommonWithArray_1 = + _registerName1("firstObjectCommonWithArray:"); + ffi.Pointer _objc_msgSend_67( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_67( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_67Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getObjects_range_1 = _registerName1("getObjects:range:"); + void _objc_msgSend_68( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + _NSRange range, + ) { + return __objc_msgSend_68( + obj, + sel, + objects, + range, + ); + } + + late final __objc_msgSend_68Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, _NSRange)>(); + + late final _sel_indexOfObject_1 = _registerName1("indexOfObject:"); + int _objc_msgSend_69( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_69( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_69Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_indexOfObject_inRange_1 = + _registerName1("indexOfObject:inRange:"); + int _objc_msgSend_70( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + _NSRange range, + ) { + return __objc_msgSend_70( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_70Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + late final _sel_indexOfObjectIdenticalTo_1 = + _registerName1("indexOfObjectIdenticalTo:"); + late final _sel_indexOfObjectIdenticalTo_inRange_1 = + _registerName1("indexOfObjectIdenticalTo:inRange:"); + late final _sel_isEqualToArray_1 = _registerName1("isEqualToArray:"); + bool _objc_msgSend_71( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_71( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_71Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_firstObject1 = _registerName1("firstObject"); + late final _sel_lastObject1 = _registerName1("lastObject"); + late final _sel_objectEnumerator1 = _registerName1("objectEnumerator"); + ffi.Pointer _objc_msgSend_72( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_72( + obj, + sel, + ); + } + + late final __objc_msgSend_72Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_reverseObjectEnumerator1 = + _registerName1("reverseObjectEnumerator"); + late final _sel_sortedArrayHint1 = _registerName1("sortedArrayHint"); + late final _sel_sortedArrayUsingFunction_context_1 = + _registerName1("sortedArrayUsingFunction:context:"); + ffi.Pointer _objc_msgSend_73( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + ) { + return __objc_msgSend_73( + obj, + sel, + comparator, + context, + ); + } + + late final __objc_msgSend_73Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final _sel_sortedArrayUsingFunction_context_hint_1 = + _registerName1("sortedArrayUsingFunction:context:hint:"); + ffi.Pointer _objc_msgSend_74( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + ffi.Pointer hint, + ) { + return __objc_msgSend_74( + obj, + sel, + comparator, + context, + hint, + ); + } + + late final __objc_msgSend_74Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sortedArrayUsingSelector_1 = + _registerName1("sortedArrayUsingSelector:"); + ffi.Pointer _objc_msgSend_75( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comparator, + ) { + return __objc_msgSend_75( + obj, + sel, + comparator, + ); + } + + late final __objc_msgSend_75Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_subarrayWithRange_1 = _registerName1("subarrayWithRange:"); + ffi.Pointer _objc_msgSend_76( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_76( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_76Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _class_NSError1 = _getClass1("NSError"); + late final _sel_initWithDomain_code_userInfo_1 = + _registerName1("initWithDomain:code:userInfo:"); + instancetype _objc_msgSend_77( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer domain, + int code, + ffi.Pointer dict, + ) { + return __objc_msgSend_77( + obj, + sel, + domain, + code, + dict, + ); + } + + late final __objc_msgSend_77Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_errorWithDomain_code_userInfo_1 = + _registerName1("errorWithDomain:code:userInfo:"); + late final _sel_domain1 = _registerName1("domain"); + late final _sel_code1 = _registerName1("code"); + int _objc_msgSend_78( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_78( + obj, + sel, + ); + } + + late final __objc_msgSend_78Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_userInfo1 = _registerName1("userInfo"); + late final _sel_localizedDescription1 = + _registerName1("localizedDescription"); + late final _sel_localizedFailureReason1 = + _registerName1("localizedFailureReason"); + late final _sel_localizedRecoverySuggestion1 = + _registerName1("localizedRecoverySuggestion"); + late final _sel_localizedRecoveryOptions1 = + _registerName1("localizedRecoveryOptions"); + ffi.Pointer _objc_msgSend_79( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_79( + obj, + sel, + ); + } + + late final __objc_msgSend_79Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_recoveryAttempter1 = _registerName1("recoveryAttempter"); + late final _sel_helpAnchor1 = _registerName1("helpAnchor"); + late final _sel_underlyingErrors1 = _registerName1("underlyingErrors"); + ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { + final d = + pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); + d.ref.reserved = 0; + d.ref.size = ffi.sizeOf<_ObjCBlock>(); + d.ref.copy_helper = ffi.nullptr; + d.ref.dispose_helper = ffi.nullptr; + d.ref.signature = ffi.nullptr; + return d; + } + + late final _objc_block_desc1 = _newBlockDesc1(); + late final _objc_concrete_global_block1 = + _lookup('_NSConcreteGlobalBlock'); + ffi.Pointer<_ObjCBlock> _newBlock1( + ffi.Pointer invoke, ffi.Pointer target) { + final b = pkg_ffi.calloc.allocate<_ObjCBlock>(ffi.sizeOf<_ObjCBlock>()); + b.ref.isa = _objc_concrete_global_block1; + b.ref.flags = 0; + b.ref.reserved = 0; + b.ref.invoke = invoke; + b.ref.target = target; + b.ref.descriptor = _objc_block_desc1; + final copy = _Block_copy(b.cast()).cast<_ObjCBlock>(); + pkg_ffi.calloc.free(b); + return copy; + } + + ffi.Pointer _Block_copy( + ffi.Pointer value, + ) { + return __Block_copy( + value, + ); + } + + late final __Block_copyPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('_Block_copy'); + late final __Block_copy = __Block_copyPtr + .asFunction Function(ffi.Pointer)>(); + + void _Block_release( + ffi.Pointer value, + ) { + return __Block_release( + value, + ); + } + + late final __Block_releasePtr = + _lookup)>>( + '_Block_release'); + late final __Block_release = + __Block_releasePtr.asFunction)>(); + + late final _objc_releaseFinalizer11 = + ffi.NativeFinalizer(__Block_releasePtr.cast()); + late final _sel_setUserInfoValueProviderForDomain_provider_1 = + _registerName1("setUserInfoValueProviderForDomain:provider:"); + void _objc_msgSend_80( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer errorDomain, + ffi.Pointer<_ObjCBlock> provider, + ) { + return __objc_msgSend_80( + obj, + sel, + errorDomain, + provider, + ); + } + + late final __objc_msgSend_80Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_userInfoValueProviderForDomain_1 = + _registerName1("userInfoValueProviderForDomain:"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_81( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer err, + ffi.Pointer userInfoKey, + ffi.Pointer errorDomain, + ) { + return __objc_msgSend_81( + obj, + sel, + err, + userInfoKey, + errorDomain, + ); + } + + late final __objc_msgSend_81Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setKeys_triggerChangeNotificationsForDependentKey_1 = + _registerName1("setKeys:triggerChangeNotificationsForDependentKey:"); + void _objc_msgSend_82( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer dependentKey, + ) { + return __objc_msgSend_82( + obj, + sel, + keys, + dependentKey, + ); + } + + late final __objc_msgSend_82Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classFallbacksForKeyedArchiver1 = + _registerName1("classFallbacksForKeyedArchiver"); + late final _sel_classForKeyedUnarchiver1 = + _registerName1("classForKeyedUnarchiver"); + late final _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); + bool _objc_msgSend_83( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_83( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_83Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_makeObjectsPerformSelector_1 = + _registerName1("makeObjectsPerformSelector:"); + late final _sel_makeObjectsPerformSelector_withObject_1 = + _registerName1("makeObjectsPerformSelector:withObject:"); + void _objc_msgSend_84( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer argument, + ) { + return __objc_msgSend_84( + obj, + sel, + aSelector, + argument, + ); + } + + late final __objc_msgSend_84Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSIndexSet1 = _getClass1("NSIndexSet"); + late final _sel_indexSet1 = _registerName1("indexSet"); + late final _sel_indexSetWithIndex_1 = _registerName1("indexSetWithIndex:"); + late final _sel_indexSetWithIndexesInRange_1 = + _registerName1("indexSetWithIndexesInRange:"); + instancetype _objc_msgSend_85( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_85( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_85Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_initWithIndexesInRange_1 = + _registerName1("initWithIndexesInRange:"); + late final _sel_initWithIndexSet_1 = _registerName1("initWithIndexSet:"); + instancetype _objc_msgSend_86( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_86( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_86Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithIndex_1 = _registerName1("initWithIndex:"); + late final _sel_isEqualToIndexSet_1 = _registerName1("isEqualToIndexSet:"); + bool _objc_msgSend_87( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexSet, + ) { + return __objc_msgSend_87( + obj, + sel, + indexSet, + ); + } + + late final __objc_msgSend_87Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_firstIndex1 = _registerName1("firstIndex"); + late final _sel_lastIndex1 = _registerName1("lastIndex"); + late final _sel_indexGreaterThanIndex_1 = + _registerName1("indexGreaterThanIndex:"); + int _objc_msgSend_88( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_88( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_88Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_indexLessThanIndex_1 = _registerName1("indexLessThanIndex:"); + late final _sel_indexGreaterThanOrEqualToIndex_1 = + _registerName1("indexGreaterThanOrEqualToIndex:"); + late final _sel_indexLessThanOrEqualToIndex_1 = + _registerName1("indexLessThanOrEqualToIndex:"); + late final _sel_getIndexes_maxCount_inIndexRange_1 = + _registerName1("getIndexes:maxCount:inIndexRange:"); + int _objc_msgSend_89( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexBuffer, + int bufferSize, + ffi.Pointer<_NSRange> range, + ) { + return __objc_msgSend_89( + obj, + sel, + indexBuffer, + bufferSize, + range, + ); + } + + late final __objc_msgSend_89Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>)>>('objc_msgSend'); + late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_NSRange>)>(); + + late final _sel_countOfIndexesInRange_1 = + _registerName1("countOfIndexesInRange:"); + int _objc_msgSend_90( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_90( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_90Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_containsIndex_1 = _registerName1("containsIndex:"); + bool _objc_msgSend_91( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_91( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_91Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_containsIndexesInRange_1 = + _registerName1("containsIndexesInRange:"); + bool _objc_msgSend_92( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_92( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_92Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_containsIndexes_1 = _registerName1("containsIndexes:"); + late final _sel_intersectsIndexesInRange_1 = + _registerName1("intersectsIndexesInRange:"); + late final _sel_enumerateIndexesUsingBlock_1 = + _registerName1("enumerateIndexesUsingBlock:"); + void _objc_msgSend_93( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_93( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_93Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateIndexesWithOptions_usingBlock_1 = + _registerName1("enumerateIndexesWithOptions:usingBlock:"); + void _objc_msgSend_94( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_94( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_94Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateIndexesInRange_options_usingBlock_1 = + _registerName1("enumerateIndexesInRange:options:usingBlock:"); + void _objc_msgSend_95( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_95( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_95Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_95 = __objc_msgSend_95Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); + int _objc_msgSend_96( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_96( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_96Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexWithOptions_passingTest_1 = + _registerName1("indexWithOptions:passingTest:"); + int _objc_msgSend_97( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_97( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_97Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexInRange_options_passingTest_1 = + _registerName1("indexInRange:options:passingTest:"); + int _objc_msgSend_98( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_98( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_98Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, _NSRange, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); + ffi.Pointer _objc_msgSend_99( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_99( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_99Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesWithOptions_passingTest_1 = + _registerName1("indexesWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_100( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_100( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_100Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesInRange_options_passingTest_1 = + _registerName1("indexesInRange:options:passingTest:"); + ffi.Pointer _objc_msgSend_101( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_101( + obj, + sel, + range, + opts, + predicate, + ); + } + + late final __objc_msgSend_101Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesUsingBlock_1 = + _registerName1("enumerateRangesUsingBlock:"); + void _objc_msgSend_102( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_102( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_102Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesWithOptions_usingBlock_1 = + _registerName1("enumerateRangesWithOptions:usingBlock:"); + void _objc_msgSend_103( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_103( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_103Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_103 = __objc_msgSend_103Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateRangesInRange_options_usingBlock_1 = + _registerName1("enumerateRangesInRange:options:usingBlock:"); + void _objc_msgSend_104( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_104( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_104Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsAtIndexes_1 = _registerName1("objectsAtIndexes:"); + ffi.Pointer _objc_msgSend_105( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_105( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_105Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_objectAtIndexedSubscript_1 = + _registerName1("objectAtIndexedSubscript:"); + late final _sel_enumerateObjectsUsingBlock_1 = + _registerName1("enumerateObjectsUsingBlock:"); + void _objc_msgSend_106( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_106( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_106Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateObjectsWithOptions:usingBlock:"); + void _objc_msgSend_107( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_107( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_107Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = + _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); + void _objc_msgSend_108( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_108( + obj, + sel, + s, + opts, + block, + ); + } + + late final __objc_msgSend_108Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectPassingTest_1 = + _registerName1("indexOfObjectPassingTest:"); + int _objc_msgSend_109( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_109( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_109Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectWithOptions_passingTest_1 = + _registerName1("indexOfObjectWithOptions:passingTest:"); + int _objc_msgSend_110( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_110( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_110Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_110 = __objc_msgSend_110Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObjectAtIndexes_options_passingTest_1 = + _registerName1("indexOfObjectAtIndexes:options:passingTest:"); + int _objc_msgSend_111( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_111( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_111Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_111 = __objc_msgSend_111Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsPassingTest_1 = + _registerName1("indexesOfObjectsPassingTest:"); + ffi.Pointer _objc_msgSend_112( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_112( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_112Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsWithOptions_passingTest_1 = + _registerName1("indexesOfObjectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_113( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_113( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_113Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = + _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); + ffi.Pointer _objc_msgSend_114( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer s, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_114( + obj, + sel, + s, + opts, + predicate, + ); + } + + late final __objc_msgSend_114Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_114 = __objc_msgSend_114Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sortedArrayUsingComparator_1 = + _registerName1("sortedArrayUsingComparator:"); + ffi.Pointer _objc_msgSend_115( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> cmptr, + ) { + return __objc_msgSend_115( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_115Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sortedArrayWithOptions_usingComparator_1 = + _registerName1("sortedArrayWithOptions:usingComparator:"); + ffi.Pointer _objc_msgSend_116( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> cmptr, + ) { + return __objc_msgSend_116( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_116Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_116 = __objc_msgSend_116Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_indexOfObject_inSortedRange_options_usingComparator_1 = + _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); + int _objc_msgSend_117( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + _NSRange r, + int opts, + ffi.Pointer<_ObjCBlock> cmp, + ) { + return __objc_msgSend_117( + obj, + sel, + obj1, + r, + opts, + cmp, + ); + } + + late final __objc_msgSend_117Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_117 = __objc_msgSend_117Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_array1 = _registerName1("array"); + late final _sel_arrayWithObject_1 = _registerName1("arrayWithObject:"); + late final _sel_arrayWithObjects_count_1 = + _registerName1("arrayWithObjects:count:"); + late final _sel_arrayWithObjects_1 = _registerName1("arrayWithObjects:"); + late final _sel_arrayWithArray_1 = _registerName1("arrayWithArray:"); + late final _sel_initWithObjects_1 = _registerName1("initWithObjects:"); + late final _sel_initWithArray_1 = _registerName1("initWithArray:"); + late final _sel_initWithArray_copyItems_1 = + _registerName1("initWithArray:copyItems:"); + instancetype _objc_msgSend_118( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + bool flag, + ) { + return __objc_msgSend_118( + obj, + sel, + array, + flag, + ); + } + + late final __objc_msgSend_118Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithContentsOfURL_error_1 = + _registerName1("initWithContentsOfURL:error:"); + ffi.Pointer _objc_msgSend_119( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_119( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_119Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_119 = __objc_msgSend_119Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_arrayWithContentsOfURL_error_1 = + _registerName1("arrayWithContentsOfURL:error:"); + late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_1 = + _registerName1("differenceFromArray:withOptions:usingEquivalenceTest:"); + ffi.Pointer _objc_msgSend_120( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + int options, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_120( + obj, + sel, + other, + options, + block, + ); + } + + late final __objc_msgSend_120Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_120 = __objc_msgSend_120Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_differenceFromArray_withOptions_1 = + _registerName1("differenceFromArray:withOptions:"); + ffi.Pointer _objc_msgSend_121( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + int options, + ) { + return __objc_msgSend_121( + obj, + sel, + other, + options, + ); + } + + late final __objc_msgSend_121Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_121 = __objc_msgSend_121Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_differenceFromArray_1 = + _registerName1("differenceFromArray:"); + late final _sel_arrayByApplyingDifference_1 = + _registerName1("arrayByApplyingDifference:"); + late final _sel_getObjects_1 = _registerName1("getObjects:"); + void _objc_msgSend_122( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ) { + return __objc_msgSend_122( + obj, + sel, + objects, + ); + } + + late final __objc_msgSend_122Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_arrayWithContentsOfFile_1 = + _registerName1("arrayWithContentsOfFile:"); + ffi.Pointer _objc_msgSend_123( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_123( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_123Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_arrayWithContentsOfURL_1 = + _registerName1("arrayWithContentsOfURL:"); + ffi.Pointer _objc_msgSend_124( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_124( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_124Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithContentsOfFile_1 = + _registerName1("initWithContentsOfFile:"); + late final _sel_initWithContentsOfURL_1 = + _registerName1("initWithContentsOfURL:"); + late final _sel_writeToURL_atomically_1 = + _registerName1("writeToURL:atomically:"); + bool _objc_msgSend_125( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool atomically, + ) { + return __objc_msgSend_125( + obj, + sel, + url, + atomically, + ); + } + + late final __objc_msgSend_125Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_pathsMatchingExtensions_1 = + _registerName1("pathsMatchingExtensions:"); + late final _sel_valueForKey_1 = _registerName1("valueForKey:"); + late final _sel_setValue_forKey_1 = _registerName1("setValue:forKey:"); + void _objc_msgSend_126( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ) { + return __objc_msgSend_126( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_126Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1 = + _registerName1( + "addObserver:toObjectsAtIndexes:forKeyPath:options:context:"); + void _objc_msgSend_127( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + int options, + ffi.Pointer context, + ) { + return __objc_msgSend_127( + obj, + sel, + observer, + indexes, + keyPath, + options, + context, + ); + } + + late final __objc_msgSend_127Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1 = + _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:context:"); + void _objc_msgSend_128( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + ffi.Pointer context, + ) { + return __objc_msgSend_128( + obj, + sel, + observer, + indexes, + keyPath, + context, + ); + } + + late final __objc_msgSend_128Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1 = + _registerName1("removeObserver:fromObjectsAtIndexes:forKeyPath:"); + void _objc_msgSend_129( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer indexes, + ffi.Pointer keyPath, + ) { + return __objc_msgSend_129( + obj, + sel, + observer, + indexes, + keyPath, + ); + } + + late final __objc_msgSend_129Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_addObserver_forKeyPath_options_context_1 = + _registerName1("addObserver:forKeyPath:options:context:"); + void _objc_msgSend_130( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + int options, + ffi.Pointer context, + ) { + return __objc_msgSend_130( + obj, + sel, + observer, + keyPath, + options, + context, + ); + } + + late final __objc_msgSend_130Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_removeObserver_forKeyPath_context_1 = + _registerName1("removeObserver:forKeyPath:context:"); + void _objc_msgSend_131( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + ffi.Pointer context, + ) { + return __objc_msgSend_131( + obj, + sel, + observer, + keyPath, + context, + ); + } + + late final __objc_msgSend_131Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeObserver_forKeyPath_1 = + _registerName1("removeObserver:forKeyPath:"); + void _objc_msgSend_132( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer observer, + ffi.Pointer keyPath, + ) { + return __objc_msgSend_132( + obj, + sel, + observer, + keyPath, + ); + } + + late final __objc_msgSend_132Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sortedArrayUsingDescriptors_1 = + _registerName1("sortedArrayUsingDescriptors:"); + late final _class_NSPredicate1 = _getClass1("NSPredicate"); + late final _sel_predicateWithFormat_argumentArray_1 = + _registerName1("predicateWithFormat:argumentArray:"); + ffi.Pointer _objc_msgSend_133( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ffi.Pointer arguments, + ) { + return __objc_msgSend_133( + obj, + sel, + predicateFormat, + arguments, + ); + } + + late final __objc_msgSend_133Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_predicateWithFormat_1 = + _registerName1("predicateWithFormat:"); + ffi.Pointer _objc_msgSend_134( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ) { + return __objc_msgSend_134( + obj, + sel, + predicateFormat, + ); + } + + late final __objc_msgSend_134Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_predicateWithFormat_arguments_1 = + _registerName1("predicateWithFormat:arguments:"); + ffi.Pointer _objc_msgSend_135( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicateFormat, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_135( + obj, + sel, + predicateFormat, + argList, + ); + } + + late final __objc_msgSend_135Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_predicateFromMetadataQueryString_1 = + _registerName1("predicateFromMetadataQueryString:"); + late final _sel_predicateWithValue_1 = _registerName1("predicateWithValue:"); + ffi.Pointer _objc_msgSend_136( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_136( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_136Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_136 = __objc_msgSend_136Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _class_NSDictionary1 = _getClass1("NSDictionary"); + late final _sel_objectForKey_1 = _registerName1("objectForKey:"); + late final _sel_keyEnumerator1 = _registerName1("keyEnumerator"); + late final _sel_initWithObjects_forKeys_count_1 = + _registerName1("initWithObjects:forKeys:count:"); + instancetype _objc_msgSend_137( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt, + ) { + return __objc_msgSend_137( + obj, + sel, + objects, + keys, + cnt, + ); + } + + late final __objc_msgSend_137Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_137 = __objc_msgSend_137Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); + + late final _sel_allKeys1 = _registerName1("allKeys"); + late final _sel_allKeysForObject_1 = _registerName1("allKeysForObject:"); + late final _sel_allValues1 = _registerName1("allValues"); + late final _sel_descriptionInStringsFileFormat1 = + _registerName1("descriptionInStringsFileFormat"); + late final _sel_isEqualToDictionary_1 = + _registerName1("isEqualToDictionary:"); + bool _objc_msgSend_138( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDictionary, + ) { + return __objc_msgSend_138( + obj, + sel, + otherDictionary, + ); + } + + late final __objc_msgSend_138Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_138 = __objc_msgSend_138Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectsForKeys_notFoundMarker_1 = + _registerName1("objectsForKeys:notFoundMarker:"); + ffi.Pointer _objc_msgSend_139( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer marker, + ) { + return __objc_msgSend_139( + obj, + sel, + keys, + marker, + ); + } + + late final __objc_msgSend_139Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keysSortedByValueUsingSelector_1 = + _registerName1("keysSortedByValueUsingSelector:"); + late final _sel_getObjects_andKeys_count_1 = + _registerName1("getObjects:andKeys:count:"); + void _objc_msgSend_140( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + int count, + ) { + return __objc_msgSend_140( + obj, + sel, + objects, + keys, + count, + ); + } + + late final __objc_msgSend_140Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); + + late final _sel_objectForKeyedSubscript_1 = + _registerName1("objectForKeyedSubscript:"); + late final _sel_enumerateKeysAndObjectsUsingBlock_1 = + _registerName1("enumerateKeysAndObjectsUsingBlock:"); + void _objc_msgSend_141( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_141( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_141Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_141 = __objc_msgSend_141Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_1 = + _registerName1("enumerateKeysAndObjectsWithOptions:usingBlock:"); + void _objc_msgSend_142( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_142( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_142Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_keysSortedByValueUsingComparator_1 = + _registerName1("keysSortedByValueUsingComparator:"); + late final _sel_keysSortedByValueWithOptions_usingComparator_1 = + _registerName1("keysSortedByValueWithOptions:usingComparator:"); + late final _sel_keysOfEntriesPassingTest_1 = + _registerName1("keysOfEntriesPassingTest:"); + ffi.Pointer _objc_msgSend_143( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_143( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_143Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_keysOfEntriesWithOptions_passingTest_1 = + _registerName1("keysOfEntriesWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_144( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_144( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_144Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_144 = __objc_msgSend_144Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_getObjects_andKeys_1 = _registerName1("getObjects:andKeys:"); + void _objc_msgSend_145( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + ffi.Pointer> keys, + ) { + return __objc_msgSend_145( + obj, + sel, + objects, + keys, + ); + } + + late final __objc_msgSend_145Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_dictionaryWithContentsOfFile_1 = + _registerName1("dictionaryWithContentsOfFile:"); + ffi.Pointer _objc_msgSend_146( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_146( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_146Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithContentsOfURL_1 = + _registerName1("dictionaryWithContentsOfURL:"); + ffi.Pointer _objc_msgSend_147( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_147( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_147Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionary1 = _registerName1("dictionary"); + late final _sel_dictionaryWithObject_forKey_1 = + _registerName1("dictionaryWithObject:forKey:"); + instancetype _objc_msgSend_148( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ffi.Pointer key, + ) { + return __objc_msgSend_148( + obj, + sel, + object, + key, + ); + } + + late final __objc_msgSend_148Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_148 = __objc_msgSend_148Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithObjects_forKeys_count_1 = + _registerName1("dictionaryWithObjects:forKeys:count:"); + late final _sel_dictionaryWithObjectsAndKeys_1 = + _registerName1("dictionaryWithObjectsAndKeys:"); + late final _sel_dictionaryWithDictionary_1 = + _registerName1("dictionaryWithDictionary:"); + instancetype _objc_msgSend_149( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dict, + ) { + return __objc_msgSend_149( + obj, + sel, + dict, + ); + } + + late final __objc_msgSend_149Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dictionaryWithObjects_forKeys_1 = + _registerName1("dictionaryWithObjects:forKeys:"); + instancetype _objc_msgSend_150( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer keys, + ) { + return __objc_msgSend_150( + obj, + sel, + objects, + keys, + ); + } + + late final __objc_msgSend_150Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithObjectsAndKeys_1 = + _registerName1("initWithObjectsAndKeys:"); + late final _sel_initWithDictionary_1 = _registerName1("initWithDictionary:"); + late final _sel_initWithDictionary_copyItems_1 = + _registerName1("initWithDictionary:copyItems:"); + instancetype _objc_msgSend_151( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDictionary, + bool flag, + ) { + return __objc_msgSend_151( + obj, + sel, + otherDictionary, + flag, + ); + } + + late final __objc_msgSend_151Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithObjects_forKeys_1 = + _registerName1("initWithObjects:forKeys:"); + ffi.Pointer _objc_msgSend_152( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_152( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_152Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_152 = __objc_msgSend_152Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_dictionaryWithContentsOfURL_error_1 = + _registerName1("dictionaryWithContentsOfURL:error:"); + late final _sel_sharedKeySetForKeys_1 = + _registerName1("sharedKeySetForKeys:"); + late final _sel_countByEnumeratingWithState_objects_count_1 = + _registerName1("countByEnumeratingWithState:objects:count:"); + int _objc_msgSend_153( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer state, + ffi.Pointer> buffer, + int len, + ) { + return __objc_msgSend_153( + obj, + sel, + state, + buffer, + len, + ); + } + + late final __objc_msgSend_153Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_153 = __objc_msgSend_153Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>(); + + late final _sel_fileSize1 = _registerName1("fileSize"); + int _objc_msgSend_154( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_154( + obj, + sel, + ); + } + + late final __objc_msgSend_154Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSDate1 = _getClass1("NSDate"); + late final _sel_timeIntervalSinceReferenceDate1 = + _registerName1("timeIntervalSinceReferenceDate"); + double _objc_msgSend_155( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_155( + obj, + sel, + ); + } + + late final __objc_msgSend_155Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithTimeIntervalSinceReferenceDate_1 = + _registerName1("initWithTimeIntervalSinceReferenceDate:"); + instancetype _objc_msgSend_156( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ) { + return __objc_msgSend_156( + obj, + sel, + ti, + ); + } + + late final __objc_msgSend_156Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_timeIntervalSinceDate_1 = + _registerName1("timeIntervalSinceDate:"); + double _objc_msgSend_157( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_157( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_157Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeIntervalSinceNow1 = + _registerName1("timeIntervalSinceNow"); + late final _sel_timeIntervalSince19701 = + _registerName1("timeIntervalSince1970"); + late final _sel_addTimeInterval_1 = _registerName1("addTimeInterval:"); + late final _sel_dateByAddingTimeInterval_1 = + _registerName1("dateByAddingTimeInterval:"); + late final _sel_earlierDate_1 = _registerName1("earlierDate:"); + ffi.Pointer _objc_msgSend_158( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_158( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_158Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_laterDate_1 = _registerName1("laterDate:"); + late final _sel_compare_1 = _registerName1("compare:"); + int _objc_msgSend_159( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_159( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_159Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToDate_1 = _registerName1("isEqualToDate:"); + bool _objc_msgSend_160( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherDate, + ) { + return __objc_msgSend_160( + obj, + sel, + otherDate, + ); + } + + late final __objc_msgSend_160Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_date1 = _registerName1("date"); + late final _sel_dateWithTimeIntervalSinceNow_1 = + _registerName1("dateWithTimeIntervalSinceNow:"); + late final _sel_dateWithTimeIntervalSinceReferenceDate_1 = + _registerName1("dateWithTimeIntervalSinceReferenceDate:"); + late final _sel_dateWithTimeIntervalSince1970_1 = + _registerName1("dateWithTimeIntervalSince1970:"); + late final _sel_dateWithTimeInterval_sinceDate_1 = + _registerName1("dateWithTimeInterval:sinceDate:"); + instancetype _objc_msgSend_161( + ffi.Pointer obj, + ffi.Pointer sel, + double secsToBeAdded, + ffi.Pointer date, + ) { + return __objc_msgSend_161( + obj, + sel, + secsToBeAdded, + date, + ); + } + + late final __objc_msgSend_161Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + double, ffi.Pointer)>(); + + late final _sel_distantFuture1 = _registerName1("distantFuture"); + ffi.Pointer _objc_msgSend_162( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_162( + obj, + sel, + ); + } + + late final __objc_msgSend_162Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_distantPast1 = _registerName1("distantPast"); + late final _sel_now1 = _registerName1("now"); + late final _sel_initWithTimeIntervalSinceNow_1 = + _registerName1("initWithTimeIntervalSinceNow:"); + late final _sel_initWithTimeIntervalSince1970_1 = + _registerName1("initWithTimeIntervalSince1970:"); + late final _sel_initWithTimeInterval_sinceDate_1 = + _registerName1("initWithTimeInterval:sinceDate:"); + late final _sel_dateWithNaturalLanguageString_locale_1 = + _registerName1("dateWithNaturalLanguageString:locale:"); + ffi.Pointer _objc_msgSend_163( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ffi.Pointer locale, + ) { + return __objc_msgSend_163( + obj, + sel, + string, + locale, + ); + } + + late final __objc_msgSend_163Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithNaturalLanguageString_1 = + _registerName1("dateWithNaturalLanguageString:"); + late final _sel_dateWithString_1 = _registerName1("dateWithString:"); + late final _class_NSCalendarDate1 = _getClass1("NSCalendarDate"); + late final _sel_calendarDate1 = _registerName1("calendarDate"); + late final _sel_dateWithString_calendarFormat_locale_1 = + _registerName1("dateWithString:calendarFormat:locale:"); + ffi.Pointer _objc_msgSend_164( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer format, + ffi.Pointer locale, + ) { + return __objc_msgSend_164( + obj, + sel, + description, + format, + locale, + ); + } + + late final __objc_msgSend_164Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithString_calendarFormat_1 = + _registerName1("dateWithString:calendarFormat:"); + ffi.Pointer _objc_msgSend_165( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer format, + ) { + return __objc_msgSend_165( + obj, + sel, + description, + format, + ); + } + + late final __objc_msgSend_165Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSTimeZone1 = _getClass1("NSTimeZone"); + late final _sel_name1 = _registerName1("name"); + late final _sel_data1 = _registerName1("data"); + late final _sel_secondsFromGMTForDate_1 = + _registerName1("secondsFromGMTForDate:"); + int _objc_msgSend_166( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aDate, + ) { + return __objc_msgSend_166( + obj, + sel, + aDate, + ); + } + + late final __objc_msgSend_166Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_abbreviationForDate_1 = + _registerName1("abbreviationForDate:"); + ffi.Pointer _objc_msgSend_167( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aDate, + ) { + return __objc_msgSend_167( + obj, + sel, + aDate, + ); + } + + late final __objc_msgSend_167Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isDaylightSavingTimeForDate_1 = + _registerName1("isDaylightSavingTimeForDate:"); + late final _sel_daylightSavingTimeOffsetForDate_1 = + _registerName1("daylightSavingTimeOffsetForDate:"); + late final _sel_nextDaylightSavingTimeTransitionAfterDate_1 = + _registerName1("nextDaylightSavingTimeTransitionAfterDate:"); + late final _sel_systemTimeZone1 = _registerName1("systemTimeZone"); + ffi.Pointer _objc_msgSend_168( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_168( + obj, + sel, + ); + } + + late final __objc_msgSend_168Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_resetSystemTimeZone1 = _registerName1("resetSystemTimeZone"); + late final _sel_defaultTimeZone1 = _registerName1("defaultTimeZone"); + late final _sel_setDefaultTimeZone_1 = _registerName1("setDefaultTimeZone:"); + void _objc_msgSend_169( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_169( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_169Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_localTimeZone1 = _registerName1("localTimeZone"); + late final _sel_knownTimeZoneNames1 = _registerName1("knownTimeZoneNames"); + late final _sel_abbreviationDictionary1 = + _registerName1("abbreviationDictionary"); + ffi.Pointer _objc_msgSend_170( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_170( + obj, + sel, + ); + } + + late final __objc_msgSend_170Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAbbreviationDictionary_1 = + _registerName1("setAbbreviationDictionary:"); + void _objc_msgSend_171( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_171( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_171Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_171 = __objc_msgSend_171Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeZoneDataVersion1 = _registerName1("timeZoneDataVersion"); + late final _sel_secondsFromGMT1 = _registerName1("secondsFromGMT"); + late final _sel_abbreviation1 = _registerName1("abbreviation"); + late final _sel_isDaylightSavingTime1 = + _registerName1("isDaylightSavingTime"); + late final _sel_daylightSavingTimeOffset1 = + _registerName1("daylightSavingTimeOffset"); + late final _sel_nextDaylightSavingTimeTransition1 = + _registerName1("nextDaylightSavingTimeTransition"); + late final _sel_isEqualToTimeZone_1 = _registerName1("isEqualToTimeZone:"); + bool _objc_msgSend_172( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_172( + obj, + sel, + aTimeZone, + ); + } + + late final __objc_msgSend_172Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSLocale1 = _getClass1("NSLocale"); + late final _sel_displayNameForKey_value_1 = + _registerName1("displayNameForKey:value:"); + ffi.Pointer _objc_msgSend_173( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer value, + ) { + return __objc_msgSend_173( + obj, + sel, + key, + value, + ); + } + + late final __objc_msgSend_173Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_173 = __objc_msgSend_173Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithLocaleIdentifier_1 = + _registerName1("initWithLocaleIdentifier:"); + late final _sel_localeIdentifier1 = _registerName1("localeIdentifier"); + late final _sel_localizedStringForLocaleIdentifier_1 = + _registerName1("localizedStringForLocaleIdentifier:"); + late final _sel_languageCode1 = _registerName1("languageCode"); + late final _sel_localizedStringForLanguageCode_1 = + _registerName1("localizedStringForLanguageCode:"); + late final _sel_countryCode1 = _registerName1("countryCode"); + late final _sel_localizedStringForCountryCode_1 = + _registerName1("localizedStringForCountryCode:"); + late final _sel_scriptCode1 = _registerName1("scriptCode"); + late final _sel_localizedStringForScriptCode_1 = + _registerName1("localizedStringForScriptCode:"); + late final _sel_variantCode1 = _registerName1("variantCode"); + late final _sel_localizedStringForVariantCode_1 = + _registerName1("localizedStringForVariantCode:"); + late final _class_NSCharacterSet1 = _getClass1("NSCharacterSet"); + late final _sel_controlCharacterSet1 = _registerName1("controlCharacterSet"); + ffi.Pointer _objc_msgSend_174( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_174( + obj, + sel, + ); + } + + late final __objc_msgSend_174Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_174 = __objc_msgSend_174Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_whitespaceCharacterSet1 = + _registerName1("whitespaceCharacterSet"); + late final _sel_whitespaceAndNewlineCharacterSet1 = + _registerName1("whitespaceAndNewlineCharacterSet"); + late final _sel_decimalDigitCharacterSet1 = + _registerName1("decimalDigitCharacterSet"); + late final _sel_letterCharacterSet1 = _registerName1("letterCharacterSet"); + late final _sel_lowercaseLetterCharacterSet1 = + _registerName1("lowercaseLetterCharacterSet"); + late final _sel_uppercaseLetterCharacterSet1 = + _registerName1("uppercaseLetterCharacterSet"); + late final _sel_nonBaseCharacterSet1 = _registerName1("nonBaseCharacterSet"); + late final _sel_alphanumericCharacterSet1 = + _registerName1("alphanumericCharacterSet"); + late final _sel_decomposableCharacterSet1 = + _registerName1("decomposableCharacterSet"); + late final _sel_illegalCharacterSet1 = _registerName1("illegalCharacterSet"); + late final _sel_punctuationCharacterSet1 = + _registerName1("punctuationCharacterSet"); + late final _sel_capitalizedLetterCharacterSet1 = + _registerName1("capitalizedLetterCharacterSet"); + late final _sel_symbolCharacterSet1 = _registerName1("symbolCharacterSet"); + late final _sel_newlineCharacterSet1 = _registerName1("newlineCharacterSet"); + late final _sel_characterSetWithRange_1 = + _registerName1("characterSetWithRange:"); + ffi.Pointer _objc_msgSend_175( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange aRange, + ) { + return __objc_msgSend_175( + obj, + sel, + aRange, + ); + } + + late final __objc_msgSend_175Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_175 = __objc_msgSend_175Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_characterSetWithCharactersInString_1 = + _registerName1("characterSetWithCharactersInString:"); + ffi.Pointer _objc_msgSend_176( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + ) { + return __objc_msgSend_176( + obj, + sel, + aString, + ); + } + + late final __objc_msgSend_176Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_176 = __objc_msgSend_176Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_characterSetWithBitmapRepresentation_1 = + _registerName1("characterSetWithBitmapRepresentation:"); + ffi.Pointer _objc_msgSend_177( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_177( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_177Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_177 = __objc_msgSend_177Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_characterSetWithContentsOfFile_1 = + _registerName1("characterSetWithContentsOfFile:"); + late final _sel_characterIsMember_1 = _registerName1("characterIsMember:"); + bool _objc_msgSend_178( + ffi.Pointer obj, + ffi.Pointer sel, + int aCharacter, + ) { + return __objc_msgSend_178( + obj, + sel, + aCharacter, + ); + } + + late final __objc_msgSend_178Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_178 = __objc_msgSend_178Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_bitmapRepresentation1 = + _registerName1("bitmapRepresentation"); + late final _sel_invertedSet1 = _registerName1("invertedSet"); + late final _sel_longCharacterIsMember_1 = + _registerName1("longCharacterIsMember:"); + bool _objc_msgSend_179( + ffi.Pointer obj, + ffi.Pointer sel, + int theLongChar, + ) { + return __objc_msgSend_179( + obj, + sel, + theLongChar, + ); + } + + late final __objc_msgSend_179Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_179 = __objc_msgSend_179Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isSupersetOfSet_1 = _registerName1("isSupersetOfSet:"); + bool _objc_msgSend_180( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer theOtherSet, + ) { + return __objc_msgSend_180( + obj, + sel, + theOtherSet, + ); + } + + late final __objc_msgSend_180Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_180 = __objc_msgSend_180Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_hasMemberInPlane_1 = _registerName1("hasMemberInPlane:"); + bool _objc_msgSend_181( + ffi.Pointer obj, + ffi.Pointer sel, + int thePlane, + ) { + return __objc_msgSend_181( + obj, + sel, + thePlane, + ); + } + + late final __objc_msgSend_181Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Uint8)>>('objc_msgSend'); + late final __objc_msgSend_181 = __objc_msgSend_181Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_URLUserAllowedCharacterSet1 = + _registerName1("URLUserAllowedCharacterSet"); + late final _sel_URLPasswordAllowedCharacterSet1 = + _registerName1("URLPasswordAllowedCharacterSet"); + late final _sel_URLHostAllowedCharacterSet1 = + _registerName1("URLHostAllowedCharacterSet"); + late final _sel_URLPathAllowedCharacterSet1 = + _registerName1("URLPathAllowedCharacterSet"); + late final _sel_URLQueryAllowedCharacterSet1 = + _registerName1("URLQueryAllowedCharacterSet"); + late final _sel_URLFragmentAllowedCharacterSet1 = + _registerName1("URLFragmentAllowedCharacterSet"); + late final _sel_exemplarCharacterSet1 = + _registerName1("exemplarCharacterSet"); + late final _sel_calendarIdentifier1 = _registerName1("calendarIdentifier"); + late final _sel_localizedStringForCalendarIdentifier_1 = + _registerName1("localizedStringForCalendarIdentifier:"); + late final _sel_collationIdentifier1 = _registerName1("collationIdentifier"); + late final _sel_localizedStringForCollationIdentifier_1 = + _registerName1("localizedStringForCollationIdentifier:"); + late final _sel_usesMetricSystem1 = _registerName1("usesMetricSystem"); + late final _sel_decimalSeparator1 = _registerName1("decimalSeparator"); + late final _sel_groupingSeparator1 = _registerName1("groupingSeparator"); + late final _sel_currencySymbol1 = _registerName1("currencySymbol"); + late final _sel_currencyCode1 = _registerName1("currencyCode"); + late final _sel_localizedStringForCurrencyCode_1 = + _registerName1("localizedStringForCurrencyCode:"); + late final _sel_collatorIdentifier1 = _registerName1("collatorIdentifier"); + late final _sel_localizedStringForCollatorIdentifier_1 = + _registerName1("localizedStringForCollatorIdentifier:"); + late final _sel_quotationBeginDelimiter1 = + _registerName1("quotationBeginDelimiter"); + late final _sel_quotationEndDelimiter1 = + _registerName1("quotationEndDelimiter"); + late final _sel_alternateQuotationBeginDelimiter1 = + _registerName1("alternateQuotationBeginDelimiter"); + late final _sel_alternateQuotationEndDelimiter1 = + _registerName1("alternateQuotationEndDelimiter"); + late final _sel_autoupdatingCurrentLocale1 = + _registerName1("autoupdatingCurrentLocale"); + ffi.Pointer _objc_msgSend_182( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_182( + obj, + sel, + ); + } + + late final __objc_msgSend_182Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_182 = __objc_msgSend_182Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentLocale1 = _registerName1("currentLocale"); + late final _sel_systemLocale1 = _registerName1("systemLocale"); + late final _sel_localeWithLocaleIdentifier_1 = + _registerName1("localeWithLocaleIdentifier:"); + late final _sel_availableLocaleIdentifiers1 = + _registerName1("availableLocaleIdentifiers"); + late final _sel_ISOLanguageCodes1 = _registerName1("ISOLanguageCodes"); + late final _sel_ISOCountryCodes1 = _registerName1("ISOCountryCodes"); + late final _sel_ISOCurrencyCodes1 = _registerName1("ISOCurrencyCodes"); + late final _sel_commonISOCurrencyCodes1 = + _registerName1("commonISOCurrencyCodes"); + late final _sel_preferredLanguages1 = _registerName1("preferredLanguages"); + late final _sel_componentsFromLocaleIdentifier_1 = + _registerName1("componentsFromLocaleIdentifier:"); + late final _sel_localeIdentifierFromComponents_1 = + _registerName1("localeIdentifierFromComponents:"); + ffi.Pointer _objc_msgSend_183( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dict, + ) { + return __objc_msgSend_183( + obj, + sel, + dict, + ); + } + + late final __objc_msgSend_183Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_183 = __objc_msgSend_183Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canonicalLocaleIdentifierFromString_1 = + _registerName1("canonicalLocaleIdentifierFromString:"); + late final _sel_canonicalLanguageIdentifierFromString_1 = + _registerName1("canonicalLanguageIdentifierFromString:"); + late final _sel_localeIdentifierFromWindowsLocaleCode_1 = + _registerName1("localeIdentifierFromWindowsLocaleCode:"); + ffi.Pointer _objc_msgSend_184( + ffi.Pointer obj, + ffi.Pointer sel, + int lcid, + ) { + return __objc_msgSend_184( + obj, + sel, + lcid, + ); + } + + late final __objc_msgSend_184Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Uint32)>>('objc_msgSend'); + late final __objc_msgSend_184 = __objc_msgSend_184Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_windowsLocaleCodeFromLocaleIdentifier_1 = + _registerName1("windowsLocaleCodeFromLocaleIdentifier:"); + int _objc_msgSend_185( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localeIdentifier, + ) { + return __objc_msgSend_185( + obj, + sel, + localeIdentifier, + ); + } + + late final __objc_msgSend_185Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_185 = __objc_msgSend_185Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_characterDirectionForLanguage_1 = + _registerName1("characterDirectionForLanguage:"); + int _objc_msgSend_186( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer isoLangCode, + ) { + return __objc_msgSend_186( + obj, + sel, + isoLangCode, + ); + } + + late final __objc_msgSend_186Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_186 = __objc_msgSend_186Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_lineDirectionForLanguage_1 = + _registerName1("lineDirectionForLanguage:"); + late final _sel_localizedName_locale_1 = + _registerName1("localizedName:locale:"); + ffi.Pointer _objc_msgSend_187( + ffi.Pointer obj, + ffi.Pointer sel, + int style, + ffi.Pointer locale, + ) { + return __objc_msgSend_187( + obj, + sel, + style, + locale, + ); + } + + late final __objc_msgSend_187Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_187 = __objc_msgSend_187Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_timeZoneWithName_1 = _registerName1("timeZoneWithName:"); + late final _sel_timeZoneWithName_data_1 = + _registerName1("timeZoneWithName:data:"); + instancetype _objc_msgSend_188( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer tzName, + ffi.Pointer aData, + ) { + return __objc_msgSend_188( + obj, + sel, + tzName, + aData, + ); + } + + late final __objc_msgSend_188Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_188 = __objc_msgSend_188Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithName_1 = _registerName1("initWithName:"); + late final _sel_initWithName_data_1 = _registerName1("initWithName:data:"); + late final _sel_timeZoneForSecondsFromGMT_1 = + _registerName1("timeZoneForSecondsFromGMT:"); + instancetype _objc_msgSend_189( + ffi.Pointer obj, + ffi.Pointer sel, + int seconds, + ) { + return __objc_msgSend_189( + obj, + sel, + seconds, + ); + } + + late final __objc_msgSend_189Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_189 = __objc_msgSend_189Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_timeZoneWithAbbreviation_1 = + _registerName1("timeZoneWithAbbreviation:"); + late final _sel_dateWithYear_month_day_hour_minute_second_timeZone_1 = + _registerName1("dateWithYear:month:day:hour:minute:second:timeZone:"); + ffi.Pointer _objc_msgSend_190( + ffi.Pointer obj, + ffi.Pointer sel, + int year, + int month, + int day, + int hour, + int minute, + int second, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_190( + obj, + sel, + year, + month, + day, + hour, + minute, + second, + aTimeZone, + ); + } + + late final __objc_msgSend_190Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_190 = __objc_msgSend_190Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + int, + int, + int, + int, + ffi.Pointer)>(); + + late final _sel_dateByAddingYears_months_days_hours_minutes_seconds_1 = + _registerName1("dateByAddingYears:months:days:hours:minutes:seconds:"); + ffi.Pointer _objc_msgSend_191( + ffi.Pointer obj, + ffi.Pointer sel, + int year, + int month, + int day, + int hour, + int minute, + int second, + ) { + return __objc_msgSend_191( + obj, + sel, + year, + month, + day, + hour, + minute, + second, + ); + } + + late final __objc_msgSend_191Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_191 = __objc_msgSend_191Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, int, int, int)>(); + + late final _sel_dayOfCommonEra1 = _registerName1("dayOfCommonEra"); + late final _sel_dayOfMonth1 = _registerName1("dayOfMonth"); + late final _sel_dayOfWeek1 = _registerName1("dayOfWeek"); + late final _sel_dayOfYear1 = _registerName1("dayOfYear"); + late final _sel_hourOfDay1 = _registerName1("hourOfDay"); + late final _sel_minuteOfHour1 = _registerName1("minuteOfHour"); + late final _sel_monthOfYear1 = _registerName1("monthOfYear"); + late final _sel_secondOfMinute1 = _registerName1("secondOfMinute"); + late final _sel_yearOfCommonEra1 = _registerName1("yearOfCommonEra"); + late final _sel_calendarFormat1 = _registerName1("calendarFormat"); + late final _sel_descriptionWithCalendarFormat_locale_1 = + _registerName1("descriptionWithCalendarFormat:locale:"); + late final _sel_descriptionWithCalendarFormat_1 = + _registerName1("descriptionWithCalendarFormat:"); + late final _sel_timeZone1 = _registerName1("timeZone"); + late final _sel_initWithString_calendarFormat_locale_1 = + _registerName1("initWithString:calendarFormat:locale:"); + late final _sel_initWithString_calendarFormat_1 = + _registerName1("initWithString:calendarFormat:"); + late final _sel_initWithYear_month_day_hour_minute_second_timeZone_1 = + _registerName1("initWithYear:month:day:hour:minute:second:timeZone:"); + late final _sel_setCalendarFormat_1 = _registerName1("setCalendarFormat:"); + void _objc_msgSend_192( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ) { + return __objc_msgSend_192( + obj, + sel, + format, + ); + } + + late final __objc_msgSend_192Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_192 = __objc_msgSend_192Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setTimeZone_1 = _registerName1("setTimeZone:"); + void _objc_msgSend_193( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_193( + obj, + sel, + aTimeZone, + ); + } + + late final __objc_msgSend_193Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_193 = __objc_msgSend_193Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_years_months_days_hours_minutes_seconds_sinceDate_1 = + _registerName1("years:months:days:hours:minutes:seconds:sinceDate:"); + void _objc_msgSend_194( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer yp, + ffi.Pointer mop, + ffi.Pointer dp, + ffi.Pointer hp, + ffi.Pointer mip, + ffi.Pointer sp, + ffi.Pointer date, + ) { + return __objc_msgSend_194( + obj, + sel, + yp, + mop, + dp, + hp, + mip, + sp, + date, + ); + } + + late final __objc_msgSend_194Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_194 = __objc_msgSend_194Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateWithCalendarFormat_timeZone_1 = + _registerName1("dateWithCalendarFormat:timeZone:"); + ffi.Pointer _objc_msgSend_195( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer aTimeZone, + ) { + return __objc_msgSend_195( + obj, + sel, + format, + aTimeZone, + ); + } + + late final __objc_msgSend_195Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_195 = __objc_msgSend_195Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_descriptionWithCalendarFormat_timeZone_locale_1 = + _registerName1("descriptionWithCalendarFormat:timeZone:locale:"); + ffi.Pointer _objc_msgSend_196( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer aTimeZone, + ffi.Pointer locale, + ) { + return __objc_msgSend_196( + obj, + sel, + format, + aTimeZone, + locale, + ); + } + + late final __objc_msgSend_196Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_196 = __objc_msgSend_196Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileModificationDate1 = + _registerName1("fileModificationDate"); + late final _sel_fileType1 = _registerName1("fileType"); + late final _sel_filePosixPermissions1 = + _registerName1("filePosixPermissions"); + late final _sel_fileOwnerAccountName1 = + _registerName1("fileOwnerAccountName"); + late final _sel_fileGroupOwnerAccountName1 = + _registerName1("fileGroupOwnerAccountName"); + late final _sel_fileSystemNumber1 = _registerName1("fileSystemNumber"); + late final _sel_fileSystemFileNumber1 = + _registerName1("fileSystemFileNumber"); + late final _sel_fileExtensionHidden1 = _registerName1("fileExtensionHidden"); + late final _sel_fileHFSCreatorCode1 = _registerName1("fileHFSCreatorCode"); + int _objc_msgSend_197( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_197( + obj, + sel, + ); + } + + late final __objc_msgSend_197Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_197 = __objc_msgSend_197Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileHFSTypeCode1 = _registerName1("fileHFSTypeCode"); + late final _sel_fileIsImmutable1 = _registerName1("fileIsImmutable"); + late final _sel_fileIsAppendOnly1 = _registerName1("fileIsAppendOnly"); + late final _sel_fileCreationDate1 = _registerName1("fileCreationDate"); + late final _sel_fileOwnerAccountID1 = _registerName1("fileOwnerAccountID"); + ffi.Pointer _objc_msgSend_198( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_198( + obj, + sel, + ); + } + + late final __objc_msgSend_198Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_198 = __objc_msgSend_198Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileGroupOwnerAccountID1 = + _registerName1("fileGroupOwnerAccountID"); + late final _sel_predicateWithBlock_1 = _registerName1("predicateWithBlock:"); + ffi.Pointer _objc_msgSend_199( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_199( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_199Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_199 = __objc_msgSend_199Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_predicateFormat1 = _registerName1("predicateFormat"); + late final _sel_predicateWithSubstitutionVariables_1 = + _registerName1("predicateWithSubstitutionVariables:"); + late final _sel_evaluateWithObject_1 = _registerName1("evaluateWithObject:"); + late final _sel_evaluateWithObject_substitutionVariables_1 = + _registerName1("evaluateWithObject:substitutionVariables:"); + bool _objc_msgSend_200( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + ffi.Pointer bindings, + ) { + return __objc_msgSend_200( + obj, + sel, + object, + bindings, + ); + } + + late final __objc_msgSend_200Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_200 = __objc_msgSend_200Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allowEvaluation1 = _registerName1("allowEvaluation"); + late final _sel_filteredArrayUsingPredicate_1 = + _registerName1("filteredArrayUsingPredicate:"); + ffi.Pointer _objc_msgSend_201( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_201( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_201Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_201 = __objc_msgSend_201Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithChar_1 = _registerName1("initWithChar:"); + ffi.Pointer _objc_msgSend_202( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_202( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_202Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Char)>>('objc_msgSend'); + late final __objc_msgSend_202 = __objc_msgSend_202Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedChar_1 = + _registerName1("initWithUnsignedChar:"); + ffi.Pointer _objc_msgSend_203( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_203( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_203Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_203 = __objc_msgSend_203Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithShort_1 = _registerName1("initWithShort:"); + ffi.Pointer _objc_msgSend_204( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_204( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_204Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Short)>>('objc_msgSend'); + late final __objc_msgSend_204 = __objc_msgSend_204Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedShort_1 = + _registerName1("initWithUnsignedShort:"); + ffi.Pointer _objc_msgSend_205( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_205( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_205Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedShort)>>('objc_msgSend'); + late final __objc_msgSend_205 = __objc_msgSend_205Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithInt_1 = _registerName1("initWithInt:"); + ffi.Pointer _objc_msgSend_206( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_206( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_206Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_206 = __objc_msgSend_206Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedInt_1 = + _registerName1("initWithUnsignedInt:"); + ffi.Pointer _objc_msgSend_207( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_207( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_207Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_207 = __objc_msgSend_207Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLong_1 = _registerName1("initWithLong:"); + ffi.Pointer _objc_msgSend_208( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_208( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_208Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_208 = __objc_msgSend_208Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedLong_1 = + _registerName1("initWithUnsignedLong:"); + ffi.Pointer _objc_msgSend_209( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_209( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_209Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_209 = __objc_msgSend_209Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); + ffi.Pointer _objc_msgSend_210( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_210( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_210Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.LongLong)>>('objc_msgSend'); + late final __objc_msgSend_210 = __objc_msgSend_210Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithUnsignedLongLong_1 = + _registerName1("initWithUnsignedLongLong:"); + ffi.Pointer _objc_msgSend_211( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_211( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_211Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_211 = __objc_msgSend_211Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithFloat_1 = _registerName1("initWithFloat:"); + ffi.Pointer _objc_msgSend_212( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_212( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_212Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_212 = __objc_msgSend_212Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_initWithDouble_1 = _registerName1("initWithDouble:"); + ffi.Pointer _objc_msgSend_213( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_213( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_213Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_213 = __objc_msgSend_213Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_initWithBool_1 = _registerName1("initWithBool:"); + ffi.Pointer _objc_msgSend_214( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_214( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_214Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_214 = __objc_msgSend_214Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_initWithInteger_1 = _registerName1("initWithInteger:"); + late final _sel_initWithUnsignedInteger_1 = + _registerName1("initWithUnsignedInteger:"); + late final _sel_charValue1 = _registerName1("charValue"); + int _objc_msgSend_215( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_215( + obj, + sel, + ); + } + + late final __objc_msgSend_215Ptr = _lookup< + ffi.NativeFunction< + ffi.Char Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_215 = __objc_msgSend_215Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); + int _objc_msgSend_216( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_216( + obj, + sel, + ); + } + + late final __objc_msgSend_216Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedChar Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_216 = __objc_msgSend_216Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_shortValue1 = _registerName1("shortValue"); + int _objc_msgSend_217( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_217( + obj, + sel, + ); + } + + late final __objc_msgSend_217Ptr = _lookup< + ffi.NativeFunction< + ffi.Short Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_217 = __objc_msgSend_217Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); + int _objc_msgSend_218( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_218( + obj, + sel, + ); + } + + late final __objc_msgSend_218Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedShort Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_218 = __objc_msgSend_218Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_intValue1 = _registerName1("intValue"); + int _objc_msgSend_219( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_219( + obj, + sel, + ); + } + + late final __objc_msgSend_219Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_219 = __objc_msgSend_219Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); + late final _sel_longValue1 = _registerName1("longValue"); + late final _sel_unsignedLongValue1 = _registerName1("unsignedLongValue"); + late final _sel_longLongValue1 = _registerName1("longLongValue"); + int _objc_msgSend_220( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_220( + obj, + sel, + ); + } + + late final __objc_msgSend_220Ptr = _lookup< + ffi.NativeFunction< + ffi.LongLong Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_220 = __objc_msgSend_220Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_unsignedLongLongValue1 = + _registerName1("unsignedLongLongValue"); + late final _sel_floatValue1 = _registerName1("floatValue"); + double _objc_msgSend_221( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_221( + obj, + sel, + ); + } + + late final __objc_msgSend_221Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_221 = __objc_msgSend_221Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_doubleValue1 = _registerName1("doubleValue"); + late final _sel_boolValue1 = _registerName1("boolValue"); + late final _sel_integerValue1 = _registerName1("integerValue"); + late final _sel_unsignedIntegerValue1 = + _registerName1("unsignedIntegerValue"); + late final _sel_stringValue1 = _registerName1("stringValue"); + int _objc_msgSend_222( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherNumber, + ) { + return __objc_msgSend_222( + obj, + sel, + otherNumber, + ); + } + + late final __objc_msgSend_222Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_222 = __objc_msgSend_222Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToNumber_1 = _registerName1("isEqualToNumber:"); + bool _objc_msgSend_223( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_223( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_223Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_223 = __objc_msgSend_223Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_numberWithChar_1 = _registerName1("numberWithChar:"); + late final _sel_numberWithUnsignedChar_1 = + _registerName1("numberWithUnsignedChar:"); + late final _sel_numberWithShort_1 = _registerName1("numberWithShort:"); + late final _sel_numberWithUnsignedShort_1 = + _registerName1("numberWithUnsignedShort:"); + late final _sel_numberWithInt_1 = _registerName1("numberWithInt:"); + late final _sel_numberWithUnsignedInt_1 = + _registerName1("numberWithUnsignedInt:"); + late final _sel_numberWithLong_1 = _registerName1("numberWithLong:"); + late final _sel_numberWithUnsignedLong_1 = + _registerName1("numberWithUnsignedLong:"); + late final _sel_numberWithLongLong_1 = _registerName1("numberWithLongLong:"); + late final _sel_numberWithUnsignedLongLong_1 = + _registerName1("numberWithUnsignedLongLong:"); + late final _sel_numberWithFloat_1 = _registerName1("numberWithFloat:"); + late final _sel_numberWithDouble_1 = _registerName1("numberWithDouble:"); + late final _sel_numberWithBool_1 = _registerName1("numberWithBool:"); + late final _sel_numberWithInteger_1 = _registerName1("numberWithInteger:"); + late final _sel_numberWithUnsignedInteger_1 = + _registerName1("numberWithUnsignedInteger:"); + late final _sel_port1 = _registerName1("port"); + late final _sel_user1 = _registerName1("user"); + late final _sel_password1 = _registerName1("password"); + late final _sel_path1 = _registerName1("path"); + late final _sel_fragment1 = _registerName1("fragment"); + late final _sel_parameterString1 = _registerName1("parameterString"); + late final _sel_query1 = _registerName1("query"); + late final _sel_relativePath1 = _registerName1("relativePath"); + late final _sel_hasDirectoryPath1 = _registerName1("hasDirectoryPath"); + late final _sel_getFileSystemRepresentation_maxLength_1 = + _registerName1("getFileSystemRepresentation:maxLength:"); + bool _objc_msgSend_224( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferLength, + ) { + return __objc_msgSend_224( + obj, + sel, + buffer, + maxBufferLength, + ); + } + + late final __objc_msgSend_224Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_224 = __objc_msgSend_224Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_fileSystemRepresentation1 = + _registerName1("fileSystemRepresentation"); + late final _sel_isFileURL1 = _registerName1("isFileURL"); + late final _sel_standardizedURL1 = _registerName1("standardizedURL"); + late final _sel_checkResourceIsReachableAndReturnError_1 = + _registerName1("checkResourceIsReachableAndReturnError:"); + bool _objc_msgSend_225( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_225( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_225Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_225 = __objc_msgSend_225Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isFileReferenceURL1 = _registerName1("isFileReferenceURL"); + late final _sel_fileReferenceURL1 = _registerName1("fileReferenceURL"); + late final _sel_filePathURL1 = _registerName1("filePathURL"); + late final _sel_getResourceValue_forKey_error_1 = + _registerName1("getResourceValue:forKey:error:"); + bool _objc_msgSend_226( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> value, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_226( + obj, + sel, + value, + key, + error, + ); + } + + late final __objc_msgSend_226Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_226 = __objc_msgSend_226Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_resourceValuesForKeys_error_1 = + _registerName1("resourceValuesForKeys:error:"); + ffi.Pointer _objc_msgSend_227( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer> error, + ) { + return __objc_msgSend_227( + obj, + sel, + keys, + error, + ); + } + + late final __objc_msgSend_227Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_227 = __objc_msgSend_227Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_setResourceValue_forKey_error_1 = + _registerName1("setResourceValue:forKey:error:"); + bool _objc_msgSend_228( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_228( + obj, + sel, + value, + key, + error, + ); + } + + late final __objc_msgSend_228Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_228 = __objc_msgSend_228Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_setResourceValues_error_1 = + _registerName1("setResourceValues:error:"); + bool _objc_msgSend_229( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyedValues, + ffi.Pointer> error, + ) { + return __objc_msgSend_229( + obj, + sel, + keyedValues, + error, + ); + } + + late final __objc_msgSend_229Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_229 = __objc_msgSend_229Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_removeCachedResourceValueForKey_1 = + _registerName1("removeCachedResourceValueForKey:"); + late final _sel_removeAllCachedResourceValues1 = + _registerName1("removeAllCachedResourceValues"); + late final _sel_setTemporaryResourceValue_forKey_1 = + _registerName1("setTemporaryResourceValue:forKey:"); + late final _sel_bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_1 = + _registerName1( + "bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:"); + ffi.Pointer _objc_msgSend_230( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer keys, + ffi.Pointer relativeURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_230( + obj, + sel, + options, + keys, + relativeURL, + error, + ); + } + + late final __objc_msgSend_230Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_230 = __objc_msgSend_230Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1 = + _registerName1( + "initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"); + instancetype _objc_msgSend_231( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bookmarkData, + int options, + ffi.Pointer relativeURL, + ffi.Pointer isStale, + ffi.Pointer> error, + ) { + return __objc_msgSend_231( + obj, + sel, + bookmarkData, + options, + relativeURL, + isStale, + error, + ); + } + + late final __objc_msgSend_231Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_231 = __objc_msgSend_231Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1 = + _registerName1( + "URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"); + late final _sel_resourceValuesForKeys_fromBookmarkData_1 = + _registerName1("resourceValuesForKeys:fromBookmarkData:"); + ffi.Pointer _objc_msgSend_232( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer bookmarkData, + ) { + return __objc_msgSend_232( + obj, + sel, + keys, + bookmarkData, + ); + } + + late final __objc_msgSend_232Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_232 = __objc_msgSend_232Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_writeBookmarkData_toURL_options_error_1 = + _registerName1("writeBookmarkData:toURL:options:error:"); + bool _objc_msgSend_233( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bookmarkData, + ffi.Pointer bookmarkFileURL, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_233( + obj, + sel, + bookmarkData, + bookmarkFileURL, + options, + error, + ); + } + + late final __objc_msgSend_233Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_233 = __objc_msgSend_233Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_bookmarkDataWithContentsOfURL_error_1 = + _registerName1("bookmarkDataWithContentsOfURL:error:"); + ffi.Pointer _objc_msgSend_234( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bookmarkFileURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_234( + obj, + sel, + bookmarkFileURL, + error, + ); + } + + late final __objc_msgSend_234Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_234 = __objc_msgSend_234Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_URLByResolvingAliasFileAtURL_options_error_1 = + _registerName1("URLByResolvingAliasFileAtURL:options:error:"); + instancetype _objc_msgSend_235( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_235( + obj, + sel, + url, + options, + error, + ); + } + + late final __objc_msgSend_235Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_235 = __objc_msgSend_235Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_startAccessingSecurityScopedResource1 = + _registerName1("startAccessingSecurityScopedResource"); + late final _sel_stopAccessingSecurityScopedResource1 = + _registerName1("stopAccessingSecurityScopedResource"); + late final _sel_getPromisedItemResourceValue_forKey_error_1 = + _registerName1("getPromisedItemResourceValue:forKey:error:"); + late final _sel_promisedItemResourceValuesForKeys_error_1 = + _registerName1("promisedItemResourceValuesForKeys:error:"); + ffi.Pointer _objc_msgSend_236( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ffi.Pointer> error, + ) { + return __objc_msgSend_236( + obj, + sel, + keys, + error, + ); + } + + late final __objc_msgSend_236Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_236 = __objc_msgSend_236Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_checkPromisedItemIsReachableAndReturnError_1 = + _registerName1("checkPromisedItemIsReachableAndReturnError:"); + late final _sel_fileURLWithPathComponents_1 = + _registerName1("fileURLWithPathComponents:"); + ffi.Pointer _objc_msgSend_237( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer components, + ) { + return __objc_msgSend_237( + obj, + sel, + components, + ); + } + + late final __objc_msgSend_237Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_237 = __objc_msgSend_237Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pathComponents1 = _registerName1("pathComponents"); + late final _sel_lastPathComponent1 = _registerName1("lastPathComponent"); + late final _sel_pathExtension1 = _registerName1("pathExtension"); + late final _sel_URLByAppendingPathComponent_1 = + _registerName1("URLByAppendingPathComponent:"); + late final _sel_URLByAppendingPathComponent_isDirectory_1 = + _registerName1("URLByAppendingPathComponent:isDirectory:"); + late final _sel_URLByDeletingLastPathComponent1 = + _registerName1("URLByDeletingLastPathComponent"); + late final _sel_URLByAppendingPathExtension_1 = + _registerName1("URLByAppendingPathExtension:"); + late final _sel_URLByDeletingPathExtension1 = + _registerName1("URLByDeletingPathExtension"); + late final _sel_URLByStandardizingPath1 = + _registerName1("URLByStandardizingPath"); + late final _sel_URLByResolvingSymlinksInPath1 = + _registerName1("URLByResolvingSymlinksInPath"); + late final _sel_resourceDataUsingCache_1 = + _registerName1("resourceDataUsingCache:"); + ffi.Pointer _objc_msgSend_238( + ffi.Pointer obj, + ffi.Pointer sel, + bool shouldUseCache, + ) { + return __objc_msgSend_238( + obj, + sel, + shouldUseCache, + ); + } + + late final __objc_msgSend_238Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_238 = __objc_msgSend_238Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_loadResourceDataNotifyingClient_usingCache_1 = + _registerName1("loadResourceDataNotifyingClient:usingCache:"); + void _objc_msgSend_239( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer client, + bool shouldUseCache, + ) { + return __objc_msgSend_239( + obj, + sel, + client, + shouldUseCache, + ); + } + + late final __objc_msgSend_239Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_propertyForKey_1 = _registerName1("propertyForKey:"); + late final _sel_setResourceData_1 = _registerName1("setResourceData:"); + late final _sel_setProperty_forKey_1 = _registerName1("setProperty:forKey:"); + bool _objc_msgSend_240( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer property, + ffi.Pointer propertyKey, + ) { + return __objc_msgSend_240( + obj, + sel, + property, + propertyKey, + ); + } + + late final __objc_msgSend_240Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_240 = __objc_msgSend_240Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLHandle1 = _getClass1("NSURLHandle"); + late final _sel_registerURLHandleClass_1 = + _registerName1("registerURLHandleClass:"); + late final _sel_URLHandleClassForURL_1 = + _registerName1("URLHandleClassForURL:"); + ffi.Pointer _objc_msgSend_241( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_241( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_241Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_241 = __objc_msgSend_241Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_status1 = _registerName1("status"); + int _objc_msgSend_242( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_242( + obj, + sel, + ); + } + + late final __objc_msgSend_242Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_242 = __objc_msgSend_242Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_failureReason1 = _registerName1("failureReason"); + late final _sel_addClient_1 = _registerName1("addClient:"); + late final _sel_removeClient_1 = _registerName1("removeClient:"); + late final _sel_loadInBackground1 = _registerName1("loadInBackground"); + late final _sel_cancelLoadInBackground1 = + _registerName1("cancelLoadInBackground"); + late final _sel_resourceData1 = _registerName1("resourceData"); + late final _sel_availableResourceData1 = + _registerName1("availableResourceData"); + late final _sel_expectedResourceDataSize1 = + _registerName1("expectedResourceDataSize"); + late final _sel_flushCachedData1 = _registerName1("flushCachedData"); + late final _sel_backgroundLoadDidFailWithReason_1 = + _registerName1("backgroundLoadDidFailWithReason:"); + late final _sel_didLoadBytes_loadComplete_1 = + _registerName1("didLoadBytes:loadComplete:"); + void _objc_msgSend_243( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer newBytes, + bool yorn, + ) { + return __objc_msgSend_243( + obj, + sel, + newBytes, + yorn, + ); + } + + late final __objc_msgSend_243Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_243 = __objc_msgSend_243Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_canInitWithURL_1 = _registerName1("canInitWithURL:"); + bool _objc_msgSend_244( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_244( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_244Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_244 = __objc_msgSend_244Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cachedHandleForURL_1 = _registerName1("cachedHandleForURL:"); + ffi.Pointer _objc_msgSend_245( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + ) { + return __objc_msgSend_245( + obj, + sel, + anURL, + ); + } + + late final __objc_msgSend_245Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_245 = __objc_msgSend_245Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithURL_cached_1 = _registerName1("initWithURL:cached:"); + ffi.Pointer _objc_msgSend_246( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anURL, + bool willCache, + ) { + return __objc_msgSend_246( + obj, + sel, + anURL, + willCache, + ); + } + + late final __objc_msgSend_246Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_246 = __objc_msgSend_246Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_propertyForKeyIfAvailable_1 = + _registerName1("propertyForKeyIfAvailable:"); + late final _sel_writeProperty_forKey_1 = + _registerName1("writeProperty:forKey:"); + late final _sel_writeData_1 = _registerName1("writeData:"); + late final _sel_loadInForeground1 = _registerName1("loadInForeground"); + late final _sel_beginLoadInBackground1 = + _registerName1("beginLoadInBackground"); + late final _sel_endLoadInBackground1 = _registerName1("endLoadInBackground"); + late final _sel_URLHandleUsingCache_1 = + _registerName1("URLHandleUsingCache:"); + ffi.Pointer _objc_msgSend_247( + ffi.Pointer obj, + ffi.Pointer sel, + bool shouldUseCache, + ) { + return __objc_msgSend_247( + obj, + sel, + shouldUseCache, + ); + } + + late final __objc_msgSend_247Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_247 = __objc_msgSend_247Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_writeToFile_options_error_1 = + _registerName1("writeToFile:options:error:"); + bool _objc_msgSend_248( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int writeOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_248( + obj, + sel, + path, + writeOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_248Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_248 = __objc_msgSend_248Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_writeToURL_options_error_1 = + _registerName1("writeToURL:options:error:"); + bool _objc_msgSend_249( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int writeOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_249( + obj, + sel, + url, + writeOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_249Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_249 = __objc_msgSend_249Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_rangeOfData_options_range_1 = + _registerName1("rangeOfData:options:range:"); + void _objc_msgSend_250( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataToFind, + int mask, + _NSRange searchRange, + ) { + return __objc_msgSend_250( + stret, + obj, + sel, + dataToFind, + mask, + searchRange, + ); + } + + late final __objc_msgSend_250Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend_stret'); + late final __objc_msgSend_250 = __objc_msgSend_250Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_enumerateByteRangesUsingBlock_1 = + _registerName1("enumerateByteRangesUsingBlock:"); + void _objc_msgSend_251( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_251( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_251Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_251 = __objc_msgSend_251Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataWithBytes_length_1 = + _registerName1("dataWithBytes:length:"); + instancetype _objc_msgSend_252( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ) { + return __objc_msgSend_252( + obj, + sel, + bytes, + length, + ); + } + + late final __objc_msgSend_252Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_252 = __objc_msgSend_252Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_dataWithBytesNoCopy_length_1 = + _registerName1("dataWithBytesNoCopy:length:"); + late final _sel_dataWithBytesNoCopy_length_freeWhenDone_1 = + _registerName1("dataWithBytesNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_253( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool b, + ) { + return __objc_msgSend_253( + obj, + sel, + bytes, + length, + b, + ); + } + + late final __objc_msgSend_253Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_253 = __objc_msgSend_253Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, bool)>(); + + late final _sel_dataWithContentsOfFile_options_error_1 = + _registerName1("dataWithContentsOfFile:options:error:"); + instancetype _objc_msgSend_254( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int readOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_254( + obj, + sel, + path, + readOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_254Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_254 = __objc_msgSend_254Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_dataWithContentsOfURL_options_error_1 = + _registerName1("dataWithContentsOfURL:options:error:"); + instancetype _objc_msgSend_255( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int readOptionsMask, + ffi.Pointer> errorPtr, + ) { + return __objc_msgSend_255( + obj, + sel, + url, + readOptionsMask, + errorPtr, + ); + } + + late final __objc_msgSend_255Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_255 = __objc_msgSend_255Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_dataWithContentsOfFile_1 = + _registerName1("dataWithContentsOfFile:"); + late final _sel_dataWithContentsOfURL_1 = + _registerName1("dataWithContentsOfURL:"); + late final _sel_initWithBytes_length_1 = + _registerName1("initWithBytes:length:"); + late final _sel_initWithBytesNoCopy_length_1 = + _registerName1("initWithBytesNoCopy:length:"); + late final _sel_initWithBytesNoCopy_length_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:freeWhenDone:"); + late final _sel_initWithBytesNoCopy_length_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:deallocator:"); + instancetype _objc_msgSend_256( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_256( + obj, + sel, + bytes, + length, + deallocator, + ); + } + + late final __objc_msgSend_256Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_256 = __objc_msgSend_256Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithContentsOfFile_options_error_1 = + _registerName1("initWithContentsOfFile:options:error:"); + late final _sel_initWithContentsOfURL_options_error_1 = + _registerName1("initWithContentsOfURL:options:error:"); + late final _sel_initWithData_1 = _registerName1("initWithData:"); + instancetype _objc_msgSend_257( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_257( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_257Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_257 = __objc_msgSend_257Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dataWithData_1 = _registerName1("dataWithData:"); + late final _sel_initWithBase64EncodedString_options_1 = + _registerName1("initWithBase64EncodedString:options:"); + instancetype _objc_msgSend_258( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer base64String, + int options, + ) { + return __objc_msgSend_258( + obj, + sel, + base64String, + options, + ); + } + + late final __objc_msgSend_258Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_258 = __objc_msgSend_258Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_base64EncodedStringWithOptions_1 = + _registerName1("base64EncodedStringWithOptions:"); + ffi.Pointer _objc_msgSend_259( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_259( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_259Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_259 = __objc_msgSend_259Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithBase64EncodedData_options_1 = + _registerName1("initWithBase64EncodedData:options:"); + instancetype _objc_msgSend_260( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer base64Data, + int options, + ) { + return __objc_msgSend_260( + obj, + sel, + base64Data, + options, + ); + } + + late final __objc_msgSend_260Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_260 = __objc_msgSend_260Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_base64EncodedDataWithOptions_1 = + _registerName1("base64EncodedDataWithOptions:"); + ffi.Pointer _objc_msgSend_261( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_261( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_261Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_261 = __objc_msgSend_261Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_decompressedDataUsingAlgorithm_error_1 = + _registerName1("decompressedDataUsingAlgorithm:error:"); + instancetype _objc_msgSend_262( + ffi.Pointer obj, + ffi.Pointer sel, + int algorithm, + ffi.Pointer> error, + ) { + return __objc_msgSend_262( + obj, + sel, + algorithm, + error, + ); + } + + late final __objc_msgSend_262Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_262 = __objc_msgSend_262Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_compressedDataUsingAlgorithm_error_1 = + _registerName1("compressedDataUsingAlgorithm:error:"); + late final _sel_getBytes_1 = _registerName1("getBytes:"); + late final _sel_dataWithContentsOfMappedFile_1 = + _registerName1("dataWithContentsOfMappedFile:"); + late final _sel_initWithContentsOfMappedFile_1 = + _registerName1("initWithContentsOfMappedFile:"); + late final _sel_initWithBase64Encoding_1 = + _registerName1("initWithBase64Encoding:"); + late final _sel_base64Encoding1 = _registerName1("base64Encoding"); + late final _sel_encodeDataObject_1 = _registerName1("encodeDataObject:"); + void _objc_msgSend_263( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_263( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_263Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_263 = __objc_msgSend_263Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDataObject1 = _registerName1("decodeDataObject"); + late final _sel_decodeValueOfObjCType_at_size_1 = + _registerName1("decodeValueOfObjCType:at:size:"); + void _objc_msgSend_264( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + ffi.Pointer data, + int size, + ) { + return __objc_msgSend_264( + obj, + sel, + type, + data, + size, + ); + } + + late final __objc_msgSend_264Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_264 = __objc_msgSend_264Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_versionForClassName_1 = + _registerName1("versionForClassName:"); + int _objc_msgSend_265( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer className, + ) { + return __objc_msgSend_265( + obj, + sel, + className, + ); + } + + late final __objc_msgSend_265Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_265 = __objc_msgSend_265Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeObject_1 = _registerName1("encodeObject:"); + late final _sel_encodeRootObject_1 = _registerName1("encodeRootObject:"); + late final _sel_encodeBycopyObject_1 = _registerName1("encodeBycopyObject:"); + late final _sel_encodeByrefObject_1 = _registerName1("encodeByrefObject:"); + late final _sel_encodeConditionalObject_1 = + _registerName1("encodeConditionalObject:"); + late final _sel_encodeValuesOfObjCTypes_1 = + _registerName1("encodeValuesOfObjCTypes:"); + void _objc_msgSend_266( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer types, + ) { + return __objc_msgSend_266( + obj, + sel, + types, + ); + } + + late final __objc_msgSend_266Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_266 = __objc_msgSend_266Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeArrayOfObjCType_count_at_1 = + _registerName1("encodeArrayOfObjCType:count:at:"); + void _objc_msgSend_267( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer type, + int count, + ffi.Pointer array, + ) { + return __objc_msgSend_267( + obj, + sel, + type, + count, + array, + ); + } + + late final __objc_msgSend_267Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_267 = __objc_msgSend_267Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_encodeBytes_length_1 = _registerName1("encodeBytes:length:"); + late final _sel_decodeObject1 = _registerName1("decodeObject"); + late final _sel_decodeTopLevelObjectAndReturnError_1 = + _registerName1("decodeTopLevelObjectAndReturnError:"); + ffi.Pointer _objc_msgSend_268( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_268( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_268Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_268 = __objc_msgSend_268Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_decodeValuesOfObjCTypes_1 = + _registerName1("decodeValuesOfObjCTypes:"); + late final _sel_decodeArrayOfObjCType_count_at_1 = + _registerName1("decodeArrayOfObjCType:count:at:"); + late final _sel_decodeBytesWithReturnedLength_1 = + _registerName1("decodeBytesWithReturnedLength:"); + ffi.Pointer _objc_msgSend_269( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer lengthp, + ) { + return __objc_msgSend_269( + obj, + sel, + lengthp, + ); + } + + late final __objc_msgSend_269Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_269 = __objc_msgSend_269Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodePropertyList_1 = _registerName1("encodePropertyList:"); + late final _sel_decodePropertyList1 = _registerName1("decodePropertyList"); + late final _sel_setObjectZone_1 = _registerName1("setObjectZone:"); + void _objc_msgSend_270( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_270( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_270Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_270 = __objc_msgSend_270Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_NSZone>)>(); + + late final _sel_objectZone1 = _registerName1("objectZone"); + ffi.Pointer<_NSZone> _objc_msgSend_271( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_271( + obj, + sel, + ); + } + + late final __objc_msgSend_271Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_systemVersion1 = _registerName1("systemVersion"); + late final _sel_allowsKeyedCoding1 = _registerName1("allowsKeyedCoding"); + late final _sel_encodeObject_forKey_1 = + _registerName1("encodeObject:forKey:"); + late final _sel_encodeConditionalObject_forKey_1 = + _registerName1("encodeConditionalObject:forKey:"); + late final _sel_encodeBool_forKey_1 = _registerName1("encodeBool:forKey:"); + void _objc_msgSend_272( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ffi.Pointer key, + ) { + return __objc_msgSend_272( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_272Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_272 = __objc_msgSend_272Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool, + ffi.Pointer)>(); + + late final _sel_encodeInt_forKey_1 = _registerName1("encodeInt:forKey:"); + void _objc_msgSend_273( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_273( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_273Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_273 = __objc_msgSend_273Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeInt32_forKey_1 = _registerName1("encodeInt32:forKey:"); + void _objc_msgSend_274( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_274( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_274Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_274 = __objc_msgSend_274Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeInt64_forKey_1 = _registerName1("encodeInt64:forKey:"); + void _objc_msgSend_275( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_275( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_275Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_275 = __objc_msgSend_275Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_encodeFloat_forKey_1 = _registerName1("encodeFloat:forKey:"); + void _objc_msgSend_276( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ffi.Pointer key, + ) { + return __objc_msgSend_276( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_276Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_276 = __objc_msgSend_276Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_encodeDouble_forKey_1 = + _registerName1("encodeDouble:forKey:"); + void _objc_msgSend_277( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ffi.Pointer key, + ) { + return __objc_msgSend_277( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_277Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_277 = __objc_msgSend_277Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_encodeBytes_length_forKey_1 = + _registerName1("encodeBytes:length:forKey:"); + void _objc_msgSend_278( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + ffi.Pointer key, + ) { + return __objc_msgSend_278( + obj, + sel, + bytes, + length, + key, + ); + } + + late final __objc_msgSend_278Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_278 = __objc_msgSend_278Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_containsValueForKey_1 = + _registerName1("containsValueForKey:"); + late final _sel_decodeObjectForKey_1 = _registerName1("decodeObjectForKey:"); + late final _sel_decodeTopLevelObjectForKey_error_1 = + _registerName1("decodeTopLevelObjectForKey:error:"); + ffi.Pointer _objc_msgSend_279( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_279( + obj, + sel, + key, + error, + ); + } + + late final __objc_msgSend_279Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_279 = __objc_msgSend_279Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeBoolForKey_1 = _registerName1("decodeBoolForKey:"); + late final _sel_decodeIntForKey_1 = _registerName1("decodeIntForKey:"); + int _objc_msgSend_280( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_280( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_280Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_280 = __objc_msgSend_280Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeInt32ForKey_1 = _registerName1("decodeInt32ForKey:"); + int _objc_msgSend_281( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_281( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_281Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_281 = __objc_msgSend_281Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeInt64ForKey_1 = _registerName1("decodeInt64ForKey:"); + int _objc_msgSend_282( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_282( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_282Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_282 = __objc_msgSend_282Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeFloatForKey_1 = _registerName1("decodeFloatForKey:"); + double _objc_msgSend_283( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_283( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_283Ptr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_283 = __objc_msgSend_283Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDoubleForKey_1 = _registerName1("decodeDoubleForKey:"); + double _objc_msgSend_284( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_284( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_284Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_284 = __objc_msgSend_284Ptr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeBytesForKey_returnedLength_1 = + _registerName1("decodeBytesForKey:returnedLength:"); + ffi.Pointer _objc_msgSend_285( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer lengthp, + ) { + return __objc_msgSend_285( + obj, + sel, + key, + lengthp, + ); + } + + late final __objc_msgSend_285Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_285 = __objc_msgSend_285Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_encodeInteger_forKey_1 = + _registerName1("encodeInteger:forKey:"); + void _objc_msgSend_286( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ffi.Pointer key, + ) { + return __objc_msgSend_286( + obj, + sel, + value, + key, + ); + } + + late final __objc_msgSend_286Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Long, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_286 = __objc_msgSend_286Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_decodeIntegerForKey_1 = + _registerName1("decodeIntegerForKey:"); + late final _sel_requiresSecureCoding1 = + _registerName1("requiresSecureCoding"); + late final _sel_decodeObjectOfClass_forKey_1 = + _registerName1("decodeObjectOfClass:forKey:"); + ffi.Pointer _objc_msgSend_287( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer key, + ) { + return __objc_msgSend_287( + obj, + sel, + aClass, + key, + ); + } + + late final __objc_msgSend_287Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_287 = __objc_msgSend_287Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeTopLevelObjectOfClass_forKey_error_1 = + _registerName1("decodeTopLevelObjectOfClass:forKey:error:"); + ffi.Pointer _objc_msgSend_288( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_288( + obj, + sel, + aClass, + key, + error, + ); + } + + late final __objc_msgSend_288Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_288 = __objc_msgSend_288Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeArrayOfObjectsOfClass_forKey_1 = + _registerName1("decodeArrayOfObjectsOfClass:forKey:"); + ffi.Pointer _objc_msgSend_289( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cls, + ffi.Pointer key, + ) { + return __objc_msgSend_289( + obj, + sel, + cls, + key, + ); + } + + late final __objc_msgSend_289Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_289 = __objc_msgSend_289Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1 = + _registerName1("decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:"); + ffi.Pointer _objc_msgSend_290( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyCls, + ffi.Pointer objectCls, + ffi.Pointer key, + ) { + return __objc_msgSend_290( + obj, + sel, + keyCls, + objectCls, + key, + ); + } + + late final __objc_msgSend_290Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_290 = __objc_msgSend_290Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeObjectOfClasses_forKey_1 = + _registerName1("decodeObjectOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_291( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ) { + return __objc_msgSend_291( + obj, + sel, + classes, + key, + ); + } + + late final __objc_msgSend_291Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_291 = __objc_msgSend_291Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeTopLevelObjectOfClasses_forKey_error_1 = + _registerName1("decodeTopLevelObjectOfClasses:forKey:error:"); + ffi.Pointer _objc_msgSend_292( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ffi.Pointer> error, + ) { + return __objc_msgSend_292( + obj, + sel, + classes, + key, + error, + ); + } + + late final __objc_msgSend_292Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_292 = __objc_msgSend_292Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_decodeArrayOfObjectsOfClasses_forKey_1 = + _registerName1("decodeArrayOfObjectsOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_293( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classes, + ffi.Pointer key, + ) { + return __objc_msgSend_293( + obj, + sel, + classes, + key, + ); + } + + late final __objc_msgSend_293Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_293 = __objc_msgSend_293Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1 = + _registerName1( + "decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:"); + ffi.Pointer _objc_msgSend_294( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyClasses, + ffi.Pointer objectClasses, + ffi.Pointer key, + ) { + return __objc_msgSend_294( + obj, + sel, + keyClasses, + objectClasses, + key, + ); + } + + late final __objc_msgSend_294Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_294 = __objc_msgSend_294Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodePropertyListForKey_1 = + _registerName1("decodePropertyListForKey:"); + late final _sel_allowedClasses1 = _registerName1("allowedClasses"); + ffi.Pointer _objc_msgSend_295( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_295( + obj, + sel, + ); + } + + late final __objc_msgSend_295Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_295 = __objc_msgSend_295Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_failWithError_1 = _registerName1("failWithError:"); + void _objc_msgSend_296( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + ) { + return __objc_msgSend_296( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_296Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_296 = __objc_msgSend_296Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodingFailurePolicy1 = + _registerName1("decodingFailurePolicy"); + int _objc_msgSend_297( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_297( + obj, + sel, + ); + } + + late final __objc_msgSend_297Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_297 = __objc_msgSend_297Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_error1 = _registerName1("error"); + ffi.Pointer _objc_msgSend_298( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_298( + obj, + sel, + ); + } + + late final __objc_msgSend_298Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_298 = __objc_msgSend_298Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodeNXObject_1 = _registerName1("encodeNXObject:"); + late final _sel_decodeNXObject1 = _registerName1("decodeNXObject"); + late final _sel_decodeValueOfObjCType_at_1 = + _registerName1("decodeValueOfObjCType:at:"); + late final _sel_encodePoint_1 = _registerName1("encodePoint:"); + void _objc_msgSend_299( + ffi.Pointer obj, + ffi.Pointer sel, + CGPoint point, + ) { + return __objc_msgSend_299( + obj, + sel, + point, + ); + } + + late final __objc_msgSend_299Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + CGPoint)>>('objc_msgSend'); + late final __objc_msgSend_299 = __objc_msgSend_299Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, CGPoint)>(); + + late final _sel_decodePoint1 = _registerName1("decodePoint"); + late final _sel_encodeSize_1 = _registerName1("encodeSize:"); + void _objc_msgSend_300( + ffi.Pointer obj, + ffi.Pointer sel, + CGSize size, + ) { + return __objc_msgSend_300( + obj, + sel, + size, + ); + } + + late final __objc_msgSend_300Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + CGSize)>>('objc_msgSend'); + late final __objc_msgSend_300 = __objc_msgSend_300Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, CGSize)>(); + + late final _sel_decodeSize1 = _registerName1("decodeSize"); + late final _sel_encodeRect_1 = _registerName1("encodeRect:"); + void _objc_msgSend_301( + ffi.Pointer obj, + ffi.Pointer sel, + CGRect rect, + ) { + return __objc_msgSend_301( + obj, + sel, + rect, + ); + } + + late final __objc_msgSend_301Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + CGRect)>>('objc_msgSend'); + late final __objc_msgSend_301 = __objc_msgSend_301Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, CGRect)>(); + + late final _sel_decodeRect1 = _registerName1("decodeRect"); + late final _sel_encodePoint_forKey_1 = _registerName1("encodePoint:forKey:"); + void _objc_msgSend_302( + ffi.Pointer obj, + ffi.Pointer sel, + CGPoint point, + ffi.Pointer key, + ) { + return __objc_msgSend_302( + obj, + sel, + point, + key, + ); + } + + late final __objc_msgSend_302Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + CGPoint, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_302 = __objc_msgSend_302Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, CGPoint, + ffi.Pointer)>(); + + late final _sel_encodeSize_forKey_1 = _registerName1("encodeSize:forKey:"); + void _objc_msgSend_303( + ffi.Pointer obj, + ffi.Pointer sel, + CGSize size, + ffi.Pointer key, + ) { + return __objc_msgSend_303( + obj, + sel, + size, + key, + ); + } + + late final __objc_msgSend_303Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + CGSize, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_303 = __objc_msgSend_303Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, CGSize, + ffi.Pointer)>(); + + late final _sel_encodeRect_forKey_1 = _registerName1("encodeRect:forKey:"); + void _objc_msgSend_304( + ffi.Pointer obj, + ffi.Pointer sel, + CGRect rect, + ffi.Pointer key, + ) { + return __objc_msgSend_304( + obj, + sel, + rect, + key, + ); + } + + late final __objc_msgSend_304Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + CGRect, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_304 = __objc_msgSend_304Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, CGRect, + ffi.Pointer)>(); + + late final _sel_decodePointForKey_1 = _registerName1("decodePointForKey:"); + void _objc_msgSend_305( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_305( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_305Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_305 = __objc_msgSend_305Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_decodeSizeForKey_1 = _registerName1("decodeSizeForKey:"); + void _objc_msgSend_306( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_306( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_306Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_306 = __objc_msgSend_306Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_decodeRectForKey_1 = _registerName1("decodeRectForKey:"); + void _objc_msgSend_307( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_307( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_307Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); + ffi.Pointer _objc_msgSend_308( + ffi.Pointer obj, + ffi.Pointer sel, + int from, + ) { + return __objc_msgSend_308( + obj, + sel, + from, + ); + } + + late final __objc_msgSend_308Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_substringToIndex_1 = _registerName1("substringToIndex:"); + late final _sel_substringWithRange_1 = _registerName1("substringWithRange:"); + ffi.Pointer _objc_msgSend_309( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_309( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_309Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_309 = __objc_msgSend_309Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_getCharacters_range_1 = + _registerName1("getCharacters:range:"); + void _objc_msgSend_310( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + _NSRange range, + ) { + return __objc_msgSend_310( + obj, + sel, + buffer, + range, + ); + } + + late final __objc_msgSend_310Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_310 = __objc_msgSend_310Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + int _objc_msgSend_311( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_311( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_311Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_311 = __objc_msgSend_311Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_compare_options_1 = _registerName1("compare:options:"); + int _objc_msgSend_312( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ) { + return __objc_msgSend_312( + obj, + sel, + string, + mask, + ); + } + + late final __objc_msgSend_312Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_312 = __objc_msgSend_312Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_compare_options_range_1 = + _registerName1("compare:options:range:"); + int _objc_msgSend_313( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + _NSRange rangeOfReceiverToCompare, + ) { + return __objc_msgSend_313( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + ); + } + + late final __objc_msgSend_313Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_313 = __objc_msgSend_313Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + late final _sel_compare_options_range_locale_1 = + _registerName1("compare:options:range:locale:"); + int _objc_msgSend_314( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + _NSRange rangeOfReceiverToCompare, + ffi.Pointer locale, + ) { + return __objc_msgSend_314( + obj, + sel, + string, + mask, + rangeOfReceiverToCompare, + locale, + ); + } + + late final __objc_msgSend_314Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_314 = __objc_msgSend_314Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange, ffi.Pointer)>(); + + late final _sel_caseInsensitiveCompare_1 = + _registerName1("caseInsensitiveCompare:"); + late final _sel_localizedCompare_1 = _registerName1("localizedCompare:"); + late final _sel_localizedCaseInsensitiveCompare_1 = + _registerName1("localizedCaseInsensitiveCompare:"); + late final _sel_localizedStandardCompare_1 = + _registerName1("localizedStandardCompare:"); + late final _sel_isEqualToString_1 = _registerName1("isEqualToString:"); + late final _sel_hasPrefix_1 = _registerName1("hasPrefix:"); + late final _sel_hasSuffix_1 = _registerName1("hasSuffix:"); + late final _sel_commonPrefixWithString_options_1 = + _registerName1("commonPrefixWithString:options:"); + ffi.Pointer _objc_msgSend_315( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + int mask, + ) { + return __objc_msgSend_315( + obj, + sel, + str, + mask, + ); + } + + late final __objc_msgSend_315Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_315 = __objc_msgSend_315Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_containsString_1 = _registerName1("containsString:"); + late final _sel_localizedCaseInsensitiveContainsString_1 = + _registerName1("localizedCaseInsensitiveContainsString:"); + late final _sel_localizedStandardContainsString_1 = + _registerName1("localizedStandardContainsString:"); + late final _sel_localizedStandardRangeOfString_1 = + _registerName1("localizedStandardRangeOfString:"); + void _objc_msgSend_316( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + ) { + return __objc_msgSend_316( + stret, + obj, + sel, + str, + ); + } + + late final __objc_msgSend_316Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_316 = __objc_msgSend_316Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); + late final _sel_rangeOfString_options_1 = + _registerName1("rangeOfString:options:"); + void _objc_msgSend_317( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + ) { + return __objc_msgSend_317( + stret, + obj, + sel, + searchString, + mask, + ); + } + + late final __objc_msgSend_317Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend_stret'); + late final __objc_msgSend_317 = __objc_msgSend_317Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_rangeOfString_options_range_1 = + _registerName1("rangeOfString:options:range:"); + void _objc_msgSend_318( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_318( + stret, + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_318Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend_stret'); + late final __objc_msgSend_318 = __objc_msgSend_318Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_rangeOfString_options_range_locale_1 = + _registerName1("rangeOfString:options:range:locale:"); + void _objc_msgSend_319( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, + ) { + return __objc_msgSend_319( + stret, + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + locale, + ); + } + + late final __objc_msgSend_319Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_319 = __objc_msgSend_319Ptr.asFunction< + void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); + + late final _sel_rangeOfCharacterFromSet_1 = + _registerName1("rangeOfCharacterFromSet:"); + void _objc_msgSend_320( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + ) { + return __objc_msgSend_320( + stret, + obj, + sel, + searchSet, + ); + } + + late final __objc_msgSend_320Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_320 = __objc_msgSend_320Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_rangeOfCharacterFromSet_options_1 = + _registerName1("rangeOfCharacterFromSet:options:"); + void _objc_msgSend_321( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + ) { + return __objc_msgSend_321( + stret, + obj, + sel, + searchSet, + mask, + ); + } + + late final __objc_msgSend_321Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend_stret'); + late final __objc_msgSend_321 = __objc_msgSend_321Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_rangeOfCharacterFromSet_options_range_1 = + _registerName1("rangeOfCharacterFromSet:options:range:"); + void _objc_msgSend_322( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + _NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_322( + stret, + obj, + sel, + searchSet, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_322Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend_stret'); + late final __objc_msgSend_322 = __objc_msgSend_322Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = + _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); + void _objc_msgSend_323( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_323( + stret, + obj, + sel, + index, + ); + } + + late final __objc_msgSend_323Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend_stret'); + late final __objc_msgSend_323 = __objc_msgSend_323Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_rangeOfComposedCharacterSequencesForRange_1 = + _registerName1("rangeOfComposedCharacterSequencesForRange:"); + void _objc_msgSend_324( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_324( + stret, + obj, + sel, + range, + ); + } + + late final __objc_msgSend_324Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend_stret'); + late final __objc_msgSend_324 = __objc_msgSend_324Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + late final _sel_stringByAppendingString_1 = + _registerName1("stringByAppendingString:"); + late final _sel_stringByAppendingFormat_1 = + _registerName1("stringByAppendingFormat:"); + late final _sel_uppercaseString1 = _registerName1("uppercaseString"); + late final _sel_lowercaseString1 = _registerName1("lowercaseString"); + late final _sel_capitalizedString1 = _registerName1("capitalizedString"); + late final _sel_localizedUppercaseString1 = + _registerName1("localizedUppercaseString"); + late final _sel_localizedLowercaseString1 = + _registerName1("localizedLowercaseString"); + late final _sel_localizedCapitalizedString1 = + _registerName1("localizedCapitalizedString"); + late final _sel_uppercaseStringWithLocale_1 = + _registerName1("uppercaseStringWithLocale:"); + ffi.Pointer _objc_msgSend_325( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer locale, + ) { + return __objc_msgSend_325( + obj, + sel, + locale, + ); + } + + late final __objc_msgSend_325Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_325 = __objc_msgSend_325Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_lowercaseStringWithLocale_1 = + _registerName1("lowercaseStringWithLocale:"); + late final _sel_capitalizedStringWithLocale_1 = + _registerName1("capitalizedStringWithLocale:"); + late final _sel_getLineStart_end_contentsEnd_forRange_1 = + _registerName1("getLineStart:end:contentsEnd:forRange:"); + void _objc_msgSend_326( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + _NSRange range, + ) { + return __objc_msgSend_326( + obj, + sel, + startPtr, + lineEndPtr, + contentsEndPtr, + range, + ); + } + + late final __objc_msgSend_326Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_326 = __objc_msgSend_326Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>(); + + late final _sel_lineRangeForRange_1 = _registerName1("lineRangeForRange:"); + late final _sel_getParagraphStart_end_contentsEnd_forRange_1 = + _registerName1("getParagraphStart:end:contentsEnd:forRange:"); + late final _sel_paragraphRangeForRange_1 = + _registerName1("paragraphRangeForRange:"); + late final _sel_enumerateSubstringsInRange_options_usingBlock_1 = + _registerName1("enumerateSubstringsInRange:options:usingBlock:"); + void _objc_msgSend_327( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_327( + obj, + sel, + range, + opts, + block, + ); + } + + late final __objc_msgSend_327Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_327 = __objc_msgSend_327Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateLinesUsingBlock_1 = + _registerName1("enumerateLinesUsingBlock:"); + void _objc_msgSend_328( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_328( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_328Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_328 = __objc_msgSend_328Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_UTF8String1 = _registerName1("UTF8String"); + late final _sel_fastestEncoding1 = _registerName1("fastestEncoding"); + late final _sel_smallestEncoding1 = _registerName1("smallestEncoding"); + late final _sel_dataUsingEncoding_allowLossyConversion_1 = + _registerName1("dataUsingEncoding:allowLossyConversion:"); + ffi.Pointer _objc_msgSend_329( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + bool lossy, + ) { + return __objc_msgSend_329( + obj, + sel, + encoding, + lossy, + ); + } + + late final __objc_msgSend_329Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); + ffi.Pointer _objc_msgSend_330( + ffi.Pointer obj, + ffi.Pointer sel, + int encoding, + ) { + return __objc_msgSend_330( + obj, + sel, + encoding, + ); + } + + late final __objc_msgSend_330Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_canBeConvertedToEncoding_1 = + _registerName1("canBeConvertedToEncoding:"); + late final _sel_cStringUsingEncoding_1 = + _registerName1("cStringUsingEncoding:"); + late final _sel_getCString_maxLength_encoding_1 = + _registerName1("getCString:maxLength:encoding:"); + bool _objc_msgSend_331( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + int encoding, + ) { + return __objc_msgSend_331( + obj, + sel, + buffer, + maxBufferCount, + encoding, + ); + } + + late final __objc_msgSend_331Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1 = + _registerName1( + "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); + bool _objc_msgSend_332( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + _NSRange range, + ffi.Pointer<_NSRange> leftover, + ) { + return __objc_msgSend_332( + obj, + sel, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover, + ); + } + + late final __objc_msgSend_332Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Int32, + _NSRange, + ffi.Pointer<_NSRange>)>>('objc_msgSend'); + late final __objc_msgSend_332 = __objc_msgSend_332Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int, + int, + _NSRange, + ffi.Pointer<_NSRange>)>(); + + late final _sel_maximumLengthOfBytesUsingEncoding_1 = + _registerName1("maximumLengthOfBytesUsingEncoding:"); + late final _sel_lengthOfBytesUsingEncoding_1 = + _registerName1("lengthOfBytesUsingEncoding:"); + late final _sel_availableStringEncodings1 = + _registerName1("availableStringEncodings"); + ffi.Pointer _objc_msgSend_333( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_333( + obj, + sel, + ); + } + + late final __objc_msgSend_333Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_333 = __objc_msgSend_333Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedNameOfStringEncoding_1 = + _registerName1("localizedNameOfStringEncoding:"); + late final _sel_defaultCStringEncoding1 = + _registerName1("defaultCStringEncoding"); + late final _sel_decomposedStringWithCanonicalMapping1 = + _registerName1("decomposedStringWithCanonicalMapping"); + late final _sel_precomposedStringWithCanonicalMapping1 = + _registerName1("precomposedStringWithCanonicalMapping"); + late final _sel_decomposedStringWithCompatibilityMapping1 = + _registerName1("decomposedStringWithCompatibilityMapping"); + late final _sel_precomposedStringWithCompatibilityMapping1 = + _registerName1("precomposedStringWithCompatibilityMapping"); + late final _sel_componentsSeparatedByString_1 = + _registerName1("componentsSeparatedByString:"); + late final _sel_componentsSeparatedByCharactersInSet_1 = + _registerName1("componentsSeparatedByCharactersInSet:"); + ffi.Pointer _objc_msgSend_334( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer separator, + ) { + return __objc_msgSend_334( + obj, + sel, + separator, + ); + } + + late final __objc_msgSend_334Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_334 = __objc_msgSend_334Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringByTrimmingCharactersInSet_1 = + _registerName1("stringByTrimmingCharactersInSet:"); + ffi.Pointer _objc_msgSend_335( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_335( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_335Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_335 = __objc_msgSend_335Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringByPaddingToLength_withString_startingAtIndex_1 = + _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); + ffi.Pointer _objc_msgSend_336( + ffi.Pointer obj, + ffi.Pointer sel, + int newLength, + ffi.Pointer padString, + int padIndex, + ) { + return __objc_msgSend_336( + obj, + sel, + newLength, + padString, + padIndex, + ); + } + + late final __objc_msgSend_336Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_336 = __objc_msgSend_336Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_stringByFoldingWithOptions_locale_1 = + _registerName1("stringByFoldingWithOptions:locale:"); + ffi.Pointer _objc_msgSend_337( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_337( + obj, + sel, + options, + locale, + ); + } + + late final __objc_msgSend_337Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_337 = __objc_msgSend_337Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = + _registerName1( + "stringByReplacingOccurrencesOfString:withString:options:range:"); + ffi.Pointer _objc_msgSend_338( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + _NSRange searchRange, + ) { + return __objc_msgSend_338( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_338Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_338 = __objc_msgSend_338Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange)>(); + + late final _sel_stringByReplacingOccurrencesOfString_withString_1 = + _registerName1("stringByReplacingOccurrencesOfString:withString:"); + ffi.Pointer _objc_msgSend_339( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + ) { + return __objc_msgSend_339( + obj, + sel, + target, + replacement, + ); + } + + late final __objc_msgSend_339Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_339 = __objc_msgSend_339Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_stringByReplacingCharactersInRange_withString_1 = + _registerName1("stringByReplacingCharactersInRange:withString:"); + ffi.Pointer _objc_msgSend_340( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer replacement, + ) { + return __objc_msgSend_340( + obj, + sel, + range, + replacement, + ); + } + + late final __objc_msgSend_340Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_stringByApplyingTransform_reverse_1 = + _registerName1("stringByApplyingTransform:reverse:"); + ffi.Pointer _objc_msgSend_341( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer transform, + bool reverse, + ) { + return __objc_msgSend_341( + obj, + sel, + transform, + reverse, + ); + } + + late final __objc_msgSend_341Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_writeToURL_atomically_encoding_error_1 = + _registerName1("writeToURL:atomically:encoding:error:"); + bool _objc_msgSend_342( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_342( + obj, + sel, + url, + useAuxiliaryFile, + enc, + error, + ); + } + + late final __objc_msgSend_342Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.UnsignedLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); + + late final _sel_writeToFile_atomically_encoding_error_1 = + _registerName1("writeToFile:atomically:encoding:error:"); + bool _objc_msgSend_343( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_343( + obj, + sel, + path, + useAuxiliaryFile, + enc, + error, + ); + } + + late final __objc_msgSend_343Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.UnsignedLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); + + late final _sel_hash1 = _registerName1("hash"); + late final _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); + instancetype _objc_msgSend_344( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_344( + obj, + sel, + characters, + length, + freeBuffer, + ); + } + + late final __objc_msgSend_344Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, bool)>(); + + late final _sel_initWithCharactersNoCopy_length_deallocator_1 = + _registerName1("initWithCharactersNoCopy:length:deallocator:"); + instancetype _objc_msgSend_345( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer chars, + int len, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_345( + obj, + sel, + chars, + len, + deallocator, + ); + } + + late final __objc_msgSend_345Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithCharacters_length_1 = + _registerName1("initWithCharacters:length:"); + instancetype _objc_msgSend_346( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer characters, + int length, + ) { + return __objc_msgSend_346( + obj, + sel, + characters, + length, + ); + } + + late final __objc_msgSend_346Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); + instancetype _objc_msgSend_347( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + ) { + return __objc_msgSend_347( + obj, + sel, + nullTerminatedCString, + ); + } + + late final __objc_msgSend_347Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithFormat_1 = _registerName1("initWithFormat:"); + late final _sel_initWithFormat_arguments_1 = + _registerName1("initWithFormat:arguments:"); + instancetype _objc_msgSend_348( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_348( + obj, + sel, + format, + argList, + ); + } + + late final __objc_msgSend_348Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<__va_list_tag>)>(); + + late final _sel_initWithFormat_locale_1 = + _registerName1("initWithFormat:locale:"); + late final _sel_initWithFormat_locale_arguments_1 = + _registerName1("initWithFormat:locale:arguments:"); + instancetype _objc_msgSend_349( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_349( + obj, + sel, + format, + locale, + argList, + ); + } + + late final __objc_msgSend_349Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_349 = __objc_msgSend_349Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_initWithValidatedFormat_validFormatSpecifiers_error_1 = + _registerName1("initWithValidatedFormat:validFormatSpecifiers:error:"); + instancetype _objc_msgSend_350( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer validFormatSpecifiers, + ffi.Pointer> error, + ) { + return __objc_msgSend_350( + obj, + sel, + format, + validFormatSpecifiers, + error, + ); + } + + late final __objc_msgSend_350Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_350 = __objc_msgSend_350Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1 = + _registerName1( + "initWithValidatedFormat:validFormatSpecifiers:locale:error:"); + instancetype _objc_msgSend_351( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer validFormatSpecifiers, + ffi.Pointer locale, + ffi.Pointer> error, + ) { + return __objc_msgSend_351( + obj, + sel, + format, + validFormatSpecifiers, + locale, + error, + ); + } + + late final __objc_msgSend_351Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_351 = __objc_msgSend_351Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1 = + _registerName1( + "initWithValidatedFormat:validFormatSpecifiers:arguments:error:"); + instancetype _objc_msgSend_352( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer validFormatSpecifiers, + ffi.Pointer<__va_list_tag> argList, + ffi.Pointer> error, + ) { + return __objc_msgSend_352( + obj, + sel, + format, + validFormatSpecifiers, + argList, + error, + ); + } + + late final __objc_msgSend_352Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_352 = __objc_msgSend_352Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>, + ffi.Pointer>)>(); + + late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1 = + _registerName1( + "initWithValidatedFormat:validFormatSpecifiers:locale:arguments:error:"); + instancetype _objc_msgSend_353( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + ffi.Pointer validFormatSpecifiers, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> argList, + ffi.Pointer> error, + ) { + return __objc_msgSend_353( + obj, + sel, + format, + validFormatSpecifiers, + locale, + argList, + error, + ); + } + + late final __objc_msgSend_353Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_353 = __objc_msgSend_353Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>, + ffi.Pointer>)>(); + + late final _sel_initWithData_encoding_1 = + _registerName1("initWithData:encoding:"); + instancetype _objc_msgSend_354( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int encoding, + ) { + return __objc_msgSend_354( + obj, + sel, + data, + encoding, + ); + } + + late final __objc_msgSend_354Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_354 = __objc_msgSend_354Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithBytes_length_encoding_1 = + _registerName1("initWithBytes:length:encoding:"); + instancetype _objc_msgSend_355( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ) { + return __objc_msgSend_355( + obj, + sel, + bytes, + len, + encoding, + ); + } + + late final __objc_msgSend_355Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_355 = __objc_msgSend_355Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); + + late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = + _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); + instancetype _objc_msgSend_356( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + bool freeBuffer, + ) { + return __objc_msgSend_356( + obj, + sel, + bytes, + len, + encoding, + freeBuffer, + ); + } + + late final __objc_msgSend_356Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_356 = __objc_msgSend_356Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, bool)>(); + + late final _sel_initWithBytesNoCopy_length_encoding_deallocator_1 = + _registerName1("initWithBytesNoCopy:length:encoding:deallocator:"); + instancetype _objc_msgSend_357( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int len, + int encoding, + ffi.Pointer<_ObjCBlock> deallocator, + ) { + return __objc_msgSend_357( + obj, + sel, + bytes, + len, + encoding, + deallocator, + ); + } + + late final __objc_msgSend_357Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_357 = __objc_msgSend_357Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_string1 = _registerName1("string"); + late final _sel_stringWithString_1 = _registerName1("stringWithString:"); + late final _sel_stringWithCharacters_length_1 = + _registerName1("stringWithCharacters:length:"); + late final _sel_stringWithUTF8String_1 = + _registerName1("stringWithUTF8String:"); + late final _sel_stringWithFormat_1 = _registerName1("stringWithFormat:"); + late final _sel_localizedStringWithFormat_1 = + _registerName1("localizedStringWithFormat:"); + late final _sel_stringWithValidatedFormat_validFormatSpecifiers_error_1 = + _registerName1("stringWithValidatedFormat:validFormatSpecifiers:error:"); + late final _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1 = + _registerName1( + "localizedStringWithValidatedFormat:validFormatSpecifiers:error:"); + late final _sel_initWithCString_encoding_1 = + _registerName1("initWithCString:encoding:"); + instancetype _objc_msgSend_358( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer nullTerminatedCString, + int encoding, + ) { + return __objc_msgSend_358( + obj, + sel, + nullTerminatedCString, + encoding, + ); + } + + late final __objc_msgSend_358Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_358 = __objc_msgSend_358Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_stringWithCString_encoding_1 = + _registerName1("stringWithCString:encoding:"); + late final _sel_initWithContentsOfURL_encoding_error_1 = + _registerName1("initWithContentsOfURL:encoding:error:"); + instancetype _objc_msgSend_359( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_359( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_359Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_359 = __objc_msgSend_359Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithContentsOfFile_encoding_error_1 = + _registerName1("initWithContentsOfFile:encoding:error:"); + instancetype _objc_msgSend_360( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + int enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_360( + obj, + sel, + path, + enc, + error, + ); + } + + late final __objc_msgSend_360Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_360 = __objc_msgSend_360Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_stringWithContentsOfURL_encoding_error_1 = + _registerName1("stringWithContentsOfURL:encoding:error:"); + late final _sel_stringWithContentsOfFile_encoding_error_1 = + _registerName1("stringWithContentsOfFile:encoding:error:"); + late final _sel_initWithContentsOfURL_usedEncoding_error_1 = + _registerName1("initWithContentsOfURL:usedEncoding:error:"); + instancetype _objc_msgSend_361( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_361( + obj, + sel, + url, + enc, + error, + ); + } + + late final __objc_msgSend_361Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_361 = __objc_msgSend_361Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithContentsOfFile_usedEncoding_error_1 = + _registerName1("initWithContentsOfFile:usedEncoding:error:"); + instancetype _objc_msgSend_362( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer enc, + ffi.Pointer> error, + ) { + return __objc_msgSend_362( + obj, + sel, + path, + enc, + error, + ); + } + + late final __objc_msgSend_362Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_362 = __objc_msgSend_362Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_stringWithContentsOfURL_usedEncoding_error_1 = + _registerName1("stringWithContentsOfURL:usedEncoding:error:"); + late final _sel_stringWithContentsOfFile_usedEncoding_error_1 = + _registerName1("stringWithContentsOfFile:usedEncoding:error:"); + late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1 = + _registerName1( + "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); + int _objc_msgSend_363( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion, + ) { + return __objc_msgSend_363( + obj, + sel, + data, + opts, + string, + usedLossyConversion, + ); + } + + late final __objc_msgSend_363Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_363 = __objc_msgSend_363Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_propertyList1 = _registerName1("propertyList"); + late final _sel_propertyListFromStringsFileFormat1 = + _registerName1("propertyListFromStringsFileFormat"); + late final _sel_cString1 = _registerName1("cString"); + late final _sel_lossyCString1 = _registerName1("lossyCString"); + late final _sel_cStringLength1 = _registerName1("cStringLength"); + late final _sel_getCString_1 = _registerName1("getCString:"); + late final _sel_getCString_maxLength_1 = + _registerName1("getCString:maxLength:"); + void _objc_msgSend_364( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + ) { + return __objc_msgSend_364( + obj, + sel, + bytes, + maxLength, + ); + } + + late final __objc_msgSend_364Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_364 = __objc_msgSend_364Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_getCString_maxLength_range_remainingRange_1 = + _registerName1("getCString:maxLength:range:remainingRange:"); + void _objc_msgSend_365( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int maxLength, + _NSRange aRange, + ffi.Pointer<_NSRange> leftoverRange, + ) { + return __objc_msgSend_365( + obj, + sel, + bytes, + maxLength, + aRange, + leftoverRange, + ); + } + + late final __objc_msgSend_365Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + _NSRange, + ffi.Pointer<_NSRange>)>>('objc_msgSend'); + late final __objc_msgSend_365 = __objc_msgSend_365Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange, ffi.Pointer<_NSRange>)>(); + + late final _sel_stringWithContentsOfFile_1 = + _registerName1("stringWithContentsOfFile:"); + late final _sel_stringWithContentsOfURL_1 = + _registerName1("stringWithContentsOfURL:"); + late final _sel_initWithCStringNoCopy_length_freeWhenDone_1 = + _registerName1("initWithCStringNoCopy:length:freeWhenDone:"); + ffi.Pointer _objc_msgSend_366( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + int length, + bool freeBuffer, + ) { + return __objc_msgSend_366( + obj, + sel, + bytes, + length, + freeBuffer, + ); + } + + late final __objc_msgSend_366Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_366 = __objc_msgSend_366Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_initWithCString_length_1 = + _registerName1("initWithCString:length:"); + late final _sel_initWithCString_1 = _registerName1("initWithCString:"); + late final _sel_stringWithCString_length_1 = + _registerName1("stringWithCString:length:"); + late final _sel_stringWithCString_1 = _registerName1("stringWithCString:"); + late final _sel_getCharacters_1 = _registerName1("getCharacters:"); + void _objc_msgSend_367( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + ) { + return __objc_msgSend_367( + obj, + sel, + buffer, + ); + } + + late final __objc_msgSend_367Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_367 = __objc_msgSend_367Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_variantFittingPresentationWidth_1 = + _registerName1("variantFittingPresentationWidth:"); + ffi.Pointer _objc_msgSend_368( + ffi.Pointer obj, + ffi.Pointer sel, + int width, + ) { + return __objc_msgSend_368( + obj, + sel, + width, + ); + } + + late final __objc_msgSend_368Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_368 = __objc_msgSend_368Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_pathWithComponents_1 = _registerName1("pathWithComponents:"); + ffi.Pointer _objc_msgSend_369( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer components, + ) { + return __objc_msgSend_369( + obj, + sel, + components, + ); + } + + late final __objc_msgSend_369Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_369 = __objc_msgSend_369Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isAbsolutePath1 = _registerName1("isAbsolutePath"); + late final _sel_stringByDeletingLastPathComponent1 = + _registerName1("stringByDeletingLastPathComponent"); + late final _sel_stringByAppendingPathComponent_1 = + _registerName1("stringByAppendingPathComponent:"); + late final _sel_stringByDeletingPathExtension1 = + _registerName1("stringByDeletingPathExtension"); + late final _sel_stringByAppendingPathExtension_1 = + _registerName1("stringByAppendingPathExtension:"); + late final _sel_stringByAbbreviatingWithTildeInPath1 = + _registerName1("stringByAbbreviatingWithTildeInPath"); + late final _sel_stringByExpandingTildeInPath1 = + _registerName1("stringByExpandingTildeInPath"); + late final _sel_stringByStandardizingPath1 = + _registerName1("stringByStandardizingPath"); + late final _sel_stringByResolvingSymlinksInPath1 = + _registerName1("stringByResolvingSymlinksInPath"); + late final _sel_stringsByAppendingPaths_1 = + _registerName1("stringsByAppendingPaths:"); + late final _sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1 = + _registerName1( + "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:"); + int _objc_msgSend_370( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> outputName, + bool flag, + ffi.Pointer> outputArray, + ffi.Pointer filterTypes, + ) { + return __objc_msgSend_370( + obj, + sel, + outputName, + flag, + outputArray, + filterTypes, + ); + } + + late final __objc_msgSend_370Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Bool, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_370 = __objc_msgSend_370Ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + bool, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_stringByAddingPercentEncodingWithAllowedCharacters_1 = + _registerName1("stringByAddingPercentEncodingWithAllowedCharacters:"); + late final _sel_stringByRemovingPercentEncoding1 = + _registerName1("stringByRemovingPercentEncoding"); + late final _sel_stringByAddingPercentEscapesUsingEncoding_1 = + _registerName1("stringByAddingPercentEscapesUsingEncoding:"); + late final _sel_stringByReplacingPercentEscapesUsingEncoding_1 = + _registerName1("stringByReplacingPercentEscapesUsingEncoding:"); + late final _class_NSOrthography1 = _getClass1("NSOrthography"); + late final _sel_dominantScript1 = _registerName1("dominantScript"); + late final _sel_languageMap1 = _registerName1("languageMap"); + late final _sel_initWithDominantScript_languageMap_1 = + _registerName1("initWithDominantScript:languageMap:"); + instancetype _objc_msgSend_371( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer script, + ffi.Pointer map, + ) { + return __objc_msgSend_371( + obj, + sel, + script, + map, + ); + } + + late final __objc_msgSend_371Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_371 = __objc_msgSend_371Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_languagesForScript_1 = _registerName1("languagesForScript:"); + late final _sel_dominantLanguageForScript_1 = + _registerName1("dominantLanguageForScript:"); + late final _sel_dominantLanguage1 = _registerName1("dominantLanguage"); + late final _sel_allScripts1 = _registerName1("allScripts"); + late final _sel_allLanguages1 = _registerName1("allLanguages"); + late final _sel_defaultOrthographyForLanguage_1 = + _registerName1("defaultOrthographyForLanguage:"); + late final _sel_orthographyWithDominantScript_languageMap_1 = + _registerName1("orthographyWithDominantScript:languageMap:"); + late final _sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1 = + _registerName1( + "linguisticTagsInRange:scheme:options:orthography:tokenRanges:"); + ffi.Pointer _objc_msgSend_372( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer scheme, + int options, + ffi.Pointer orthography, + ffi.Pointer> tokenRanges, + ) { + return __objc_msgSend_372( + obj, + sel, + range, + scheme, + options, + orthography, + tokenRanges, + ); + } + + late final __objc_msgSend_372Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_372 = __objc_msgSend_372Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1 = + _registerName1( + "enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:"); + void _objc_msgSend_373( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer scheme, + int options, + ffi.Pointer orthography, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_373( + obj, + sel, + range, + scheme, + options, + orthography, + block, + ); + } + + late final __objc_msgSend_373Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_373 = __objc_msgSend_373Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_anyObject1 = _registerName1("anyObject"); + late final _sel_intersectsSet_1 = _registerName1("intersectsSet:"); + bool _objc_msgSend_374( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherSet, + ) { + return __objc_msgSend_374( + obj, + sel, + otherSet, + ); + } + + late final __objc_msgSend_374Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_374 = __objc_msgSend_374Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isEqualToSet_1 = _registerName1("isEqualToSet:"); + late final _sel_isSubsetOfSet_1 = _registerName1("isSubsetOfSet:"); + late final _sel_setByAddingObject_1 = _registerName1("setByAddingObject:"); + ffi.Pointer _objc_msgSend_375( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ) { + return __objc_msgSend_375( + obj, + sel, + anObject, + ); + } + + late final __objc_msgSend_375Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_375 = __objc_msgSend_375Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setByAddingObjectsFromSet_1 = + _registerName1("setByAddingObjectsFromSet:"); + ffi.Pointer _objc_msgSend_376( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_376( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_376Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_376 = __objc_msgSend_376Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setByAddingObjectsFromArray_1 = + _registerName1("setByAddingObjectsFromArray:"); + ffi.Pointer _objc_msgSend_377( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_377( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_377Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_377 = __objc_msgSend_377Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_378( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_378( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_378Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_378 = __objc_msgSend_378Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + void _objc_msgSend_379( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_379( + obj, + sel, + opts, + block, + ); + } + + late final __objc_msgSend_379Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_379 = __objc_msgSend_379Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsPassingTest_1 = _registerName1("objectsPassingTest:"); + ffi.Pointer _objc_msgSend_380( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_380( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_380Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_380 = __objc_msgSend_380Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_objectsWithOptions_passingTest_1 = + _registerName1("objectsWithOptions:passingTest:"); + ffi.Pointer _objc_msgSend_381( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> predicate, + ) { + return __objc_msgSend_381( + obj, + sel, + opts, + predicate, + ); + } + + late final __objc_msgSend_381Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_381 = __objc_msgSend_381Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_set1 = _registerName1("set"); + late final _sel_setWithObject_1 = _registerName1("setWithObject:"); + late final _sel_setWithObjects_count_1 = + _registerName1("setWithObjects:count:"); + late final _sel_setWithObjects_1 = _registerName1("setWithObjects:"); + late final _sel_setWithSet_1 = _registerName1("setWithSet:"); + instancetype _objc_msgSend_382( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_382( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_382Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_382 = __objc_msgSend_382Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setWithArray_1 = _registerName1("setWithArray:"); + late final _sel_initWithSet_1 = _registerName1("initWithSet:"); + late final _sel_initWithSet_copyItems_1 = + _registerName1("initWithSet:copyItems:"); + instancetype _objc_msgSend_383( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + bool flag, + ) { + return __objc_msgSend_383( + obj, + sel, + set1, + flag, + ); + } + + late final __objc_msgSend_383Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_383 = __objc_msgSend_383Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_filteredSetUsingPredicate_1 = + _registerName1("filteredSetUsingPredicate:"); + ffi.Pointer _objc_msgSend_384( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_384( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_384Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_384 = __objc_msgSend_384Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invocationWithMethodSignature_1 = + _registerName1("invocationWithMethodSignature:"); + ffi.Pointer _objc_msgSend_385( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sig, + ) { + return __objc_msgSend_385( + obj, + sel, + sig, + ); + } + + late final __objc_msgSend_385Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_385 = __objc_msgSend_385Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_methodSignature1 = _registerName1("methodSignature"); + ffi.Pointer _objc_msgSend_386( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_386( + obj, + sel, + ); + } + + late final __objc_msgSend_386Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_386 = __objc_msgSend_386Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_retainArguments1 = _registerName1("retainArguments"); + late final _sel_argumentsRetained1 = _registerName1("argumentsRetained"); + late final _sel_target1 = _registerName1("target"); + late final _sel_setTarget_1 = _registerName1("setTarget:"); + void _objc_msgSend_387( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_387( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_387Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_387 = __objc_msgSend_387Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_selector1 = _registerName1("selector"); + ffi.Pointer _objc_msgSend_388( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_388( + obj, + sel, + ); + } + + late final __objc_msgSend_388Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_388 = __objc_msgSend_388Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSelector_1 = _registerName1("setSelector:"); + void _objc_msgSend_389( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_389( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_389Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_389 = __objc_msgSend_389Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getReturnValue_1 = _registerName1("getReturnValue:"); + late final _sel_setReturnValue_1 = _registerName1("setReturnValue:"); + late final _sel_getArgument_atIndex_1 = + _registerName1("getArgument:atIndex:"); + void _objc_msgSend_390( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer argumentLocation, + int idx, + ) { + return __objc_msgSend_390( + obj, + sel, + argumentLocation, + idx, + ); + } + + late final __objc_msgSend_390Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_390 = __objc_msgSend_390Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_setArgument_atIndex_1 = + _registerName1("setArgument:atIndex:"); + late final _sel_invoke1 = _registerName1("invoke"); + late final _sel_invokeWithTarget_1 = _registerName1("invokeWithTarget:"); + late final _sel_invokeUsingIMP_1 = _registerName1("invokeUsingIMP:"); + void _objc_msgSend_391( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> imp, + ) { + return __objc_msgSend_391( + obj, + sel, + imp, + ); + } + + late final __objc_msgSend_391Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>( + 'objc_msgSend'); + late final __objc_msgSend_391 = __objc_msgSend_391Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_forwardInvocation_1 = _registerName1("forwardInvocation:"); + void _objc_msgSend_392( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anInvocation, + ) { + return __objc_msgSend_392( + obj, + sel, + anInvocation, + ); + } + + late final __objc_msgSend_392Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_392 = __objc_msgSend_392Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_methodSignatureForSelector_1 = + _registerName1("methodSignatureForSelector:"); + ffi.Pointer _objc_msgSend_393( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ) { + return __objc_msgSend_393( + obj, + sel, + aSelector, + ); + } + + late final __objc_msgSend_393Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_393 = __objc_msgSend_393Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_instanceMethodSignatureForSelector_1 = + _registerName1("instanceMethodSignatureForSelector:"); + late final _sel_allowsWeakReference1 = _registerName1("allowsWeakReference"); + late final _sel_retainWeakReference1 = _registerName1("retainWeakReference"); + late final _sel_isSubclassOfClass_1 = _registerName1("isSubclassOfClass:"); + late final _sel_resolveClassMethod_1 = _registerName1("resolveClassMethod:"); + late final _sel_resolveInstanceMethod_1 = + _registerName1("resolveInstanceMethod:"); + late final _sel_superclass1 = _registerName1("superclass"); + late final _sel_class1 = _registerName1("class"); + late final _sel_debugDescription1 = _registerName1("debugDescription"); + late final _sel_version1 = _registerName1("version"); + late final _sel_setVersion_1 = _registerName1("setVersion:"); + void _objc_msgSend_394( + ffi.Pointer obj, + ffi.Pointer sel, + int aVersion, + ) { + return __objc_msgSend_394( + obj, + sel, + aVersion, + ); + } + + late final __objc_msgSend_394Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_394 = __objc_msgSend_394Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_classForCoder1 = _registerName1("classForCoder"); + late final _sel_replacementObjectForCoder_1 = + _registerName1("replacementObjectForCoder:"); + late final _sel_awakeAfterUsingCoder_1 = + _registerName1("awakeAfterUsingCoder:"); + late final _sel_poseAsClass_1 = _registerName1("poseAsClass:"); + late final _sel_autoContentAccessingProxy1 = + _registerName1("autoContentAccessingProxy"); + late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1 = + _registerName1( + "attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:"); + void _objc_msgSend_395( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + int recoveryOptionIndex, + ffi.Pointer delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo, + ) { + return __objc_msgSend_395( + obj, + sel, + error, + recoveryOptionIndex, + delegate, + didRecoverSelector, + contextInfo, + ); + } + + late final __objc_msgSend_395Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_395 = __objc_msgSend_395Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attemptRecoveryFromError_optionIndex_1 = + _registerName1("attemptRecoveryFromError:optionIndex:"); + bool _objc_msgSend_396( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer error, + int recoveryOptionIndex, + ) { + return __objc_msgSend_396( + obj, + sel, + error, + recoveryOptionIndex, + ); + } + + late final __objc_msgSend_396Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_396 = __objc_msgSend_396Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_performSelector_withObject_afterDelay_inModes_1 = + _registerName1("performSelector:withObject:afterDelay:inModes:"); + void _objc_msgSend_397( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + double delay, + ffi.Pointer modes, + ) { + return __objc_msgSend_397( + obj, + sel, + aSelector, + anArgument, + delay, + modes, + ); + } + + late final __objc_msgSend_397Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_397 = __objc_msgSend_397Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); + + late final _sel_performSelector_withObject_afterDelay_1 = + _registerName1("performSelector:withObject:afterDelay:"); + void _objc_msgSend_398( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer anArgument, + double delay, + ) { + return __objc_msgSend_398( + obj, + sel, + aSelector, + anArgument, + delay, + ); + } + + late final __objc_msgSend_398Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_398 = __objc_msgSend_398Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_URL_resourceDataDidBecomeAvailable_1 = + _registerName1("URL:resourceDataDidBecomeAvailable:"); + void _objc_msgSend_399( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ffi.Pointer newBytes, + ) { + return __objc_msgSend_399( + obj, + sel, + sender, + newBytes, + ); + } + + late final __objc_msgSend_399Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_399 = __objc_msgSend_399Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_URLResourceDidFinishLoading_1 = + _registerName1("URLResourceDidFinishLoading:"); + void _objc_msgSend_400( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ) { + return __objc_msgSend_400( + obj, + sel, + sender, + ); + } + + late final __objc_msgSend_400Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_400 = __objc_msgSend_400Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLResourceDidCancelLoading_1 = + _registerName1("URLResourceDidCancelLoading:"); + late final _sel_URL_resourceDidFailLoadingWithReason_1 = + _registerName1("URL:resourceDidFailLoadingWithReason:"); + void _objc_msgSend_401( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer sender, + ffi.Pointer reason, + ) { + return __objc_msgSend_401( + obj, + sel, + sender, + reason, + ); + } + + late final __objc_msgSend_401Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_401 = __objc_msgSend_401Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSFileManager1 = _getClass1("NSFileManager"); + late final _sel_defaultManager1 = _registerName1("defaultManager"); + ffi.Pointer _objc_msgSend_402( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_402( + obj, + sel, + ); + } + + late final __objc_msgSend_402Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_402 = __objc_msgSend_402Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1 = + _registerName1( + "mountedVolumeURLsIncludingResourceValuesForKeys:options:"); + ffi.Pointer _objc_msgSend_403( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer propertyKeys, + int options, + ) { + return __objc_msgSend_403( + obj, + sel, + propertyKeys, + options, + ); + } + + late final __objc_msgSend_403Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_403 = __objc_msgSend_403Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_unmountVolumeAtURL_options_completionHandler_1 = + _registerName1("unmountVolumeAtURL:options:completionHandler:"); + void _objc_msgSend_404( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int mask, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_404( + obj, + sel, + url, + mask, + completionHandler, + ); + } + + late final __objc_msgSend_404Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_404 = __objc_msgSend_404Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1 = + _registerName1( + "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); + ffi.Pointer _objc_msgSend_405( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer keys, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_405( + obj, + sel, + url, + keys, + mask, + error, + ); + } + + late final __objc_msgSend_405Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_405 = __objc_msgSend_405Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_URLsForDirectory_inDomains_1 = + _registerName1("URLsForDirectory:inDomains:"); + ffi.Pointer _objc_msgSend_406( + ffi.Pointer obj, + ffi.Pointer sel, + int directory, + int domainMask, + ) { + return __objc_msgSend_406( + obj, + sel, + directory, + domainMask, + ); + } + + late final __objc_msgSend_406Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_406 = __objc_msgSend_406Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_1 = + _registerName1( + "URLForDirectory:inDomain:appropriateForURL:create:error:"); + ffi.Pointer _objc_msgSend_407( + ffi.Pointer obj, + ffi.Pointer sel, + int directory, + int domain, + ffi.Pointer url, + bool shouldCreate, + ffi.Pointer> error, + ) { + return __objc_msgSend_407( + obj, + sel, + directory, + domain, + url, + shouldCreate, + error, + ); + } + + late final __objc_msgSend_407Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_407 = __objc_msgSend_407Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + + late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1 = + _registerName1("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); + bool _objc_msgSend_408( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer outRelationship, + ffi.Pointer directoryURL, + ffi.Pointer otherURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_408( + obj, + sel, + outRelationship, + directoryURL, + otherURL, + error, + ); + } + + late final __objc_msgSend_408Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_408 = __objc_msgSend_408Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1 = + _registerName1("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); + bool _objc_msgSend_409( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer outRelationship, + int directory, + int domainMask, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_409( + obj, + sel, + outRelationship, + directory, + domainMask, + url, + error, + ); + } + + late final __objc_msgSend_409Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_409 = __objc_msgSend_409Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1 = + _registerName1( + "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); + bool _objc_msgSend_410( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + bool createIntermediates, + ffi.Pointer attributes, + ffi.Pointer> error, + ) { + return __objc_msgSend_410( + obj, + sel, + url, + createIntermediates, + attributes, + error, + ); + } + + late final __objc_msgSend_410Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_410 = __objc_msgSend_410Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_1 = + _registerName1("createSymbolicLinkAtURL:withDestinationURL:error:"); + bool _objc_msgSend_411( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer destURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_411( + obj, + sel, + url, + destURL, + error, + ); + } + + late final __objc_msgSend_411Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_411 = __objc_msgSend_411Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_delegate1 = _registerName1("delegate"); + late final _sel_setDelegate_1 = _registerName1("setDelegate:"); + late final _sel_setAttributes_ofItemAtPath_error_1 = + _registerName1("setAttributes:ofItemAtPath:error:"); + bool _objc_msgSend_412( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attributes, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_412( + obj, + sel, + attributes, + path, + error, + ); + } + + late final __objc_msgSend_412Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_412 = __objc_msgSend_412Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1 = + _registerName1( + "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); + bool _objc_msgSend_413( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool createIntermediates, + ffi.Pointer attributes, + ffi.Pointer> error, + ) { + return __objc_msgSend_413( + obj, + sel, + path, + createIntermediates, + attributes, + error, + ); + } + + late final __objc_msgSend_413Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_413 = __objc_msgSend_413Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_contentsOfDirectoryAtPath_error_1 = + _registerName1("contentsOfDirectoryAtPath:error:"); + ffi.Pointer _objc_msgSend_414( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_414( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_414Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_414 = __objc_msgSend_414Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_subpathsOfDirectoryAtPath_error_1 = + _registerName1("subpathsOfDirectoryAtPath:error:"); + late final _sel_attributesOfItemAtPath_error_1 = + _registerName1("attributesOfItemAtPath:error:"); + ffi.Pointer _objc_msgSend_415( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_415( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_415Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_415 = __objc_msgSend_415Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_attributesOfFileSystemForPath_error_1 = + _registerName1("attributesOfFileSystemForPath:error:"); + late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_1 = + _registerName1("createSymbolicLinkAtPath:withDestinationPath:error:"); + bool _objc_msgSend_416( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer destPath, + ffi.Pointer> error, + ) { + return __objc_msgSend_416( + obj, + sel, + path, + destPath, + error, + ); + } + + late final __objc_msgSend_416Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_416 = __objc_msgSend_416Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_destinationOfSymbolicLinkAtPath_error_1 = + _registerName1("destinationOfSymbolicLinkAtPath:error:"); + ffi.Pointer _objc_msgSend_417( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_417( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_417Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_417 = __objc_msgSend_417Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_copyItemAtPath_toPath_error_1 = + _registerName1("copyItemAtPath:toPath:error:"); + late final _sel_moveItemAtPath_toPath_error_1 = + _registerName1("moveItemAtPath:toPath:error:"); + late final _sel_linkItemAtPath_toPath_error_1 = + _registerName1("linkItemAtPath:toPath:error:"); + late final _sel_removeItemAtPath_error_1 = + _registerName1("removeItemAtPath:error:"); + bool _objc_msgSend_418( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer> error, + ) { + return __objc_msgSend_418( + obj, + sel, + path, + error, + ); + } + + late final __objc_msgSend_418Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_418 = __objc_msgSend_418Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_copyItemAtURL_toURL_error_1 = + _registerName1("copyItemAtURL:toURL:error:"); + late final _sel_moveItemAtURL_toURL_error_1 = + _registerName1("moveItemAtURL:toURL:error:"); + late final _sel_linkItemAtURL_toURL_error_1 = + _registerName1("linkItemAtURL:toURL:error:"); + late final _sel_removeItemAtURL_error_1 = + _registerName1("removeItemAtURL:error:"); + late final _sel_trashItemAtURL_resultingItemURL_error_1 = + _registerName1("trashItemAtURL:resultingItemURL:error:"); + bool _objc_msgSend_419( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_419( + obj, + sel, + url, + outResultingURL, + error, + ); + } + + late final __objc_msgSend_419Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_419 = __objc_msgSend_419Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_fileAttributesAtPath_traverseLink_1 = + _registerName1("fileAttributesAtPath:traverseLink:"); + ffi.Pointer _objc_msgSend_420( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool yorn, + ) { + return __objc_msgSend_420( + obj, + sel, + path, + yorn, + ); + } + + late final __objc_msgSend_420Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_420 = __objc_msgSend_420Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_changeFileAttributes_atPath_1 = + _registerName1("changeFileAttributes:atPath:"); + bool _objc_msgSend_421( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attributes, + ffi.Pointer path, + ) { + return __objc_msgSend_421( + obj, + sel, + attributes, + path, + ); + } + + late final __objc_msgSend_421Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_421 = __objc_msgSend_421Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_directoryContentsAtPath_1 = + _registerName1("directoryContentsAtPath:"); + late final _sel_fileSystemAttributesAtPath_1 = + _registerName1("fileSystemAttributesAtPath:"); + late final _sel_pathContentOfSymbolicLinkAtPath_1 = + _registerName1("pathContentOfSymbolicLinkAtPath:"); + late final _sel_createSymbolicLinkAtPath_pathContent_1 = + _registerName1("createSymbolicLinkAtPath:pathContent:"); + bool _objc_msgSend_422( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer otherpath, + ) { + return __objc_msgSend_422( + obj, + sel, + path, + otherpath, + ); + } + + late final __objc_msgSend_422Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_422 = __objc_msgSend_422Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_createDirectoryAtPath_attributes_1 = + _registerName1("createDirectoryAtPath:attributes:"); + bool _objc_msgSend_423( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer attributes, + ) { + return __objc_msgSend_423( + obj, + sel, + path, + attributes, + ); + } + + late final __objc_msgSend_423Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_423 = __objc_msgSend_423Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_linkPath_toPath_handler_1 = + _registerName1("linkPath:toPath:handler:"); + bool _objc_msgSend_424( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer src, + ffi.Pointer dest, + ffi.Pointer handler, + ) { + return __objc_msgSend_424( + obj, + sel, + src, + dest, + handler, + ); + } + + late final __objc_msgSend_424Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_424 = __objc_msgSend_424Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_copyPath_toPath_handler_1 = + _registerName1("copyPath:toPath:handler:"); + late final _sel_movePath_toPath_handler_1 = + _registerName1("movePath:toPath:handler:"); + late final _sel_removeFileAtPath_handler_1 = + _registerName1("removeFileAtPath:handler:"); + bool _objc_msgSend_425( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer handler, + ) { + return __objc_msgSend_425( + obj, + sel, + path, + handler, + ); + } + + late final __objc_msgSend_425Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_425 = __objc_msgSend_425Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentDirectoryPath1 = + _registerName1("currentDirectoryPath"); + late final _sel_changeCurrentDirectoryPath_1 = + _registerName1("changeCurrentDirectoryPath:"); + late final _sel_fileExistsAtPath_1 = _registerName1("fileExistsAtPath:"); + late final _sel_fileExistsAtPath_isDirectory_1 = + _registerName1("fileExistsAtPath:isDirectory:"); + bool _objc_msgSend_426( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer isDirectory, + ) { + return __objc_msgSend_426( + obj, + sel, + path, + isDirectory, + ); + } + + late final __objc_msgSend_426Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_426 = __objc_msgSend_426Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isReadableFileAtPath_1 = + _registerName1("isReadableFileAtPath:"); + late final _sel_isWritableFileAtPath_1 = + _registerName1("isWritableFileAtPath:"); + late final _sel_isExecutableFileAtPath_1 = + _registerName1("isExecutableFileAtPath:"); + late final _sel_isDeletableFileAtPath_1 = + _registerName1("isDeletableFileAtPath:"); + late final _sel_contentsEqualAtPath_andPath_1 = + _registerName1("contentsEqualAtPath:andPath:"); + late final _sel_displayNameAtPath_1 = _registerName1("displayNameAtPath:"); + late final _sel_componentsToDisplayForPath_1 = + _registerName1("componentsToDisplayForPath:"); + late final _sel_enumeratorAtPath_1 = _registerName1("enumeratorAtPath:"); + late final _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_1 = + _registerName1( + "enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:"); + ffi.Pointer _objc_msgSend_427( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer keys, + int mask, + ffi.Pointer<_ObjCBlock> handler, + ) { + return __objc_msgSend_427( + obj, + sel, + url, + keys, + mask, + handler, + ); + } + + late final __objc_msgSend_427Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_427 = __objc_msgSend_427Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_subpathsAtPath_1 = _registerName1("subpathsAtPath:"); + late final _sel_contentsAtPath_1 = _registerName1("contentsAtPath:"); + ffi.Pointer _objc_msgSend_428( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_428( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_428Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_428 = __objc_msgSend_428Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_createFileAtPath_contents_attributes_1 = + _registerName1("createFileAtPath:contents:attributes:"); + bool _objc_msgSend_429( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer data, + ffi.Pointer attr, + ) { + return __objc_msgSend_429( + obj, + sel, + path, + data, + attr, + ); + } + + late final __objc_msgSend_429Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_429 = __objc_msgSend_429Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileSystemRepresentationWithPath_1 = + _registerName1("fileSystemRepresentationWithPath:"); + ffi.Pointer _objc_msgSend_430( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_430( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_430Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_430 = __objc_msgSend_430Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_stringWithFileSystemRepresentation_length_1 = + _registerName1("stringWithFileSystemRepresentation:length:"); + ffi.Pointer _objc_msgSend_431( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + int len, + ) { + return __objc_msgSend_431( + obj, + sel, + str, + len, + ); + } + + late final __objc_msgSend_431Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_431 = __objc_msgSend_431Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_1 = + _registerName1( + "replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:"); + bool _objc_msgSend_432( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer originalItemURL, + ffi.Pointer newItemURL, + ffi.Pointer backupItemName, + int options, + ffi.Pointer> resultingURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_432( + obj, + sel, + originalItemURL, + newItemURL, + backupItemName, + options, + resultingURL, + error, + ); + } + + late final __objc_msgSend_432Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_432 = __objc_msgSend_432Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_setUbiquitous_itemAtURL_destinationURL_error_1 = + _registerName1("setUbiquitous:itemAtURL:destinationURL:error:"); + bool _objc_msgSend_433( + ffi.Pointer obj, + ffi.Pointer sel, + bool flag, + ffi.Pointer url, + ffi.Pointer destinationURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_433( + obj, + sel, + flag, + url, + destinationURL, + error, + ); + } + + late final __objc_msgSend_433Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_433 = __objc_msgSend_433Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isUbiquitousItemAtURL_1 = + _registerName1("isUbiquitousItemAtURL:"); + late final _sel_startDownloadingUbiquitousItemAtURL_error_1 = + _registerName1("startDownloadingUbiquitousItemAtURL:error:"); + late final _sel_evictUbiquitousItemAtURL_error_1 = + _registerName1("evictUbiquitousItemAtURL:error:"); + late final _sel_URLForUbiquityContainerIdentifier_1 = + _registerName1("URLForUbiquityContainerIdentifier:"); + late final _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_1 = + _registerName1( + "URLForPublishingUbiquitousItemAtURL:expirationDate:error:"); + ffi.Pointer _objc_msgSend_434( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> outDate, + ffi.Pointer> error, + ) { + return __objc_msgSend_434( + obj, + sel, + url, + outDate, + error, + ); + } + + late final __objc_msgSend_434Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_434 = __objc_msgSend_434Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_ubiquityIdentityToken1 = + _registerName1("ubiquityIdentityToken"); + late final _sel_getFileProviderServicesForItemAtURL_completionHandler_1 = + _registerName1("getFileProviderServicesForItemAtURL:completionHandler:"); + void _objc_msgSend_435( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_435( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_435Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_435 = __objc_msgSend_435Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_containerURLForSecurityApplicationGroupIdentifier_1 = + _registerName1("containerURLForSecurityApplicationGroupIdentifier:"); + late final _sel_homeDirectoryForCurrentUser1 = + _registerName1("homeDirectoryForCurrentUser"); + late final _sel_temporaryDirectory1 = _registerName1("temporaryDirectory"); + late final _sel_homeDirectoryForUser_1 = + _registerName1("homeDirectoryForUser:"); + late final _sel_fileManager_shouldProceedAfterError_1 = + _registerName1("fileManager:shouldProceedAfterError:"); + bool _objc_msgSend_436( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fm, + ffi.Pointer errorInfo, + ) { + return __objc_msgSend_436( + obj, + sel, + fm, + errorInfo, + ); + } + + late final __objc_msgSend_436Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_436 = __objc_msgSend_436Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileManager_willProcessPath_1 = + _registerName1("fileManager:willProcessPath:"); + void _objc_msgSend_437( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fm, + ffi.Pointer path, + ) { + return __objc_msgSend_437( + obj, + sel, + fm, + path, + ); + } + + late final __objc_msgSend_437Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_437 = __objc_msgSend_437Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_validateValue_forKey_error_1 = + _registerName1("validateValue:forKey:error:"); + late final _class_NSMutableArray1 = _getClass1("NSMutableArray"); + late final _sel_addObject_1 = _registerName1("addObject:"); + late final _sel_insertObject_atIndex_1 = + _registerName1("insertObject:atIndex:"); + void _objc_msgSend_438( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + int index, + ) { + return __objc_msgSend_438( + obj, + sel, + anObject, + index, + ); + } + + late final __objc_msgSend_438Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_438 = __objc_msgSend_438Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeLastObject1 = _registerName1("removeLastObject"); + late final _sel_removeObjectAtIndex_1 = + _registerName1("removeObjectAtIndex:"); + void _objc_msgSend_439( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_439( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_439Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_439 = __objc_msgSend_439Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_replaceObjectAtIndex_withObject_1 = + _registerName1("replaceObjectAtIndex:withObject:"); + void _objc_msgSend_440( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer anObject, + ) { + return __objc_msgSend_440( + obj, + sel, + index, + anObject, + ); + } + + late final __objc_msgSend_440Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_440 = __objc_msgSend_440Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_initWithCapacity_1 = _registerName1("initWithCapacity:"); + late final _sel_addObjectsFromArray_1 = + _registerName1("addObjectsFromArray:"); + void _objc_msgSend_441( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_441( + obj, + sel, + otherArray, + ); + } + + late final __objc_msgSend_441Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_441 = __objc_msgSend_441Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = + _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); + void _objc_msgSend_442( + ffi.Pointer obj, + ffi.Pointer sel, + int idx1, + int idx2, + ) { + return __objc_msgSend_442( + obj, + sel, + idx1, + idx2, + ); + } + + late final __objc_msgSend_442Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_442 = __objc_msgSend_442Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_removeAllObjects1 = _registerName1("removeAllObjects"); + late final _sel_removeObject_inRange_1 = + _registerName1("removeObject:inRange:"); + void _objc_msgSend_443( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + _NSRange range, + ) { + return __objc_msgSend_443( + obj, + sel, + anObject, + range, + ); + } + + late final __objc_msgSend_443Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_443 = __objc_msgSend_443Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + late final _sel_removeObject_1 = _registerName1("removeObject:"); + late final _sel_removeObjectIdenticalTo_inRange_1 = + _registerName1("removeObjectIdenticalTo:inRange:"); + late final _sel_removeObjectIdenticalTo_1 = + _registerName1("removeObjectIdenticalTo:"); + late final _sel_removeObjectsFromIndices_numIndices_1 = + _registerName1("removeObjectsFromIndices:numIndices:"); + void _objc_msgSend_444( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indices, + int cnt, + ) { + return __objc_msgSend_444( + obj, + sel, + indices, + cnt, + ); + } + + late final __objc_msgSend_444Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_444 = __objc_msgSend_444Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeObjectsInArray_1 = + _registerName1("removeObjectsInArray:"); + late final _sel_removeObjectsInRange_1 = + _registerName1("removeObjectsInRange:"); + void _objc_msgSend_445( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_445( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_445Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_445 = __objc_msgSend_445Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); + void _objc_msgSend_446( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer otherArray, + _NSRange otherRange, + ) { + return __objc_msgSend_446( + obj, + sel, + range, + otherArray, + otherRange, + ); + } + + late final __objc_msgSend_446Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_446 = __objc_msgSend_446Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer, _NSRange)>(); + + late final _sel_replaceObjectsInRange_withObjectsFromArray_1 = + _registerName1("replaceObjectsInRange:withObjectsFromArray:"); + void _objc_msgSend_447( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer otherArray, + ) { + return __objc_msgSend_447( + obj, + sel, + range, + otherArray, + ); + } + + late final __objc_msgSend_447Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_447 = __objc_msgSend_447Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer)>(); + + late final _sel_setArray_1 = _registerName1("setArray:"); + late final _sel_sortUsingFunction_context_1 = + _registerName1("sortUsingFunction:context:"); + void _objc_msgSend_448( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context, + ) { + return __objc_msgSend_448( + obj, + sel, + compare, + context, + ); + } + + late final __objc_msgSend_448Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_448 = __objc_msgSend_448Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); + + late final _sel_sortUsingSelector_1 = _registerName1("sortUsingSelector:"); + late final _sel_insertObjects_atIndexes_1 = + _registerName1("insertObjects:atIndexes:"); + void _objc_msgSend_449( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objects, + ffi.Pointer indexes, + ) { + return __objc_msgSend_449( + obj, + sel, + objects, + indexes, + ); + } + + late final __objc_msgSend_449Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_449 = __objc_msgSend_449Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeObjectsAtIndexes_1 = + _registerName1("removeObjectsAtIndexes:"); + void _objc_msgSend_450( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_450( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_450Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_450 = __objc_msgSend_450Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_replaceObjectsAtIndexes_withObjects_1 = + _registerName1("replaceObjectsAtIndexes:withObjects:"); + void _objc_msgSend_451( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ffi.Pointer objects, + ) { + return __objc_msgSend_451( + obj, + sel, + indexes, + objects, + ); + } + + late final __objc_msgSend_451Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_451 = __objc_msgSend_451Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setObject_atIndexedSubscript_1 = + _registerName1("setObject:atIndexedSubscript:"); + late final _sel_sortUsingComparator_1 = + _registerName1("sortUsingComparator:"); + void _objc_msgSend_452( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> cmptr, + ) { + return __objc_msgSend_452( + obj, + sel, + cmptr, + ); + } + + late final __objc_msgSend_452Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_452 = __objc_msgSend_452Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sortWithOptions_usingComparator_1 = + _registerName1("sortWithOptions:usingComparator:"); + void _objc_msgSend_453( + ffi.Pointer obj, + ffi.Pointer sel, + int opts, + ffi.Pointer<_ObjCBlock> cmptr, + ) { + return __objc_msgSend_453( + obj, + sel, + opts, + cmptr, + ); + } + + late final __objc_msgSend_453Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_453 = __objc_msgSend_453Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_arrayWithCapacity_1 = _registerName1("arrayWithCapacity:"); + ffi.Pointer _objc_msgSend_454( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_454( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_454Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_454 = __objc_msgSend_454Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_455( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_455( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_455Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_455 = __objc_msgSend_455Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_applyDifference_1 = _registerName1("applyDifference:"); + late final _sel_sortUsingDescriptors_1 = + _registerName1("sortUsingDescriptors:"); + late final _sel_filterUsingPredicate_1 = + _registerName1("filterUsingPredicate:"); + void _objc_msgSend_456( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer predicate, + ) { + return __objc_msgSend_456( + obj, + sel, + predicate, + ); + } + + late final __objc_msgSend_456Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_456 = __objc_msgSend_456Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_mutableArrayValueForKey_1 = + _registerName1("mutableArrayValueForKey:"); + late final _class_NSMutableOrderedSet1 = _getClass1("NSMutableOrderedSet"); + late final _class_NSOrderedSet1 = _getClass1("NSOrderedSet"); + late final _sel_isEqualToOrderedSet_1 = + _registerName1("isEqualToOrderedSet:"); + bool _objc_msgSend_457( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_457( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_457Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_457 = __objc_msgSend_457Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_intersectsOrderedSet_1 = + _registerName1("intersectsOrderedSet:"); + late final _sel_isSubsetOfOrderedSet_1 = + _registerName1("isSubsetOfOrderedSet:"); + late final _sel_reversedOrderedSet1 = _registerName1("reversedOrderedSet"); + ffi.Pointer _objc_msgSend_458( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_458( + obj, + sel, + ); + } + + late final __objc_msgSend_458Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_458 = __objc_msgSend_458Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_orderedSet1 = _registerName1("orderedSet"); + late final _sel_orderedSetWithObject_1 = + _registerName1("orderedSetWithObject:"); + late final _sel_orderedSetWithObjects_count_1 = + _registerName1("orderedSetWithObjects:count:"); + late final _sel_orderedSetWithObjects_1 = + _registerName1("orderedSetWithObjects:"); + late final _sel_orderedSetWithOrderedSet_1 = + _registerName1("orderedSetWithOrderedSet:"); + instancetype _objc_msgSend_459( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ) { + return __objc_msgSend_459( + obj, + sel, + set1, + ); + } + + late final __objc_msgSend_459Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_459 = __objc_msgSend_459Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_orderedSetWithOrderedSet_range_copyItems_1 = + _registerName1("orderedSetWithOrderedSet:range:copyItems:"); + instancetype _objc_msgSend_460( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + _NSRange range, + bool flag, + ) { + return __objc_msgSend_460( + obj, + sel, + set1, + range, + flag, + ); + } + + late final __objc_msgSend_460Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_460 = __objc_msgSend_460Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange, bool)>(); + + late final _sel_orderedSetWithArray_1 = + _registerName1("orderedSetWithArray:"); + late final _sel_orderedSetWithArray_range_copyItems_1 = + _registerName1("orderedSetWithArray:range:copyItems:"); + instancetype _objc_msgSend_461( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer array, + _NSRange range, + bool flag, + ) { + return __objc_msgSend_461( + obj, + sel, + array, + range, + flag, + ); + } + + late final __objc_msgSend_461Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_461 = __objc_msgSend_461Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange, bool)>(); + + late final _sel_orderedSetWithSet_1 = _registerName1("orderedSetWithSet:"); + late final _sel_orderedSetWithSet_copyItems_1 = + _registerName1("orderedSetWithSet:copyItems:"); + late final _sel_initWithObject_1 = _registerName1("initWithObject:"); + late final _sel_initWithOrderedSet_1 = _registerName1("initWithOrderedSet:"); + late final _sel_initWithOrderedSet_copyItems_1 = + _registerName1("initWithOrderedSet:copyItems:"); + instancetype _objc_msgSend_462( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + bool flag, + ) { + return __objc_msgSend_462( + obj, + sel, + set1, + flag, + ); + } + + late final __objc_msgSend_462Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_462 = __objc_msgSend_462Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_initWithOrderedSet_range_copyItems_1 = + _registerName1("initWithOrderedSet:range:copyItems:"); + late final _sel_initWithArray_range_copyItems_1 = + _registerName1("initWithArray:range:copyItems:"); + late final _sel_differenceFromOrderedSet_withOptions_usingEquivalenceTest_1 = + _registerName1( + "differenceFromOrderedSet:withOptions:usingEquivalenceTest:"); + ffi.Pointer _objc_msgSend_463( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + int options, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_463( + obj, + sel, + other, + options, + block, + ); + } + + late final __objc_msgSend_463Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_463 = __objc_msgSend_463Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_differenceFromOrderedSet_withOptions_1 = + _registerName1("differenceFromOrderedSet:withOptions:"); + ffi.Pointer _objc_msgSend_464( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + int options, + ) { + return __objc_msgSend_464( + obj, + sel, + other, + options, + ); + } + + late final __objc_msgSend_464Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_464 = __objc_msgSend_464Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_differenceFromOrderedSet_1 = + _registerName1("differenceFromOrderedSet:"); + late final _sel_orderedSetByApplyingDifference_1 = + _registerName1("orderedSetByApplyingDifference:"); + ffi.Pointer _objc_msgSend_465( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer difference, + ) { + return __objc_msgSend_465( + obj, + sel, + difference, + ); + } + + late final __objc_msgSend_465Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_465 = __objc_msgSend_465Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_filteredOrderedSetUsingPredicate_1 = + _registerName1("filteredOrderedSetUsingPredicate:"); + ffi.Pointer _objc_msgSend_466( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer p, + ) { + return __objc_msgSend_466( + obj, + sel, + p, + ); + } + + late final __objc_msgSend_466Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_466 = __objc_msgSend_466Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addObjects_count_1 = _registerName1("addObjects:count:"); + void _objc_msgSend_467( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> objects, + int count, + ) { + return __objc_msgSend_467( + obj, + sel, + objects, + count, + ); + } + + late final __objc_msgSend_467Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_467 = __objc_msgSend_467Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>, int)>(); + + late final _sel_moveObjectsAtIndexes_toIndex_1 = + _registerName1("moveObjectsAtIndexes:toIndex:"); + void _objc_msgSend_468( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + int idx, + ) { + return __objc_msgSend_468( + obj, + sel, + indexes, + idx, + ); + } + + late final __objc_msgSend_468Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_468 = __objc_msgSend_468Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_setObject_atIndex_1 = _registerName1("setObject:atIndex:"); + late final _sel_replaceObjectsInRange_withObjects_count_1 = + _registerName1("replaceObjectsInRange:withObjects:count:"); + void _objc_msgSend_469( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer> objects, + int count, + ) { + return __objc_msgSend_469( + obj, + sel, + range, + objects, + count, + ); + } + + late final __objc_msgSend_469Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer>, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_469 = __objc_msgSend_469Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer>, int)>(); + + late final _sel_intersectOrderedSet_1 = + _registerName1("intersectOrderedSet:"); + void _objc_msgSend_470( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_470( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_470Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_470 = __objc_msgSend_470Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_minusOrderedSet_1 = _registerName1("minusOrderedSet:"); + late final _sel_unionOrderedSet_1 = _registerName1("unionOrderedSet:"); + late final _sel_intersectSet_1 = _registerName1("intersectSet:"); + void _objc_msgSend_471( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_471( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_471Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_471 = __objc_msgSend_471Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_minusSet_1 = _registerName1("minusSet:"); + late final _sel_unionSet_1 = _registerName1("unionSet:"); + late final _sel_sortRange_options_usingComparator_1 = + _registerName1("sortRange:options:usingComparator:"); + void _objc_msgSend_472( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + int opts, + ffi.Pointer<_ObjCBlock> cmptr, + ) { + return __objc_msgSend_472( + obj, + sel, + range, + opts, + cmptr, + ); + } + + late final __objc_msgSend_472Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_472 = __objc_msgSend_472Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_orderedSetWithCapacity_1 = + _registerName1("orderedSetWithCapacity:"); + late final _sel_mutableOrderedSetValueForKey_1 = + _registerName1("mutableOrderedSetValueForKey:"); + ffi.Pointer _objc_msgSend_473( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_473( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_473Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_473 = __objc_msgSend_473Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSMutableSet1 = _getClass1("NSMutableSet"); + late final _sel_setSet_1 = _registerName1("setSet:"); + late final _sel_setWithCapacity_1 = _registerName1("setWithCapacity:"); + late final _sel_mutableSetValueForKey_1 = + _registerName1("mutableSetValueForKey:"); + ffi.Pointer _objc_msgSend_474( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_474( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_474Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_474 = __objc_msgSend_474Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_valueForKeyPath_1 = _registerName1("valueForKeyPath:"); + late final _sel_setValue_forKeyPath_1 = + _registerName1("setValue:forKeyPath:"); + late final _sel_validateValue_forKeyPath_error_1 = + _registerName1("validateValue:forKeyPath:error:"); + late final _sel_mutableArrayValueForKeyPath_1 = + _registerName1("mutableArrayValueForKeyPath:"); + late final _sel_mutableOrderedSetValueForKeyPath_1 = + _registerName1("mutableOrderedSetValueForKeyPath:"); + late final _sel_mutableSetValueForKeyPath_1 = + _registerName1("mutableSetValueForKeyPath:"); + late final _sel_valueForUndefinedKey_1 = + _registerName1("valueForUndefinedKey:"); + late final _sel_setValue_forUndefinedKey_1 = + _registerName1("setValue:forUndefinedKey:"); + late final _sel_setNilValueForKey_1 = _registerName1("setNilValueForKey:"); + late final _sel_dictionaryWithValuesForKeys_1 = + _registerName1("dictionaryWithValuesForKeys:"); + ffi.Pointer _objc_msgSend_475( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keys, + ) { + return __objc_msgSend_475( + obj, + sel, + keys, + ); + } + + late final __objc_msgSend_475Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_475 = __objc_msgSend_475Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setValuesForKeysWithDictionary_1 = + _registerName1("setValuesForKeysWithDictionary:"); + void _objc_msgSend_476( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyedValues, + ) { + return __objc_msgSend_476( + obj, + sel, + keyedValues, + ); + } + + late final __objc_msgSend_476Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_476 = __objc_msgSend_476Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_storedValueForKey_1 = _registerName1("storedValueForKey:"); + late final _sel_takeStoredValue_forKey_1 = + _registerName1("takeStoredValue:forKey:"); + late final _sel_takeValue_forKey_1 = _registerName1("takeValue:forKey:"); + late final _sel_takeValue_forKeyPath_1 = + _registerName1("takeValue:forKeyPath:"); + late final _sel_handleQueryWithUnboundKey_1 = + _registerName1("handleQueryWithUnboundKey:"); + late final _sel_handleTakeValue_forUnboundKey_1 = + _registerName1("handleTakeValue:forUnboundKey:"); + late final _sel_unableToSetNilForKey_1 = + _registerName1("unableToSetNilForKey:"); + late final _sel_valuesForKeys_1 = _registerName1("valuesForKeys:"); + late final _sel_takeValuesFromDictionary_1 = + _registerName1("takeValuesFromDictionary:"); + late final _sel_observeValueForKeyPath_ofObject_change_context_1 = + _registerName1("observeValueForKeyPath:ofObject:change:context:"); + void _objc_msgSend_477( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyPath, + ffi.Pointer object, + ffi.Pointer change, + ffi.Pointer context, + ) { + return __objc_msgSend_477( + obj, + sel, + keyPath, + object, + change, + context, + ); + } + + late final __objc_msgSend_477Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_477 = __objc_msgSend_477Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_willChangeValueForKey_1 = + _registerName1("willChangeValueForKey:"); + late final _sel_didChangeValueForKey_1 = + _registerName1("didChangeValueForKey:"); + late final _sel_willChange_valuesAtIndexes_forKey_1 = + _registerName1("willChange:valuesAtIndexes:forKey:"); + void _objc_msgSend_478( + ffi.Pointer obj, + ffi.Pointer sel, + int changeKind, + ffi.Pointer indexes, + ffi.Pointer key, + ) { + return __objc_msgSend_478( + obj, + sel, + changeKind, + indexes, + key, + ); + } + + late final __objc_msgSend_478Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_478 = __objc_msgSend_478Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_didChange_valuesAtIndexes_forKey_1 = + _registerName1("didChange:valuesAtIndexes:forKey:"); + late final _sel_willChangeValueForKey_withSetMutation_usingObjects_1 = + _registerName1("willChangeValueForKey:withSetMutation:usingObjects:"); + void _objc_msgSend_479( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + int mutationKind, + ffi.Pointer objects, + ) { + return __objc_msgSend_479( + obj, + sel, + key, + mutationKind, + objects, + ); + } + + late final __objc_msgSend_479Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_479 = __objc_msgSend_479Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_didChangeValueForKey_withSetMutation_usingObjects_1 = + _registerName1("didChangeValueForKey:withSetMutation:usingObjects:"); + late final _sel_observationInfo1 = _registerName1("observationInfo"); + late final _sel_setObservationInfo_1 = _registerName1("setObservationInfo:"); + void _objc_msgSend_480( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_480( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_480Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_480 = __objc_msgSend_480Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_classForKeyedArchiver1 = + _registerName1("classForKeyedArchiver"); + late final _class_NSKeyedArchiver1 = _getClass1("NSKeyedArchiver"); + late final _sel_initRequiringSecureCoding_1 = + _registerName1("initRequiringSecureCoding:"); + instancetype _objc_msgSend_481( + ffi.Pointer obj, + ffi.Pointer sel, + bool requiresSecureCoding, + ) { + return __objc_msgSend_481( + obj, + sel, + requiresSecureCoding, + ); + } + + late final __objc_msgSend_481Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_481 = __objc_msgSend_481Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_archivedDataWithRootObject_requiringSecureCoding_error_1 = + _registerName1("archivedDataWithRootObject:requiringSecureCoding:error:"); + ffi.Pointer _objc_msgSend_482( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + bool requiresSecureCoding, + ffi.Pointer> error, + ) { + return __objc_msgSend_482( + obj, + sel, + object, + requiresSecureCoding, + error, + ); + } + + late final __objc_msgSend_482Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_482 = __objc_msgSend_482Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer>)>(); + + late final _class_NSMutableData1 = _getClass1("NSMutableData"); + late final _sel_mutableBytes1 = _registerName1("mutableBytes"); + late final _sel_setLength_1 = _registerName1("setLength:"); + void _objc_msgSend_483( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_483( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_483Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_483 = __objc_msgSend_483Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_appendBytes_length_1 = _registerName1("appendBytes:length:"); + late final _sel_appendData_1 = _registerName1("appendData:"); + late final _sel_increaseLengthBy_1 = _registerName1("increaseLengthBy:"); + late final _sel_replaceBytesInRange_withBytes_1 = + _registerName1("replaceBytesInRange:withBytes:"); + void _objc_msgSend_484( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer bytes, + ) { + return __objc_msgSend_484( + obj, + sel, + range, + bytes, + ); + } + + late final __objc_msgSend_484Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_484 = __objc_msgSend_484Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer)>(); + + late final _sel_resetBytesInRange_1 = _registerName1("resetBytesInRange:"); + late final _sel_setData_1 = _registerName1("setData:"); + late final _sel_replaceBytesInRange_withBytes_length_1 = + _registerName1("replaceBytesInRange:withBytes:length:"); + void _objc_msgSend_485( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer replacementBytes, + int replacementLength, + ) { + return __objc_msgSend_485( + obj, + sel, + range, + replacementBytes, + replacementLength, + ); + } + + late final __objc_msgSend_485Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_485 = __objc_msgSend_485Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer, int)>(); + + late final _sel_dataWithCapacity_1 = _registerName1("dataWithCapacity:"); + late final _sel_dataWithLength_1 = _registerName1("dataWithLength:"); + late final _sel_initWithLength_1 = _registerName1("initWithLength:"); + late final _sel_decompressUsingAlgorithm_error_1 = + _registerName1("decompressUsingAlgorithm:error:"); + bool _objc_msgSend_486( + ffi.Pointer obj, + ffi.Pointer sel, + int algorithm, + ffi.Pointer> error, + ) { + return __objc_msgSend_486( + obj, + sel, + algorithm, + error, + ); + } + + late final __objc_msgSend_486Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_486 = __objc_msgSend_486Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_compressUsingAlgorithm_error_1 = + _registerName1("compressUsingAlgorithm:error:"); + late final _sel_initForWritingWithMutableData_1 = + _registerName1("initForWritingWithMutableData:"); + instancetype _objc_msgSend_487( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_487( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_487Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_487 = __objc_msgSend_487Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_archivedDataWithRootObject_1 = + _registerName1("archivedDataWithRootObject:"); + ffi.Pointer _objc_msgSend_488( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer rootObject, + ) { + return __objc_msgSend_488( + obj, + sel, + rootObject, + ); + } + + late final __objc_msgSend_488Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_488 = __objc_msgSend_488Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_archiveRootObject_toFile_1 = + _registerName1("archiveRootObject:toFile:"); + late final _sel_outputFormat1 = _registerName1("outputFormat"); + int _objc_msgSend_489( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_489( + obj, + sel, + ); + } + + late final __objc_msgSend_489Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_489 = __objc_msgSend_489Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setOutputFormat_1 = _registerName1("setOutputFormat:"); + void _objc_msgSend_490( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_490( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_490Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_490 = __objc_msgSend_490Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_encodedData1 = _registerName1("encodedData"); + late final _sel_finishEncoding1 = _registerName1("finishEncoding"); + late final _sel_setClassName_forClass_1 = + _registerName1("setClassName:forClass:"); + void _objc_msgSend_491( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer codedName, + ffi.Pointer cls, + ) { + return __objc_msgSend_491( + obj, + sel, + codedName, + cls, + ); + } + + late final __objc_msgSend_491Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_491 = __objc_msgSend_491Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classNameForClass_1 = _registerName1("classNameForClass:"); + late final _sel_setRequiresSecureCoding_1 = + _registerName1("setRequiresSecureCoding:"); + void _objc_msgSend_492( + ffi.Pointer obj, + ffi.Pointer sel, + bool value, + ) { + return __objc_msgSend_492( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_492Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_492 = __objc_msgSend_492Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_replacementObjectForKeyedArchiver_1 = + _registerName1("replacementObjectForKeyedArchiver:"); + ffi.Pointer _objc_msgSend_493( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer archiver, + ) { + return __objc_msgSend_493( + obj, + sel, + archiver, + ); + } + + late final __objc_msgSend_493Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_493 = __objc_msgSend_493Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1 = + _registerName1( + "performSelectorOnMainThread:withObject:waitUntilDone:modes:"); + void _objc_msgSend_494( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer arg, + bool wait, + ffi.Pointer array, + ) { + return __objc_msgSend_494( + obj, + sel, + aSelector, + arg, + wait, + array, + ); + } + + late final __objc_msgSend_494Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_494 = __objc_msgSend_494Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_performSelectorOnMainThread_withObject_waitUntilDone_1 = + _registerName1("performSelectorOnMainThread:withObject:waitUntilDone:"); + void _objc_msgSend_495( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer arg, + bool wait, + ) { + return __objc_msgSend_495( + obj, + sel, + aSelector, + arg, + wait, + ); + } + + late final __objc_msgSend_495Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_495 = __objc_msgSend_495Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _class_NSThread1 = _getClass1("NSThread"); + late final _sel_currentThread1 = _registerName1("currentThread"); + ffi.Pointer _objc_msgSend_496( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_496( + obj, + sel, + ); + } + + late final __objc_msgSend_496Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_496 = __objc_msgSend_496Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_detachNewThreadWithBlock_1 = + _registerName1("detachNewThreadWithBlock:"); + void _objc_msgSend_497( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_497( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_497Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_497 = __objc_msgSend_497Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_detachNewThreadSelector_toTarget_withObject_1 = + _registerName1("detachNewThreadSelector:toTarget:withObject:"); + void _objc_msgSend_498( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer selector, + ffi.Pointer target, + ffi.Pointer argument, + ) { + return __objc_msgSend_498( + obj, + sel, + selector, + target, + argument, + ); + } + + late final __objc_msgSend_498Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_498 = __objc_msgSend_498Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isMultiThreaded1 = _registerName1("isMultiThreaded"); + late final _class_NSMutableDictionary1 = _getClass1("NSMutableDictionary"); + late final _sel_removeObjectForKey_1 = _registerName1("removeObjectForKey:"); + late final _sel_setObject_forKey_1 = _registerName1("setObject:forKey:"); + void _objc_msgSend_499( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ffi.Pointer aKey, + ) { + return __objc_msgSend_499( + obj, + sel, + anObject, + aKey, + ); + } + + late final __objc_msgSend_499Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_499 = __objc_msgSend_499Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addEntriesFromDictionary_1 = + _registerName1("addEntriesFromDictionary:"); + late final _sel_removeObjectsForKeys_1 = + _registerName1("removeObjectsForKeys:"); + late final _sel_setDictionary_1 = _registerName1("setDictionary:"); + late final _sel_setObject_forKeyedSubscript_1 = + _registerName1("setObject:forKeyedSubscript:"); + late final _sel_dictionaryWithCapacity_1 = + _registerName1("dictionaryWithCapacity:"); + ffi.Pointer _objc_msgSend_500( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ) { + return __objc_msgSend_500( + obj, + sel, + path, + ); + } + + late final __objc_msgSend_500Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_500 = __objc_msgSend_500Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_501( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_501( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_501Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_501 = __objc_msgSend_501Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dictionaryWithSharedKeySet_1 = + _registerName1("dictionaryWithSharedKeySet:"); + ffi.Pointer _objc_msgSend_502( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer keyset, + ) { + return __objc_msgSend_502( + obj, + sel, + keyset, + ); + } + + late final __objc_msgSend_502Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_502 = __objc_msgSend_502Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_threadDictionary1 = _registerName1("threadDictionary"); + ffi.Pointer _objc_msgSend_503( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_503( + obj, + sel, + ); + } + + late final __objc_msgSend_503Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_503 = __objc_msgSend_503Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sleepUntilDate_1 = _registerName1("sleepUntilDate:"); + void _objc_msgSend_504( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ) { + return __objc_msgSend_504( + obj, + sel, + date, + ); + } + + late final __objc_msgSend_504Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_504 = __objc_msgSend_504Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sleepForTimeInterval_1 = + _registerName1("sleepForTimeInterval:"); + void _objc_msgSend_505( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ) { + return __objc_msgSend_505( + obj, + sel, + ti, + ); + } + + late final __objc_msgSend_505Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_505 = __objc_msgSend_505Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_exit1 = _registerName1("exit"); + late final _sel_threadPriority1 = _registerName1("threadPriority"); + late final _sel_setThreadPriority_1 = _registerName1("setThreadPriority:"); + void _objc_msgSend_506( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_506( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_506Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_506 = __objc_msgSend_506Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_qualityOfService1 = _registerName1("qualityOfService"); + int _objc_msgSend_507( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_507( + obj, + sel, + ); + } + + late final __objc_msgSend_507Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_507 = __objc_msgSend_507Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setQualityOfService_1 = + _registerName1("setQualityOfService:"); + void _objc_msgSend_508( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_508( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_508Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_508 = __objc_msgSend_508Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_callStackReturnAddresses1 = + _registerName1("callStackReturnAddresses"); + late final _sel_callStackSymbols1 = _registerName1("callStackSymbols"); + late final _sel_setName_1 = _registerName1("setName:"); + void _objc_msgSend_509( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_509( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_509Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_509 = __objc_msgSend_509Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_stackSize1 = _registerName1("stackSize"); + late final _sel_setStackSize_1 = _registerName1("setStackSize:"); + late final _sel_isMainThread1 = _registerName1("isMainThread"); + late final _sel_mainThread1 = _registerName1("mainThread"); + late final _sel_initWithTarget_selector_object_1 = + _registerName1("initWithTarget:selector:object:"); + instancetype _objc_msgSend_510( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer selector, + ffi.Pointer argument, + ) { + return __objc_msgSend_510( + obj, + sel, + target, + selector, + argument, + ); + } + + late final __objc_msgSend_510Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_510 = __objc_msgSend_510Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithBlock_1 = _registerName1("initWithBlock:"); + instancetype _objc_msgSend_511( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_511( + obj, + sel, + block, + ); + } + + late final __objc_msgSend_511Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_511 = __objc_msgSend_511Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_isExecuting1 = _registerName1("isExecuting"); + late final _sel_isFinished1 = _registerName1("isFinished"); + late final _sel_isCancelled1 = _registerName1("isCancelled"); + late final _sel_cancel1 = _registerName1("cancel"); + late final _sel_start1 = _registerName1("start"); + late final _sel_main1 = _registerName1("main"); + late final _sel_performSelector_onThread_withObject_waitUntilDone_modes_1 = + _registerName1( + "performSelector:onThread:withObject:waitUntilDone:modes:"); + void _objc_msgSend_512( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer thr, + ffi.Pointer arg, + bool wait, + ffi.Pointer array, + ) { + return __objc_msgSend_512( + obj, + sel, + aSelector, + thr, + arg, + wait, + array, + ); + } + + late final __objc_msgSend_512Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_512 = __objc_msgSend_512Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>(); + + late final _sel_performSelector_onThread_withObject_waitUntilDone_1 = + _registerName1("performSelector:onThread:withObject:waitUntilDone:"); + void _objc_msgSend_513( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer thr, + ffi.Pointer arg, + bool wait, + ) { + return __objc_msgSend_513( + obj, + sel, + aSelector, + thr, + arg, + wait, + ); + } + + late final __objc_msgSend_513Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_513 = __objc_msgSend_513Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_performSelectorInBackground_withObject_1 = + _registerName1("performSelectorInBackground:withObject:"); + late final _sel_classForArchiver1 = _registerName1("classForArchiver"); + late final _class_NSArchiver1 = _getClass1("NSArchiver"); + late final _sel_archiverData1 = _registerName1("archiverData"); + ffi.Pointer _objc_msgSend_514( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_514( + obj, + sel, + ); + } + + late final __objc_msgSend_514Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_514 = __objc_msgSend_514Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_encodeClassName_intoClassName_1 = + _registerName1("encodeClassName:intoClassName:"); + void _objc_msgSend_515( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer trueName, + ffi.Pointer inArchiveName, + ) { + return __objc_msgSend_515( + obj, + sel, + trueName, + inArchiveName, + ); + } + + late final __objc_msgSend_515Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_515 = __objc_msgSend_515Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classNameEncodedForTrueClassName_1 = + _registerName1("classNameEncodedForTrueClassName:"); + late final _sel_replaceObject_withObject_1 = + _registerName1("replaceObject:withObject:"); + late final _sel_replacementObjectForArchiver_1 = + _registerName1("replacementObjectForArchiver:"); + ffi.Pointer _objc_msgSend_516( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer archiver, + ) { + return __objc_msgSend_516( + obj, + sel, + archiver, + ); + } + + late final __objc_msgSend_516Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_516 = __objc_msgSend_516Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_classForPortCoder1 = _registerName1("classForPortCoder"); + late final _class_NSPortCoder1 = _getClass1("NSPortCoder"); + late final _sel_isBycopy1 = _registerName1("isBycopy"); + late final _sel_isByref1 = _registerName1("isByref"); + late final _class_NSPort1 = _getClass1("NSPort"); + ffi.Pointer _objc_msgSend_517( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_517( + obj, + sel, + ); + } + + late final __objc_msgSend_517Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_517 = __objc_msgSend_517Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invalidate1 = _registerName1("invalidate"); + late final _sel_isValid1 = _registerName1("isValid"); + late final _class_NSRunLoop1 = _getClass1("NSRunLoop"); + late final _sel_currentRunLoop1 = _registerName1("currentRunLoop"); + ffi.Pointer _objc_msgSend_518( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_518( + obj, + sel, + ); + } + + late final __objc_msgSend_518Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_518 = __objc_msgSend_518Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mainRunLoop1 = _registerName1("mainRunLoop"); + late final _sel_currentMode1 = _registerName1("currentMode"); + late final _sel_getCFRunLoop1 = _registerName1("getCFRunLoop"); + ffi.Pointer<__CFRunLoop> _objc_msgSend_519( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_519( + obj, + sel, + ); + } + + late final __objc_msgSend_519Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<__CFRunLoop> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_519 = __objc_msgSend_519Ptr.asFunction< + ffi.Pointer<__CFRunLoop> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSTimer1 = _getClass1("NSTimer"); + late final _sel_timerWithTimeInterval_invocation_repeats_1 = + _registerName1("timerWithTimeInterval:invocation:repeats:"); + ffi.Pointer _objc_msgSend_520( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ffi.Pointer invocation, + bool yesOrNo, + ) { + return __objc_msgSend_520( + obj, + sel, + ti, + invocation, + yesOrNo, + ); + } + + late final __objc_msgSend_520Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_520 = __objc_msgSend_520Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double, ffi.Pointer, bool)>(); + + late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_1 = + _registerName1("scheduledTimerWithTimeInterval:invocation:repeats:"); + late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_1 = + _registerName1("timerWithTimeInterval:target:selector:userInfo:repeats:"); + ffi.Pointer _objc_msgSend_521( + ffi.Pointer obj, + ffi.Pointer sel, + double ti, + ffi.Pointer aTarget, + ffi.Pointer aSelector, + ffi.Pointer userInfo, + bool yesOrNo, + ) { + return __objc_msgSend_521( + obj, + sel, + ti, + aTarget, + aSelector, + userInfo, + yesOrNo, + ); + } + + late final __objc_msgSend_521Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_521 = __objc_msgSend_521Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1 = + _registerName1( + "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); + late final _sel_timerWithTimeInterval_repeats_block_1 = + _registerName1("timerWithTimeInterval:repeats:block:"); + ffi.Pointer _objc_msgSend_522( + ffi.Pointer obj, + ffi.Pointer sel, + double interval, + bool repeats, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_522( + obj, + sel, + interval, + repeats, + block, + ); + } + + late final __objc_msgSend_522Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Bool, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_522 = __objc_msgSend_522Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_scheduledTimerWithTimeInterval_repeats_block_1 = + _registerName1("scheduledTimerWithTimeInterval:repeats:block:"); + late final _sel_initWithFireDate_interval_repeats_block_1 = + _registerName1("initWithFireDate:interval:repeats:block:"); + instancetype _objc_msgSend_523( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + double interval, + bool repeats, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_523( + obj, + sel, + date, + interval, + repeats, + block, + ); + } + + late final __objc_msgSend_523Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Bool, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_523 = __objc_msgSend_523Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, double, bool, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_1 = + _registerName1( + "initWithFireDate:interval:target:selector:userInfo:repeats:"); + instancetype _objc_msgSend_524( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + double ti, + ffi.Pointer t, + ffi.Pointer s, + ffi.Pointer ui, + bool rep, + ) { + return __objc_msgSend_524( + obj, + sel, + date, + ti, + t, + s, + ui, + rep, + ); + } + + late final __objc_msgSend_524Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_524 = __objc_msgSend_524Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); + + late final _sel_fire1 = _registerName1("fire"); + late final _sel_fireDate1 = _registerName1("fireDate"); + late final _sel_setFireDate_1 = _registerName1("setFireDate:"); + void _objc_msgSend_525( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_525( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_525Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_525 = __objc_msgSend_525Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_timeInterval1 = _registerName1("timeInterval"); + late final _sel_tolerance1 = _registerName1("tolerance"); + late final _sel_setTolerance_1 = _registerName1("setTolerance:"); + late final _sel_addTimer_forMode_1 = _registerName1("addTimer:forMode:"); + void _objc_msgSend_526( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer timer, + ffi.Pointer mode, + ) { + return __objc_msgSend_526( + obj, + sel, + timer, + mode, + ); + } + + late final __objc_msgSend_526Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_526 = __objc_msgSend_526Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addPort_forMode_1 = _registerName1("addPort:forMode:"); + void _objc_msgSend_527( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aPort, + ffi.Pointer mode, + ) { + return __objc_msgSend_527( + obj, + sel, + aPort, + mode, + ); + } + + late final __objc_msgSend_527Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_527 = __objc_msgSend_527Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removePort_forMode_1 = _registerName1("removePort:forMode:"); + late final _sel_limitDateForMode_1 = _registerName1("limitDateForMode:"); + ffi.Pointer _objc_msgSend_528( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer mode, + ) { + return __objc_msgSend_528( + obj, + sel, + mode, + ); + } + + late final __objc_msgSend_528Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_528 = __objc_msgSend_528Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_acceptInputForMode_beforeDate_1 = + _registerName1("acceptInputForMode:beforeDate:"); + void _objc_msgSend_529( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer mode, + ffi.Pointer limitDate, + ) { + return __objc_msgSend_529( + obj, + sel, + mode, + limitDate, + ); + } + + late final __objc_msgSend_529Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_529 = __objc_msgSend_529Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_run1 = _registerName1("run"); + late final _sel_runUntilDate_1 = _registerName1("runUntilDate:"); + late final _sel_runMode_beforeDate_1 = _registerName1("runMode:beforeDate:"); + bool _objc_msgSend_530( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer mode, + ffi.Pointer limitDate, + ) { + return __objc_msgSend_530( + obj, + sel, + mode, + limitDate, + ); + } + + late final __objc_msgSend_530Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_530 = __objc_msgSend_530Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_configureAsServer1 = _registerName1("configureAsServer"); + late final _sel_performInModes_block_1 = + _registerName1("performInModes:block:"); + void _objc_msgSend_531( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer modes, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_531( + obj, + sel, + modes, + block, + ); + } + + late final __objc_msgSend_531Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_531 = __objc_msgSend_531Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_performBlock_1 = _registerName1("performBlock:"); + late final _sel_performSelector_target_argument_order_modes_1 = + _registerName1("performSelector:target:argument:order:modes:"); + void _objc_msgSend_532( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aSelector, + ffi.Pointer target, + ffi.Pointer arg, + int order, + ffi.Pointer modes, + ) { + return __objc_msgSend_532( + obj, + sel, + aSelector, + target, + arg, + order, + modes, + ); + } + + late final __objc_msgSend_532Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_532 = __objc_msgSend_532Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_cancelPerformSelector_target_argument_1 = + _registerName1("cancelPerformSelector:target:argument:"); + late final _sel_cancelPerformSelectorsWithTarget_1 = + _registerName1("cancelPerformSelectorsWithTarget:"); + late final _sel_scheduleInRunLoop_forMode_1 = + _registerName1("scheduleInRunLoop:forMode:"); + void _objc_msgSend_533( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer runLoop, + ffi.Pointer mode, + ) { + return __objc_msgSend_533( + obj, + sel, + runLoop, + mode, + ); + } + + late final __objc_msgSend_533Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_533 = __objc_msgSend_533Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeFromRunLoop_forMode_1 = + _registerName1("removeFromRunLoop:forMode:"); + late final _sel_reservedSpaceLength1 = _registerName1("reservedSpaceLength"); + late final _sel_sendBeforeDate_components_from_reserved_1 = + _registerName1("sendBeforeDate:components:from:reserved:"); + bool _objc_msgSend_534( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer limitDate, + ffi.Pointer components, + ffi.Pointer receivePort, + int headerSpaceReserved, + ) { + return __objc_msgSend_534( + obj, + sel, + limitDate, + components, + receivePort, + headerSpaceReserved, + ); + } + + late final __objc_msgSend_534Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_534 = __objc_msgSend_534Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_sendBeforeDate_msgid_components_from_reserved_1 = + _registerName1("sendBeforeDate:msgid:components:from:reserved:"); + bool _objc_msgSend_535( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer limitDate, + int msgID, + ffi.Pointer components, + ffi.Pointer receivePort, + int headerSpaceReserved, + ) { + return __objc_msgSend_535( + obj, + sel, + limitDate, + msgID, + components, + receivePort, + headerSpaceReserved, + ); + } + + late final __objc_msgSend_535Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_535 = __objc_msgSend_535Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _class_NSConnection1 = _getClass1("NSConnection"); + late final _sel_statistics1 = _registerName1("statistics"); + late final _sel_allConnections1 = _registerName1("allConnections"); + late final _sel_defaultConnection1 = _registerName1("defaultConnection"); + ffi.Pointer _objc_msgSend_536( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_536( + obj, + sel, + ); + } + + late final __objc_msgSend_536Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_536 = __objc_msgSend_536Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithRegisteredName_host_1 = + _registerName1("connectionWithRegisteredName:host:"); + late final _class_NSPortNameServer1 = _getClass1("NSPortNameServer"); + late final _sel_systemDefaultPortNameServer1 = + _registerName1("systemDefaultPortNameServer"); + ffi.Pointer _objc_msgSend_537( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_537( + obj, + sel, + ); + } + + late final __objc_msgSend_537Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_537 = __objc_msgSend_537Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_portForName_1 = _registerName1("portForName:"); + ffi.Pointer _objc_msgSend_538( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_538( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_538Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_538 = __objc_msgSend_538Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_portForName_host_1 = _registerName1("portForName:host:"); + ffi.Pointer _objc_msgSend_539( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer host, + ) { + return __objc_msgSend_539( + obj, + sel, + name, + host, + ); + } + + late final __objc_msgSend_539Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_539 = __objc_msgSend_539Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_registerPort_name_1 = _registerName1("registerPort:name:"); + bool _objc_msgSend_540( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer port, + ffi.Pointer name, + ) { + return __objc_msgSend_540( + obj, + sel, + port, + name, + ); + } + + late final __objc_msgSend_540Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_540 = __objc_msgSend_540Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removePortForName_1 = _registerName1("removePortForName:"); + late final _sel_connectionWithRegisteredName_host_usingNameServer_1 = + _registerName1("connectionWithRegisteredName:host:usingNameServer:"); + instancetype _objc_msgSend_541( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ffi.Pointer server, + ) { + return __objc_msgSend_541( + obj, + sel, + name, + hostName, + server, + ); + } + + late final __objc_msgSend_541Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_541 = __objc_msgSend_541Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSDistantObject1 = _getClass1("NSDistantObject"); + late final _class_NSProxy1 = _getClass1("NSProxy"); + late final _sel_respondsToSelector_1 = _registerName1("respondsToSelector:"); + late final _sel_proxyWithTarget_connection_1 = + _registerName1("proxyWithTarget:connection:"); + ffi.Pointer _objc_msgSend_542( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer connection, + ) { + return __objc_msgSend_542( + obj, + sel, + target, + connection, + ); + } + + late final __objc_msgSend_542Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_542 = __objc_msgSend_542Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithTarget_connection_1 = + _registerName1("initWithTarget:connection:"); + late final _sel_proxyWithLocal_connection_1 = + _registerName1("proxyWithLocal:connection:"); + late final _sel_initWithLocal_connection_1 = + _registerName1("initWithLocal:connection:"); + late final _sel_setProtocolForProxy_1 = + _registerName1("setProtocolForProxy:"); + void _objc_msgSend_543( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer proto, + ) { + return __objc_msgSend_543( + obj, + sel, + proto, + ); + } + + late final __objc_msgSend_543Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_543 = __objc_msgSend_543Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_connectionForProxy1 = _registerName1("connectionForProxy"); + late final _sel_rootProxyForConnectionWithRegisteredName_host_1 = + _registerName1("rootProxyForConnectionWithRegisteredName:host:"); + ffi.Pointer _objc_msgSend_544( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ) { + return __objc_msgSend_544( + obj, + sel, + name, + hostName, + ); + } + + late final __objc_msgSend_544Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_544 = __objc_msgSend_544Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1 = + _registerName1( + "rootProxyForConnectionWithRegisteredName:host:usingNameServer:"); + ffi.Pointer _objc_msgSend_545( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer hostName, + ffi.Pointer server, + ) { + return __objc_msgSend_545( + obj, + sel, + name, + hostName, + server, + ); + } + + late final __objc_msgSend_545Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_545 = __objc_msgSend_545Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_serviceConnectionWithName_rootObject_usingNameServer_1 = + _registerName1("serviceConnectionWithName:rootObject:usingNameServer:"); + instancetype _objc_msgSend_546( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer root, + ffi.Pointer server, + ) { + return __objc_msgSend_546( + obj, + sel, + name, + root, + server, + ); + } + + late final __objc_msgSend_546Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_546 = __objc_msgSend_546Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_serviceConnectionWithName_rootObject_1 = + _registerName1("serviceConnectionWithName:rootObject:"); + late final _sel_requestTimeout1 = _registerName1("requestTimeout"); + late final _sel_setRequestTimeout_1 = _registerName1("setRequestTimeout:"); + late final _sel_replyTimeout1 = _registerName1("replyTimeout"); + late final _sel_setReplyTimeout_1 = _registerName1("setReplyTimeout:"); + late final _sel_rootObject1 = _registerName1("rootObject"); + late final _sel_setRootObject_1 = _registerName1("setRootObject:"); + late final _sel_independentConversationQueueing1 = + _registerName1("independentConversationQueueing"); + late final _sel_setIndependentConversationQueueing_1 = + _registerName1("setIndependentConversationQueueing:"); + late final _sel_rootProxy1 = _registerName1("rootProxy"); + ffi.Pointer _objc_msgSend_547( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_547( + obj, + sel, + ); + } + + late final __objc_msgSend_547Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_547 = __objc_msgSend_547Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addRequestMode_1 = _registerName1("addRequestMode:"); + late final _sel_removeRequestMode_1 = _registerName1("removeRequestMode:"); + late final _sel_requestModes1 = _registerName1("requestModes"); + late final _sel_registerName_1 = _registerName1("registerName:"); + late final _sel_registerName_withNameServer_1 = + _registerName1("registerName:withNameServer:"); + bool _objc_msgSend_548( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer server, + ) { + return __objc_msgSend_548( + obj, + sel, + name, + server, + ); + } + + late final __objc_msgSend_548Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_548 = __objc_msgSend_548Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithReceivePort_sendPort_1 = + _registerName1("connectionWithReceivePort:sendPort:"); + instancetype _objc_msgSend_549( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer receivePort, + ffi.Pointer sendPort, + ) { + return __objc_msgSend_549( + obj, + sel, + receivePort, + sendPort, + ); + } + + late final __objc_msgSend_549Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_549 = __objc_msgSend_549Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentConversation1 = _registerName1("currentConversation"); + late final _sel_initWithReceivePort_sendPort_1 = + _registerName1("initWithReceivePort:sendPort:"); + late final _sel_sendPort1 = _registerName1("sendPort"); + late final _sel_receivePort1 = _registerName1("receivePort"); + late final _sel_enableMultipleThreads1 = + _registerName1("enableMultipleThreads"); + late final _sel_multipleThreadsEnabled1 = + _registerName1("multipleThreadsEnabled"); + late final _sel_addRunLoop_1 = _registerName1("addRunLoop:"); + void _objc_msgSend_550( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer runloop, + ) { + return __objc_msgSend_550( + obj, + sel, + runloop, + ); + } + + late final __objc_msgSend_550Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_550 = __objc_msgSend_550Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeRunLoop_1 = _registerName1("removeRunLoop:"); + late final _sel_runInNewThread1 = _registerName1("runInNewThread"); + late final _sel_remoteObjects1 = _registerName1("remoteObjects"); + late final _sel_localObjects1 = _registerName1("localObjects"); + late final _sel_dispatchWithComponents_1 = + _registerName1("dispatchWithComponents:"); + late final _sel_addConnection_toRunLoop_forMode_1 = + _registerName1("addConnection:toRunLoop:forMode:"); + void _objc_msgSend_551( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer conn, + ffi.Pointer runLoop, + ffi.Pointer mode, + ) { + return __objc_msgSend_551( + obj, + sel, + conn, + runLoop, + mode, + ); + } + + late final __objc_msgSend_551Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_551 = __objc_msgSend_551Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeConnection_fromRunLoop_forMode_1 = + _registerName1("removeConnection:fromRunLoop:forMode:"); + late final _sel_encodePortObject_1 = _registerName1("encodePortObject:"); + void _objc_msgSend_552( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aport, + ) { + return __objc_msgSend_552( + obj, + sel, + aport, + ); + } + + late final __objc_msgSend_552Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_552 = __objc_msgSend_552Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_decodePortObject1 = _registerName1("decodePortObject"); + late final _sel_connection1 = _registerName1("connection"); + late final _sel_portCoderWithReceivePort_sendPort_components_1 = + _registerName1("portCoderWithReceivePort:sendPort:components:"); + ffi.Pointer _objc_msgSend_553( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer rcvPort, + ffi.Pointer sndPort, + ffi.Pointer comps, + ) { + return __objc_msgSend_553( + obj, + sel, + rcvPort, + sndPort, + comps, + ); + } + + late final __objc_msgSend_553Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_553 = __objc_msgSend_553Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithReceivePort_sendPort_components_1 = + _registerName1("initWithReceivePort:sendPort:components:"); + late final _sel_dispatch1 = _registerName1("dispatch"); + late final _sel_replacementObjectForPortCoder_1 = + _registerName1("replacementObjectForPortCoder:"); + ffi.Pointer _objc_msgSend_554( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer coder, + ) { + return __objc_msgSend_554( + obj, + sel, + coder, + ); + } + + late final __objc_msgSend_554Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_554 = __objc_msgSend_554Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSClassDescription1 = _getClass1("NSClassDescription"); + late final _sel_registerClassDescription_forClass_1 = + _registerName1("registerClassDescription:forClass:"); + void _objc_msgSend_555( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer description, + ffi.Pointer aClass, + ) { + return __objc_msgSend_555( + obj, + sel, + description, + aClass, + ); + } + + late final __objc_msgSend_555Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_555 = __objc_msgSend_555Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_invalidateClassDescriptionCache1 = + _registerName1("invalidateClassDescriptionCache"); + late final _sel_classDescriptionForClass_1 = + _registerName1("classDescriptionForClass:"); + ffi.Pointer _objc_msgSend_556( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_556( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_556Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_556 = __objc_msgSend_556Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_attributeKeys1 = _registerName1("attributeKeys"); + late final _sel_toOneRelationshipKeys1 = + _registerName1("toOneRelationshipKeys"); + late final _sel_toManyRelationshipKeys1 = + _registerName1("toManyRelationshipKeys"); + late final _sel_inverseForRelationshipKey_1 = + _registerName1("inverseForRelationshipKey:"); + late final _sel_classDescription1 = _registerName1("classDescription"); + ffi.Pointer _objc_msgSend_557( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_557( + obj, + sel, + ); + } + + late final __objc_msgSend_557Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_557 = __objc_msgSend_557Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSScriptObjectSpecifier1 = + _getClass1("NSScriptObjectSpecifier"); + late final _class_NSAppleEventDescriptor1 = + _getClass1("NSAppleEventDescriptor"); + late final _sel_nullDescriptor1 = _registerName1("nullDescriptor"); + ffi.Pointer _objc_msgSend_558( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_558( + obj, + sel, + ); + } + + late final __objc_msgSend_558Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_558 = __objc_msgSend_558Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithDescriptorType_bytes_length_1 = + _registerName1("descriptorWithDescriptorType:bytes:length:"); + ffi.Pointer _objc_msgSend_559( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer bytes, + int byteCount, + ) { + return __objc_msgSend_559( + obj, + sel, + descriptorType, + bytes, + byteCount, + ); + } + + late final __objc_msgSend_559Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_559 = __objc_msgSend_559Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_descriptorWithDescriptorType_data_1 = + _registerName1("descriptorWithDescriptorType:data:"); + ffi.Pointer _objc_msgSend_560( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer data, + ) { + return __objc_msgSend_560( + obj, + sel, + descriptorType, + data, + ); + } + + late final __objc_msgSend_560Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_560 = __objc_msgSend_560Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_descriptorWithBoolean_1 = + _registerName1("descriptorWithBoolean:"); + ffi.Pointer _objc_msgSend_561( + ffi.Pointer obj, + ffi.Pointer sel, + int boolean, + ) { + return __objc_msgSend_561( + obj, + sel, + boolean, + ); + } + + late final __objc_msgSend_561Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); + late final __objc_msgSend_561 = __objc_msgSend_561Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithEnumCode_1 = + _registerName1("descriptorWithEnumCode:"); + ffi.Pointer _objc_msgSend_562( + ffi.Pointer obj, + ffi.Pointer sel, + int enumerator, + ) { + return __objc_msgSend_562( + obj, + sel, + enumerator, + ); + } + + late final __objc_msgSend_562Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_562 = __objc_msgSend_562Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithInt32_1 = + _registerName1("descriptorWithInt32:"); + ffi.Pointer _objc_msgSend_563( + ffi.Pointer obj, + ffi.Pointer sel, + int signedInt, + ) { + return __objc_msgSend_563( + obj, + sel, + signedInt, + ); + } + + late final __objc_msgSend_563Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_563 = __objc_msgSend_563Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_descriptorWithDouble_1 = + _registerName1("descriptorWithDouble:"); + ffi.Pointer _objc_msgSend_564( + ffi.Pointer obj, + ffi.Pointer sel, + double doubleValue, + ) { + return __objc_msgSend_564( + obj, + sel, + doubleValue, + ); + } + + late final __objc_msgSend_564Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_564 = __objc_msgSend_564Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_descriptorWithTypeCode_1 = + _registerName1("descriptorWithTypeCode:"); + late final _sel_descriptorWithString_1 = + _registerName1("descriptorWithString:"); + ffi.Pointer _objc_msgSend_565( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_565( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_565Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_565 = __objc_msgSend_565Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithDate_1 = _registerName1("descriptorWithDate:"); + ffi.Pointer _objc_msgSend_566( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ) { + return __objc_msgSend_566( + obj, + sel, + date, + ); + } + + late final __objc_msgSend_566Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_566 = __objc_msgSend_566Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorWithFileURL_1 = + _registerName1("descriptorWithFileURL:"); + ffi.Pointer _objc_msgSend_567( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_567( + obj, + sel, + fileURL, + ); + } + + late final __objc_msgSend_567Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_567 = __objc_msgSend_567Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = + _registerName1( + "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); + ffi.Pointer _objc_msgSend_568( + ffi.Pointer obj, + ffi.Pointer sel, + int eventClass, + int eventID, + ffi.Pointer targetDescriptor, + int returnID, + int transactionID, + ) { + return __objc_msgSend_568( + obj, + sel, + eventClass, + eventID, + targetDescriptor, + returnID, + transactionID, + ); + } + + late final __objc_msgSend_568Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.Pointer, + ffi.Short, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_568 = __objc_msgSend_568Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, int, int)>(); + + late final _sel_listDescriptor1 = _registerName1("listDescriptor"); + late final _sel_recordDescriptor1 = _registerName1("recordDescriptor"); + late final _sel_currentProcessDescriptor1 = + _registerName1("currentProcessDescriptor"); + late final _sel_descriptorWithProcessIdentifier_1 = + _registerName1("descriptorWithProcessIdentifier:"); + late final _sel_descriptorWithBundleIdentifier_1 = + _registerName1("descriptorWithBundleIdentifier:"); + late final _sel_descriptorWithApplicationURL_1 = + _registerName1("descriptorWithApplicationURL:"); + late final _sel_initWithAEDescNoCopy_1 = + _registerName1("initWithAEDescNoCopy:"); + instancetype _objc_msgSend_569( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aeDesc, + ) { + return __objc_msgSend_569( + obj, + sel, + aeDesc, + ); + } + + late final __objc_msgSend_569Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_569 = __objc_msgSend_569Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithDescriptorType_bytes_length_1 = + _registerName1("initWithDescriptorType:bytes:length:"); + instancetype _objc_msgSend_570( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer bytes, + int byteCount, + ) { + return __objc_msgSend_570( + obj, + sel, + descriptorType, + bytes, + byteCount, + ); + } + + late final __objc_msgSend_570Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_570 = __objc_msgSend_570Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, int)>(); + + late final _sel_initWithDescriptorType_data_1 = + _registerName1("initWithDescriptorType:data:"); + instancetype _objc_msgSend_571( + ffi.Pointer obj, + ffi.Pointer sel, + int descriptorType, + ffi.Pointer data, + ) { + return __objc_msgSend_571( + obj, + sel, + descriptorType, + data, + ); + } + + late final __objc_msgSend_571Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_571 = __objc_msgSend_571Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1 = + _registerName1( + "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); + instancetype _objc_msgSend_572( + ffi.Pointer obj, + ffi.Pointer sel, + int eventClass, + int eventID, + ffi.Pointer targetDescriptor, + int returnID, + int transactionID, + ) { + return __objc_msgSend_572( + obj, + sel, + eventClass, + eventID, + targetDescriptor, + returnID, + transactionID, + ); + } + + late final __objc_msgSend_572Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.Pointer, + ffi.Short, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_572 = __objc_msgSend_572Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer, int, int)>(); + + late final _sel_initListDescriptor1 = _registerName1("initListDescriptor"); + late final _sel_initRecordDescriptor1 = + _registerName1("initRecordDescriptor"); + late final _sel_aeDesc1 = _registerName1("aeDesc"); + ffi.Pointer _objc_msgSend_573( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_573( + obj, + sel, + ); + } + + late final __objc_msgSend_573Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_573 = __objc_msgSend_573Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_descriptorType1 = _registerName1("descriptorType"); + late final _sel_booleanValue1 = _registerName1("booleanValue"); + late final _sel_enumCodeValue1 = _registerName1("enumCodeValue"); + late final _sel_int32Value1 = _registerName1("int32Value"); + late final _sel_typeCodeValue1 = _registerName1("typeCodeValue"); + late final _sel_dateValue1 = _registerName1("dateValue"); + late final _sel_fileURLValue1 = _registerName1("fileURLValue"); + late final _sel_eventClass1 = _registerName1("eventClass"); + late final _sel_eventID1 = _registerName1("eventID"); + late final _sel_returnID1 = _registerName1("returnID"); + late final _sel_transactionID1 = _registerName1("transactionID"); + late final _sel_setParamDescriptor_forKeyword_1 = + _registerName1("setParamDescriptor:forKeyword:"); + void _objc_msgSend_574( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + int keyword, + ) { + return __objc_msgSend_574( + obj, + sel, + descriptor, + keyword, + ); + } + + late final __objc_msgSend_574Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_574 = __objc_msgSend_574Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_paramDescriptorForKeyword_1 = + _registerName1("paramDescriptorForKeyword:"); + late final _sel_removeParamDescriptorWithKeyword_1 = + _registerName1("removeParamDescriptorWithKeyword:"); + void _objc_msgSend_575( + ffi.Pointer obj, + ffi.Pointer sel, + int keyword, + ) { + return __objc_msgSend_575( + obj, + sel, + keyword, + ); + } + + late final __objc_msgSend_575Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_575 = __objc_msgSend_575Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setAttributeDescriptor_forKeyword_1 = + _registerName1("setAttributeDescriptor:forKeyword:"); + late final _sel_attributeDescriptorForKeyword_1 = + _registerName1("attributeDescriptorForKeyword:"); + late final _sel_sendEventWithOptions_timeout_error_1 = + _registerName1("sendEventWithOptions:timeout:error:"); + ffi.Pointer _objc_msgSend_576( + ffi.Pointer obj, + ffi.Pointer sel, + int sendOptions, + double timeoutInSeconds, + ffi.Pointer> error, + ) { + return __objc_msgSend_576( + obj, + sel, + sendOptions, + timeoutInSeconds, + error, + ); + } + + late final __objc_msgSend_576Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Double, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_576 = __objc_msgSend_576Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + double, + ffi.Pointer>)>(); + + late final _sel_isRecordDescriptor1 = _registerName1("isRecordDescriptor"); + late final _sel_numberOfItems1 = _registerName1("numberOfItems"); + late final _sel_insertDescriptor_atIndex_1 = + _registerName1("insertDescriptor:atIndex:"); + void _objc_msgSend_577( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + int index, + ) { + return __objc_msgSend_577( + obj, + sel, + descriptor, + index, + ); + } + + late final __objc_msgSend_577Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_577 = __objc_msgSend_577Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_descriptorAtIndex_1 = _registerName1("descriptorAtIndex:"); + ffi.Pointer _objc_msgSend_578( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_578( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_578Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_578 = __objc_msgSend_578Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_removeDescriptorAtIndex_1 = + _registerName1("removeDescriptorAtIndex:"); + late final _sel_setDescriptor_forKeyword_1 = + _registerName1("setDescriptor:forKeyword:"); + late final _sel_descriptorForKeyword_1 = + _registerName1("descriptorForKeyword:"); + late final _sel_removeDescriptorWithKeyword_1 = + _registerName1("removeDescriptorWithKeyword:"); + late final _sel_keywordForDescriptorAtIndex_1 = + _registerName1("keywordForDescriptorAtIndex:"); + int _objc_msgSend_579( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_579( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_579Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_579 = __objc_msgSend_579Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_coerceToDescriptorType_1 = + _registerName1("coerceToDescriptorType:"); + late final _sel_objectSpecifierWithDescriptor_1 = + _registerName1("objectSpecifierWithDescriptor:"); + ffi.Pointer _objc_msgSend_580( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer descriptor, + ) { + return __objc_msgSend_580( + obj, + sel, + descriptor, + ); + } + + late final __objc_msgSend_580Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_580 = __objc_msgSend_580Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithContainerSpecifier_key_1 = + _registerName1("initWithContainerSpecifier:key:"); + instancetype _objc_msgSend_581( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer container, + ffi.Pointer property, + ) { + return __objc_msgSend_581( + obj, + sel, + container, + property, + ); + } + + late final __objc_msgSend_581Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_581 = __objc_msgSend_581Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSScriptClassDescription1 = + _getClass1("NSScriptClassDescription"); + ffi.Pointer _objc_msgSend_582( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_582( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_582Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_582 = __objc_msgSend_582Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithSuiteName_className_dictionary_1 = + _registerName1("initWithSuiteName:className:dictionary:"); + instancetype _objc_msgSend_583( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer suiteName, + ffi.Pointer className, + ffi.Pointer classDeclaration, + ) { + return __objc_msgSend_583( + obj, + sel, + suiteName, + className, + classDeclaration, + ); + } + + late final __objc_msgSend_583Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_583 = __objc_msgSend_583Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_suiteName1 = _registerName1("suiteName"); + late final _sel_className1 = _registerName1("className"); + late final _sel_implementationClassName1 = + _registerName1("implementationClassName"); + late final _sel_superclassDescription1 = + _registerName1("superclassDescription"); + ffi.Pointer _objc_msgSend_584( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_584( + obj, + sel, + ); + } + + late final __objc_msgSend_584Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_584 = __objc_msgSend_584Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventCode1 = _registerName1("appleEventCode"); + late final _sel_matchesAppleEventCode_1 = + _registerName1("matchesAppleEventCode:"); + late final _class_NSScriptCommandDescription1 = + _getClass1("NSScriptCommandDescription"); + late final _sel_initWithSuiteName_commandName_dictionary_1 = + _registerName1("initWithSuiteName:commandName:dictionary:"); + late final _sel_commandName1 = _registerName1("commandName"); + late final _sel_appleEventClassCode1 = _registerName1("appleEventClassCode"); + late final _sel_commandClassName1 = _registerName1("commandClassName"); + late final _sel_returnType1 = _registerName1("returnType"); + late final _sel_appleEventCodeForReturnType1 = + _registerName1("appleEventCodeForReturnType"); + late final _sel_argumentNames1 = _registerName1("argumentNames"); + late final _sel_typeForArgumentWithName_1 = + _registerName1("typeForArgumentWithName:"); + late final _sel_appleEventCodeForArgumentWithName_1 = + _registerName1("appleEventCodeForArgumentWithName:"); + int _objc_msgSend_585( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer argumentName, + ) { + return __objc_msgSend_585( + obj, + sel, + argumentName, + ); + } + + late final __objc_msgSend_585Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_585 = __objc_msgSend_585Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_isOptionalArgumentWithName_1 = + _registerName1("isOptionalArgumentWithName:"); + late final _class_NSScriptCommand1 = _getClass1("NSScriptCommand"); + late final _sel_initWithCommandDescription_1 = + _registerName1("initWithCommandDescription:"); + instancetype _objc_msgSend_586( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDef, + ) { + return __objc_msgSend_586( + obj, + sel, + commandDef, + ); + } + + late final __objc_msgSend_586Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_586 = __objc_msgSend_586Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_commandDescription1 = _registerName1("commandDescription"); + ffi.Pointer _objc_msgSend_587( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_587( + obj, + sel, + ); + } + + late final __objc_msgSend_587Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_587 = __objc_msgSend_587Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_directParameter1 = _registerName1("directParameter"); + late final _sel_setDirectParameter_1 = _registerName1("setDirectParameter:"); + late final _sel_receiversSpecifier1 = _registerName1("receiversSpecifier"); + ffi.Pointer _objc_msgSend_588( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_588( + obj, + sel, + ); + } + + late final __objc_msgSend_588Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_588 = __objc_msgSend_588Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setReceiversSpecifier_1 = + _registerName1("setReceiversSpecifier:"); + void _objc_msgSend_589( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_589( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_589Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_589 = __objc_msgSend_589Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_evaluatedReceivers1 = _registerName1("evaluatedReceivers"); + late final _sel_arguments1 = _registerName1("arguments"); + late final _sel_setArguments_1 = _registerName1("setArguments:"); + late final _sel_evaluatedArguments1 = _registerName1("evaluatedArguments"); + late final _sel_isWellFormed1 = _registerName1("isWellFormed"); + late final _sel_performDefaultImplementation1 = + _registerName1("performDefaultImplementation"); + late final _sel_executeCommand1 = _registerName1("executeCommand"); + late final _sel_scriptErrorNumber1 = _registerName1("scriptErrorNumber"); + late final _sel_setScriptErrorNumber_1 = + _registerName1("setScriptErrorNumber:"); + void _objc_msgSend_590( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_590( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_590Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_590 = __objc_msgSend_590Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_scriptErrorOffendingObjectDescriptor1 = + _registerName1("scriptErrorOffendingObjectDescriptor"); + late final _sel_setScriptErrorOffendingObjectDescriptor_1 = + _registerName1("setScriptErrorOffendingObjectDescriptor:"); + void _objc_msgSend_591( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_591( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_591Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_591 = __objc_msgSend_591Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scriptErrorExpectedTypeDescriptor1 = + _registerName1("scriptErrorExpectedTypeDescriptor"); + late final _sel_setScriptErrorExpectedTypeDescriptor_1 = + _registerName1("setScriptErrorExpectedTypeDescriptor:"); + late final _sel_scriptErrorString1 = _registerName1("scriptErrorString"); + late final _sel_setScriptErrorString_1 = + _registerName1("setScriptErrorString:"); + late final _sel_currentCommand1 = _registerName1("currentCommand"); + ffi.Pointer _objc_msgSend_592( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_592( + obj, + sel, + ); + } + + late final __objc_msgSend_592Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_592 = __objc_msgSend_592Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEvent1 = _registerName1("appleEvent"); + late final _sel_suspendExecution1 = _registerName1("suspendExecution"); + late final _sel_resumeExecutionWithResult_1 = + _registerName1("resumeExecutionWithResult:"); + late final _sel_createCommandInstance1 = + _registerName1("createCommandInstance"); + late final _sel_createCommandInstanceWithZone_1 = + _registerName1("createCommandInstanceWithZone:"); + ffi.Pointer _objc_msgSend_593( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSZone> zone, + ) { + return __objc_msgSend_593( + obj, + sel, + zone, + ); + } + + late final __objc_msgSend_593Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>('objc_msgSend'); + late final __objc_msgSend_593 = __objc_msgSend_593Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); + + late final _sel_supportsCommand_1 = _registerName1("supportsCommand:"); + bool _objc_msgSend_594( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDescription, + ) { + return __objc_msgSend_594( + obj, + sel, + commandDescription, + ); + } + + late final __objc_msgSend_594Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_594 = __objc_msgSend_594Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_selectorForCommand_1 = _registerName1("selectorForCommand:"); + ffi.Pointer _objc_msgSend_595( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer commandDescription, + ) { + return __objc_msgSend_595( + obj, + sel, + commandDescription, + ); + } + + late final __objc_msgSend_595Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_595 = __objc_msgSend_595Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_typeForKey_1 = _registerName1("typeForKey:"); + late final _sel_classDescriptionForKey_1 = + _registerName1("classDescriptionForKey:"); + ffi.Pointer _objc_msgSend_596( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_596( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_596Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_596 = __objc_msgSend_596Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appleEventCodeForKey_1 = + _registerName1("appleEventCodeForKey:"); + late final _sel_keyWithAppleEventCode_1 = + _registerName1("keyWithAppleEventCode:"); + ffi.Pointer _objc_msgSend_597( + ffi.Pointer obj, + ffi.Pointer sel, + int appleEventCode, + ) { + return __objc_msgSend_597( + obj, + sel, + appleEventCode, + ); + } + + late final __objc_msgSend_597Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); + late final __objc_msgSend_597 = __objc_msgSend_597Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_defaultSubcontainerAttributeKey1 = + _registerName1("defaultSubcontainerAttributeKey"); + late final _sel_isLocationRequiredToCreateForKey_1 = + _registerName1("isLocationRequiredToCreateForKey:"); + late final _sel_hasPropertyForKey_1 = _registerName1("hasPropertyForKey:"); + late final _sel_hasOrderedToManyRelationshipForKey_1 = + _registerName1("hasOrderedToManyRelationshipForKey:"); + late final _sel_hasReadablePropertyForKey_1 = + _registerName1("hasReadablePropertyForKey:"); + late final _sel_hasWritablePropertyForKey_1 = + _registerName1("hasWritablePropertyForKey:"); + late final _sel_isReadOnlyKey_1 = _registerName1("isReadOnlyKey:"); + late final _sel_initWithContainerClassDescription_containerSpecifier_key_1 = + _registerName1( + "initWithContainerClassDescription:containerSpecifier:key:"); + instancetype _objc_msgSend_598( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer classDesc, + ffi.Pointer container, + ffi.Pointer property, + ) { + return __objc_msgSend_598( + obj, + sel, + classDesc, + container, + property, + ); + } + + late final __objc_msgSend_598Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_598 = __objc_msgSend_598Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_childSpecifier1 = _registerName1("childSpecifier"); + late final _sel_setChildSpecifier_1 = _registerName1("setChildSpecifier:"); + late final _sel_containerSpecifier1 = _registerName1("containerSpecifier"); + late final _sel_setContainerSpecifier_1 = + _registerName1("setContainerSpecifier:"); + late final _sel_containerIsObjectBeingTested1 = + _registerName1("containerIsObjectBeingTested"); + late final _sel_setContainerIsObjectBeingTested_1 = + _registerName1("setContainerIsObjectBeingTested:"); + late final _sel_containerIsRangeContainerObject1 = + _registerName1("containerIsRangeContainerObject"); + late final _sel_setContainerIsRangeContainerObject_1 = + _registerName1("setContainerIsRangeContainerObject:"); + late final _sel_key1 = _registerName1("key"); + late final _sel_setKey_1 = _registerName1("setKey:"); + late final _sel_containerClassDescription1 = + _registerName1("containerClassDescription"); + late final _sel_setContainerClassDescription_1 = + _registerName1("setContainerClassDescription:"); + void _objc_msgSend_599( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_599( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_599Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_599 = __objc_msgSend_599Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_keyClassDescription1 = _registerName1("keyClassDescription"); + late final _sel_indicesOfObjectsByEvaluatingWithContainer_count_1 = + _registerName1("indicesOfObjectsByEvaluatingWithContainer:count:"); + ffi.Pointer _objc_msgSend_600( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer container, + ffi.Pointer count, + ) { + return __objc_msgSend_600( + obj, + sel, + container, + count, + ); + } + + late final __objc_msgSend_600Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_600 = __objc_msgSend_600Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_objectsByEvaluatingWithContainers_1 = + _registerName1("objectsByEvaluatingWithContainers:"); + late final _sel_objectsByEvaluatingSpecifier1 = + _registerName1("objectsByEvaluatingSpecifier"); + late final _sel_evaluationErrorNumber1 = + _registerName1("evaluationErrorNumber"); + late final _sel_setEvaluationErrorNumber_1 = + _registerName1("setEvaluationErrorNumber:"); + late final _sel_evaluationErrorSpecifier1 = + _registerName1("evaluationErrorSpecifier"); + late final _sel_descriptor1 = _registerName1("descriptor"); + late final _sel_scriptingValueForSpecifier_1 = + _registerName1("scriptingValueForSpecifier:"); + ffi.Pointer _objc_msgSend_601( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objectSpecifier, + ) { + return __objc_msgSend_601( + obj, + sel, + objectSpecifier, + ); + } + + late final __objc_msgSend_601Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_601 = __objc_msgSend_601Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_scriptingProperties1 = _registerName1("scriptingProperties"); + late final _sel_setScriptingProperties_1 = + _registerName1("setScriptingProperties:"); + late final _sel_copyScriptingValue_forKey_withProperties_1 = + _registerName1("copyScriptingValue:forKey:withProperties:"); + ffi.Pointer _objc_msgSend_602( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer properties, + ) { + return __objc_msgSend_602( + obj, + sel, + value, + key, + properties, + ); + } + + late final __objc_msgSend_602Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_602 = __objc_msgSend_602Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1 = + _registerName1( + "newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:"); + ffi.Pointer _objc_msgSend_603( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer objectClass, + ffi.Pointer key, + ffi.Pointer contentsValue, + ffi.Pointer properties, + ) { + return __objc_msgSend_603( + obj, + sel, + objectClass, + key, + contentsValue, + properties, + ); + } + + late final __objc_msgSend_603Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_603 = __objc_msgSend_603Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_classCode1 = _registerName1("classCode"); + late final _sel_valueAtIndex_inPropertyWithKey_1 = + _registerName1("valueAtIndex:inPropertyWithKey:"); + ffi.Pointer _objc_msgSend_604( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_604( + obj, + sel, + index, + key, + ); + } + + late final __objc_msgSend_604Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_604 = __objc_msgSend_604Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_valueWithName_inPropertyWithKey_1 = + _registerName1("valueWithName:inPropertyWithKey:"); + late final _sel_valueWithUniqueID_inPropertyWithKey_1 = + _registerName1("valueWithUniqueID:inPropertyWithKey:"); + late final _sel_insertValue_atIndex_inPropertyWithKey_1 = + _registerName1("insertValue:atIndex:inPropertyWithKey:"); + void _objc_msgSend_605( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_605( + obj, + sel, + value, + index, + key, + ); + } + + late final __objc_msgSend_605Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_605 = __objc_msgSend_605Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_removeValueAtIndex_fromPropertyWithKey_1 = + _registerName1("removeValueAtIndex:fromPropertyWithKey:"); + void _objc_msgSend_606( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ) { + return __objc_msgSend_606( + obj, + sel, + index, + key, + ); + } + + late final __objc_msgSend_606Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_606 = __objc_msgSend_606Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_replaceValueAtIndex_inPropertyWithKey_withValue_1 = + _registerName1("replaceValueAtIndex:inPropertyWithKey:withValue:"); + void _objc_msgSend_607( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer key, + ffi.Pointer value, + ) { + return __objc_msgSend_607( + obj, + sel, + index, + key, + value, + ); + } + + late final __objc_msgSend_607Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_607 = __objc_msgSend_607Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_insertValue_inPropertyWithKey_1 = + _registerName1("insertValue:inPropertyWithKey:"); + late final _sel_coerceValue_forKey_1 = _registerName1("coerceValue:forKey:"); + late final _sel_objectSpecifier1 = _registerName1("objectSpecifier"); + late final _sel_indicesOfObjectsByEvaluatingObjectSpecifier_1 = + _registerName1("indicesOfObjectsByEvaluatingObjectSpecifier:"); + ffi.Pointer _objc_msgSend_608( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer specifier, + ) { + return __objc_msgSend_608( + obj, + sel, + specifier, + ); + } + + late final __objc_msgSend_608Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_608 = __objc_msgSend_608Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isEqualTo_1 = _registerName1("isEqualTo:"); + late final _sel_isLessThanOrEqualTo_1 = + _registerName1("isLessThanOrEqualTo:"); + late final _sel_isLessThan_1 = _registerName1("isLessThan:"); + late final _sel_isGreaterThanOrEqualTo_1 = + _registerName1("isGreaterThanOrEqualTo:"); + late final _sel_isGreaterThan_1 = _registerName1("isGreaterThan:"); + late final _sel_isNotEqualTo_1 = _registerName1("isNotEqualTo:"); + late final _sel_doesContain_1 = _registerName1("doesContain:"); + late final _sel_isLike_1 = _registerName1("isLike:"); + late final _sel_isCaseInsensitiveLike_1 = + _registerName1("isCaseInsensitiveLike:"); + late final _sel_scriptingIsEqualTo_1 = _registerName1("scriptingIsEqualTo:"); + late final _sel_scriptingIsLessThanOrEqualTo_1 = + _registerName1("scriptingIsLessThanOrEqualTo:"); + late final _sel_scriptingIsLessThan_1 = + _registerName1("scriptingIsLessThan:"); + late final _sel_scriptingIsGreaterThanOrEqualTo_1 = + _registerName1("scriptingIsGreaterThanOrEqualTo:"); + late final _sel_scriptingIsGreaterThan_1 = + _registerName1("scriptingIsGreaterThan:"); + late final _sel_scriptingBeginsWith_1 = + _registerName1("scriptingBeginsWith:"); + late final _sel_scriptingEndsWith_1 = _registerName1("scriptingEndsWith:"); + late final _sel_scriptingContains_1 = _registerName1("scriptingContains:"); + late final _class_NSItemProvider1 = _getClass1("NSItemProvider"); + late final _class_NSProgress1 = _getClass1("NSProgress"); + late final _sel_currentProgress1 = _registerName1("currentProgress"); + ffi.Pointer _objc_msgSend_609( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_609( + obj, + sel, + ); + } + + late final __objc_msgSend_609Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_609 = __objc_msgSend_609Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_progressWithTotalUnitCount_1 = + _registerName1("progressWithTotalUnitCount:"); + ffi.Pointer _objc_msgSend_610( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ) { + return __objc_msgSend_610( + obj, + sel, + unitCount, + ); + } + + late final __objc_msgSend_610Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_610 = __objc_msgSend_610Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_discreteProgressWithTotalUnitCount_1 = + _registerName1("discreteProgressWithTotalUnitCount:"); + late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_1 = + _registerName1("progressWithTotalUnitCount:parent:pendingUnitCount:"); + ffi.Pointer _objc_msgSend_611( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ffi.Pointer parent, + int portionOfParentTotalUnitCount, + ) { + return __objc_msgSend_611( + obj, + sel, + unitCount, + parent, + portionOfParentTotalUnitCount, + ); + } + + late final __objc_msgSend_611Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_611 = __objc_msgSend_611Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer, int)>(); + + late final _sel_initWithParent_userInfo_1 = + _registerName1("initWithParent:userInfo:"); + instancetype _objc_msgSend_612( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer parentProgressOrNil, + ffi.Pointer userInfoOrNil, + ) { + return __objc_msgSend_612( + obj, + sel, + parentProgressOrNil, + userInfoOrNil, + ); + } + + late final __objc_msgSend_612Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_612 = __objc_msgSend_612Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_becomeCurrentWithPendingUnitCount_1 = + _registerName1("becomeCurrentWithPendingUnitCount:"); + void _objc_msgSend_613( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ) { + return __objc_msgSend_613( + obj, + sel, + unitCount, + ); + } + + late final __objc_msgSend_613Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_613 = __objc_msgSend_613Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_1 = + _registerName1("performAsCurrentWithPendingUnitCount:usingBlock:"); + void _objc_msgSend_614( + ffi.Pointer obj, + ffi.Pointer sel, + int unitCount, + ffi.Pointer<_ObjCBlock> work, + ) { + return __objc_msgSend_614( + obj, + sel, + unitCount, + work, + ); + } + + late final __objc_msgSend_614Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_614 = __objc_msgSend_614Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_resignCurrent1 = _registerName1("resignCurrent"); + late final _sel_addChild_withPendingUnitCount_1 = + _registerName1("addChild:withPendingUnitCount:"); + void _objc_msgSend_615( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + int inUnitCount, + ) { + return __objc_msgSend_615( + obj, + sel, + child, + inUnitCount, + ); + } + + late final __objc_msgSend_615Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_615 = __objc_msgSend_615Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_totalUnitCount1 = _registerName1("totalUnitCount"); + int _objc_msgSend_616( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_616( + obj, + sel, + ); + } + + late final __objc_msgSend_616Ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_616 = __objc_msgSend_616Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTotalUnitCount_1 = _registerName1("setTotalUnitCount:"); + void _objc_msgSend_617( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_617( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_617Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int64)>>('objc_msgSend'); + late final __objc_msgSend_617 = __objc_msgSend_617Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_completedUnitCount1 = _registerName1("completedUnitCount"); + late final _sel_setCompletedUnitCount_1 = + _registerName1("setCompletedUnitCount:"); + late final _sel_setLocalizedDescription_1 = + _registerName1("setLocalizedDescription:"); + late final _sel_localizedAdditionalDescription1 = + _registerName1("localizedAdditionalDescription"); + late final _sel_setLocalizedAdditionalDescription_1 = + _registerName1("setLocalizedAdditionalDescription:"); + late final _sel_isCancellable1 = _registerName1("isCancellable"); + late final _sel_setCancellable_1 = _registerName1("setCancellable:"); + late final _sel_isPausable1 = _registerName1("isPausable"); + late final _sel_setPausable_1 = _registerName1("setPausable:"); + late final _sel_isPaused1 = _registerName1("isPaused"); + late final _sel_cancellationHandler1 = _registerName1("cancellationHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_618( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_618( + obj, + sel, + ); + } + + late final __objc_msgSend_618Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_618 = __objc_msgSend_618Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCancellationHandler_1 = + _registerName1("setCancellationHandler:"); + void _objc_msgSend_619( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_619( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_619Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_619 = __objc_msgSend_619Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_pausingHandler1 = _registerName1("pausingHandler"); + late final _sel_setPausingHandler_1 = _registerName1("setPausingHandler:"); + late final _sel_resumingHandler1 = _registerName1("resumingHandler"); + late final _sel_setResumingHandler_1 = _registerName1("setResumingHandler:"); + late final _sel_setUserInfoObject_forKey_1 = + _registerName1("setUserInfoObject:forKey:"); + late final _sel_isIndeterminate1 = _registerName1("isIndeterminate"); + late final _sel_fractionCompleted1 = _registerName1("fractionCompleted"); + late final _sel_pause1 = _registerName1("pause"); + late final _sel_resume1 = _registerName1("resume"); + late final _sel_kind1 = _registerName1("kind"); + late final _sel_setKind_1 = _registerName1("setKind:"); + late final _sel_estimatedTimeRemaining1 = + _registerName1("estimatedTimeRemaining"); + late final _sel_setEstimatedTimeRemaining_1 = + _registerName1("setEstimatedTimeRemaining:"); + void _objc_msgSend_620( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_620( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_620Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_620 = __objc_msgSend_620Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_throughput1 = _registerName1("throughput"); + late final _sel_setThroughput_1 = _registerName1("setThroughput:"); + late final _sel_fileOperationKind1 = _registerName1("fileOperationKind"); + late final _sel_setFileOperationKind_1 = + _registerName1("setFileOperationKind:"); + late final _sel_fileURL1 = _registerName1("fileURL"); + late final _sel_setFileURL_1 = _registerName1("setFileURL:"); + void _objc_msgSend_621( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_621( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_621Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_621 = __objc_msgSend_621Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileTotalCount1 = _registerName1("fileTotalCount"); + late final _sel_setFileTotalCount_1 = _registerName1("setFileTotalCount:"); + late final _sel_fileCompletedCount1 = _registerName1("fileCompletedCount"); + late final _sel_setFileCompletedCount_1 = + _registerName1("setFileCompletedCount:"); + late final _sel_publish1 = _registerName1("publish"); + late final _sel_unpublish1 = _registerName1("unpublish"); + late final _sel_addSubscriberForFileURL_withPublishingHandler_1 = + _registerName1("addSubscriberForFileURL:withPublishingHandler:"); + ffi.Pointer _objc_msgSend_622( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> publishingHandler, + ) { + return __objc_msgSend_622( + obj, + sel, + url, + publishingHandler, + ); + } + + late final __objc_msgSend_622Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_622 = __objc_msgSend_622Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_removeSubscriber_1 = _registerName1("removeSubscriber:"); + late final _sel_isOld1 = _registerName1("isOld"); + late final _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = + _registerName1( + "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); + void _objc_msgSend_623( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_623( + obj, + sel, + typeIdentifier, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_623Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_623 = __objc_msgSend_623Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1 = + _registerName1( + "registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"); + void _objc_msgSend_624( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_624( + obj, + sel, + typeIdentifier, + fileOptions, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_624Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_624 = __objc_msgSend_624Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_registeredTypeIdentifiers1 = + _registerName1("registeredTypeIdentifiers"); + late final _sel_registeredTypeIdentifiersWithFileOptions_1 = + _registerName1("registeredTypeIdentifiersWithFileOptions:"); + ffi.Pointer _objc_msgSend_625( + ffi.Pointer obj, + ffi.Pointer sel, + int fileOptions, + ) { + return __objc_msgSend_625( + obj, + sel, + fileOptions, + ); + } + + late final __objc_msgSend_625Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_625 = __objc_msgSend_625Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_hasItemConformingToTypeIdentifier_1 = + _registerName1("hasItemConformingToTypeIdentifier:"); + late final _sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1 = + _registerName1( + "hasRepresentationConformingToTypeIdentifier:fileOptions:"); + bool _objc_msgSend_626( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + int fileOptions, + ) { + return __objc_msgSend_626( + obj, + sel, + typeIdentifier, + fileOptions, + ); + } + + late final __objc_msgSend_626Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_626 = __objc_msgSend_626Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadDataRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_627( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_627( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_627Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_627 = __objc_msgSend_627Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_628( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_628( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_628Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_628 = __objc_msgSend_628Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1 = + _registerName1( + "loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:"); + ffi.Pointer _objc_msgSend_629( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_629( + obj, + sel, + typeIdentifier, + completionHandler, + ); + } + + late final __objc_msgSend_629Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_629 = __objc_msgSend_629Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_suggestedName1 = _registerName1("suggestedName"); + late final _sel_setSuggestedName_1 = _registerName1("setSuggestedName:"); + late final _sel_registerObject_visibility_1 = + _registerName1("registerObject:visibility:"); + void _objc_msgSend_630( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer object, + int visibility, + ) { + return __objc_msgSend_630( + obj, + sel, + object, + visibility, + ); + } + + late final __objc_msgSend_630Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_630 = __objc_msgSend_630Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_registerObjectOfClass_visibility_loadHandler_1 = + _registerName1("registerObjectOfClass:visibility:loadHandler:"); + void _objc_msgSend_631( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + int visibility, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_631( + obj, + sel, + aClass, + visibility, + loadHandler, + ); + } + + late final __objc_msgSend_631Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_631 = __objc_msgSend_631Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_canLoadObjectOfClass_1 = + _registerName1("canLoadObjectOfClass:"); + late final _sel_loadObjectOfClass_completionHandler_1 = + _registerName1("loadObjectOfClass:completionHandler:"); + ffi.Pointer _objc_msgSend_632( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_632( + obj, + sel, + aClass, + completionHandler, + ); + } + + late final __objc_msgSend_632Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_632 = __objc_msgSend_632Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_initWithItem_typeIdentifier_1 = + _registerName1("initWithItem:typeIdentifier:"); + late final _sel_registerItemForTypeIdentifier_loadHandler_1 = + _registerName1("registerItemForTypeIdentifier:loadHandler:"); + void _objc_msgSend_633( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer<_ObjCBlock> loadHandler, + ) { + return __objc_msgSend_633( + obj, + sel, + typeIdentifier, + loadHandler, + ); + } + + late final __objc_msgSend_633Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_633 = __objc_msgSend_633Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadItemForTypeIdentifier_options_completionHandler_1 = + _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); + void _objc_msgSend_634( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer typeIdentifier, + ffi.Pointer options, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_634( + obj, + sel, + typeIdentifier, + options, + completionHandler, + ); + } + + late final __objc_msgSend_634Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_634 = __objc_msgSend_634Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_previewImageHandler1 = _registerName1("previewImageHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_635( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_635( + obj, + sel, + ); + } + + late final __objc_msgSend_635Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_635 = __objc_msgSend_635Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPreviewImageHandler_1 = + _registerName1("setPreviewImageHandler:"); + void _objc_msgSend_636( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_636( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_636Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_636 = __objc_msgSend_636Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_loadPreviewImageWithOptions_completionHandler_1 = + _registerName1("loadPreviewImageWithOptions:completionHandler:"); + void _objc_msgSend_637( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer options, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_637( + obj, + sel, + options, + completionHandler, + ); + } + + late final __objc_msgSend_637Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_637 = __objc_msgSend_637Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSMutableString1 = _getClass1("NSMutableString"); + late final _sel_replaceCharactersInRange_withString_1 = + _registerName1("replaceCharactersInRange:withString:"); + void _objc_msgSend_638( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer aString, + ) { + return __objc_msgSend_638( + obj, + sel, + range, + aString, + ); + } + + late final __objc_msgSend_638Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_638 = __objc_msgSend_638Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer)>(); + + late final _sel_insertString_atIndex_1 = + _registerName1("insertString:atIndex:"); + void _objc_msgSend_639( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aString, + int loc, + ) { + return __objc_msgSend_639( + obj, + sel, + aString, + loc, + ); + } + + late final __objc_msgSend_639Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_639 = __objc_msgSend_639Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_deleteCharactersInRange_1 = + _registerName1("deleteCharactersInRange:"); + late final _sel_appendString_1 = _registerName1("appendString:"); + late final _sel_appendFormat_1 = _registerName1("appendFormat:"); + late final _sel_setString_1 = _registerName1("setString:"); + late final _sel_replaceOccurrencesOfString_withString_options_range_1 = + _registerName1("replaceOccurrencesOfString:withString:options:range:"); + int _objc_msgSend_640( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer target, + ffi.Pointer replacement, + int options, + _NSRange searchRange, + ) { + return __objc_msgSend_640( + obj, + sel, + target, + replacement, + options, + searchRange, + ); + } + + late final __objc_msgSend_640Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_640 = __objc_msgSend_640Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_applyTransform_reverse_range_updatedRange_1 = + _registerName1("applyTransform:reverse:range:updatedRange:"); + bool _objc_msgSend_641( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer transform, + bool reverse, + _NSRange range, + ffi.Pointer<_NSRange> resultingRange, + ) { + return __objc_msgSend_641( + obj, + sel, + transform, + reverse, + range, + resultingRange, + ); + } + + late final __objc_msgSend_641Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + _NSRange, + ffi.Pointer<_NSRange>)>>('objc_msgSend'); + late final __objc_msgSend_641 = __objc_msgSend_641Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, _NSRange, ffi.Pointer<_NSRange>)>(); + + ffi.Pointer _objc_msgSend_642( + ffi.Pointer obj, + ffi.Pointer sel, + int capacity, + ) { + return __objc_msgSend_642( + obj, + sel, + capacity, + ); + } + + late final __objc_msgSend_642Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_642 = __objc_msgSend_642Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_stringWithCapacity_1 = _registerName1("stringWithCapacity:"); + late final _class_NSNotification1 = _getClass1("NSNotification"); + late final _sel_object1 = _registerName1("object"); + late final _sel_initWithName_object_userInfo_1 = + _registerName1("initWithName:object:userInfo:"); + instancetype _objc_msgSend_643( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer object, + ffi.Pointer userInfo, + ) { + return __objc_msgSend_643( + obj, + sel, + name, + object, + userInfo, + ); + } + + late final __objc_msgSend_643Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_643 = __objc_msgSend_643Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_notificationWithName_object_1 = + _registerName1("notificationWithName:object:"); + late final _sel_notificationWithName_object_userInfo_1 = + _registerName1("notificationWithName:object:userInfo:"); + late final _class_NSBundle1 = _getClass1("NSBundle"); + late final _sel_mainBundle1 = _registerName1("mainBundle"); + ffi.Pointer _objc_msgSend_644( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_644( + obj, + sel, + ); + } + + late final __objc_msgSend_644Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_644 = __objc_msgSend_644Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_bundleWithPath_1 = _registerName1("bundleWithPath:"); + late final _sel_initWithPath_1 = _registerName1("initWithPath:"); + late final _sel_bundleWithURL_1 = _registerName1("bundleWithURL:"); + late final _sel_initWithURL_1 = _registerName1("initWithURL:"); + late final _sel_bundleForClass_1 = _registerName1("bundleForClass:"); + ffi.Pointer _objc_msgSend_645( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aClass, + ) { + return __objc_msgSend_645( + obj, + sel, + aClass, + ); + } + + late final __objc_msgSend_645Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_645 = __objc_msgSend_645Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_bundleWithIdentifier_1 = + _registerName1("bundleWithIdentifier:"); + ffi.Pointer _objc_msgSend_646( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_646( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_646Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_646 = __objc_msgSend_646Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allBundles1 = _registerName1("allBundles"); + late final _sel_allFrameworks1 = _registerName1("allFrameworks"); + late final _sel_isLoaded1 = _registerName1("isLoaded"); + late final _sel_unload1 = _registerName1("unload"); + late final _sel_preflightAndReturnError_1 = + _registerName1("preflightAndReturnError:"); + late final _sel_loadAndReturnError_1 = _registerName1("loadAndReturnError:"); + late final _sel_bundleURL1 = _registerName1("bundleURL"); + late final _sel_resourceURL1 = _registerName1("resourceURL"); + late final _sel_executableURL1 = _registerName1("executableURL"); + late final _sel_URLForAuxiliaryExecutable_1 = + _registerName1("URLForAuxiliaryExecutable:"); + late final _sel_privateFrameworksURL1 = + _registerName1("privateFrameworksURL"); + late final _sel_sharedFrameworksURL1 = _registerName1("sharedFrameworksURL"); + late final _sel_sharedSupportURL1 = _registerName1("sharedSupportURL"); + late final _sel_builtInPlugInsURL1 = _registerName1("builtInPlugInsURL"); + late final _sel_appStoreReceiptURL1 = _registerName1("appStoreReceiptURL"); + late final _sel_bundlePath1 = _registerName1("bundlePath"); + late final _sel_resourcePath1 = _registerName1("resourcePath"); + late final _sel_executablePath1 = _registerName1("executablePath"); + late final _sel_pathForAuxiliaryExecutable_1 = + _registerName1("pathForAuxiliaryExecutable:"); + late final _sel_privateFrameworksPath1 = + _registerName1("privateFrameworksPath"); + late final _sel_sharedFrameworksPath1 = + _registerName1("sharedFrameworksPath"); + late final _sel_sharedSupportPath1 = _registerName1("sharedSupportPath"); + late final _sel_builtInPlugInsPath1 = _registerName1("builtInPlugInsPath"); + late final _sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1 = + _registerName1( + "URLForResource:withExtension:subdirectory:inBundleWithURL:"); + ffi.Pointer _objc_msgSend_647( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer bundleURL, + ) { + return __objc_msgSend_647( + obj, + sel, + name, + ext, + subpath, + bundleURL, + ); + } + + late final __objc_msgSend_647Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_647 = __objc_msgSend_647Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1 = + _registerName1( + "URLsForResourcesWithExtension:subdirectory:inBundleWithURL:"); + ffi.Pointer _objc_msgSend_648( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer bundleURL, + ) { + return __objc_msgSend_648( + obj, + sel, + ext, + subpath, + bundleURL, + ); + } + + late final __objc_msgSend_648Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_648 = __objc_msgSend_648Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_1 = + _registerName1("URLForResource:withExtension:"); + ffi.Pointer _objc_msgSend_649( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ) { + return __objc_msgSend_649( + obj, + sel, + name, + ext, + ); + } + + late final __objc_msgSend_649Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_649 = __objc_msgSend_649Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_subdirectory_1 = + _registerName1("URLForResource:withExtension:subdirectory:"); + ffi.Pointer _objc_msgSend_650( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ) { + return __objc_msgSend_650( + obj, + sel, + name, + ext, + subpath, + ); + } + + late final __objc_msgSend_650Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_650 = __objc_msgSend_650Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLForResource_withExtension_subdirectory_localization_1 = + _registerName1("URLForResource:withExtension:subdirectory:localization:"); + ffi.Pointer _objc_msgSend_651( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_651( + obj, + sel, + name, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_651Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_651 = __objc_msgSend_651Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_1 = + _registerName1("URLsForResourcesWithExtension:subdirectory:"); + ffi.Pointer _objc_msgSend_652( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ) { + return __objc_msgSend_652( + obj, + sel, + ext, + subpath, + ); + } + + late final __objc_msgSend_652Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_652 = __objc_msgSend_652Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLsForResourcesWithExtension_subdirectory_localization_1 = + _registerName1( + "URLsForResourcesWithExtension:subdirectory:localization:"); + ffi.Pointer _objc_msgSend_653( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_653( + obj, + sel, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_653Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_653 = __objc_msgSend_653Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathForResource_ofType_inDirectory_1 = + _registerName1("pathForResource:ofType:inDirectory:"); + ffi.Pointer _objc_msgSend_654( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer bundlePath, + ) { + return __objc_msgSend_654( + obj, + sel, + name, + ext, + bundlePath, + ); + } + + late final __objc_msgSend_654Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_654 = __objc_msgSend_654Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathsForResourcesOfType_inDirectory_1 = + _registerName1("pathsForResourcesOfType:inDirectory:"); + late final _sel_pathForResource_ofType_1 = + _registerName1("pathForResource:ofType:"); + late final _sel_pathForResource_ofType_inDirectory_forLocalization_1 = + _registerName1("pathForResource:ofType:inDirectory:forLocalization:"); + ffi.Pointer _objc_msgSend_655( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer ext, + ffi.Pointer subpath, + ffi.Pointer localizationName, + ) { + return __objc_msgSend_655( + obj, + sel, + name, + ext, + subpath, + localizationName, + ); + } + + late final __objc_msgSend_655Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_655 = __objc_msgSend_655Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pathsForResourcesOfType_inDirectory_forLocalization_1 = + _registerName1("pathsForResourcesOfType:inDirectory:forLocalization:"); + late final _sel_localizedStringForKey_value_table_1 = + _registerName1("localizedStringForKey:value:table:"); + late final _class_NSAttributedString1 = _getClass1("NSAttributedString"); + late final _sel_attributesAtIndex_effectiveRange_1 = + _registerName1("attributesAtIndex:effectiveRange:"); + ffi.Pointer _objc_msgSend_656( + ffi.Pointer obj, + ffi.Pointer sel, + int location, + ffi.Pointer<_NSRange> range, + ) { + return __objc_msgSend_656( + obj, + sel, + location, + range, + ); + } + + late final __objc_msgSend_656Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>)>>('objc_msgSend'); + late final __objc_msgSend_656 = __objc_msgSend_656Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_NSRange>)>(); + + late final _sel_attribute_atIndex_effectiveRange_1 = + _registerName1("attribute:atIndex:effectiveRange:"); + ffi.Pointer _objc_msgSend_657( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrName, + int location, + ffi.Pointer<_NSRange> range, + ) { + return __objc_msgSend_657( + obj, + sel, + attrName, + location, + range, + ); + } + + late final __objc_msgSend_657Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>)>>('objc_msgSend'); + late final __objc_msgSend_657 = __objc_msgSend_657Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_NSRange>)>(); + + late final _sel_attributedSubstringFromRange_1 = + _registerName1("attributedSubstringFromRange:"); + ffi.Pointer _objc_msgSend_658( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_658( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_658Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_658 = __objc_msgSend_658Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_attributesAtIndex_longestEffectiveRange_inRange_1 = + _registerName1("attributesAtIndex:longestEffectiveRange:inRange:"); + ffi.Pointer _objc_msgSend_659( + ffi.Pointer obj, + ffi.Pointer sel, + int location, + ffi.Pointer<_NSRange> range, + _NSRange rangeLimit, + ) { + return __objc_msgSend_659( + obj, + sel, + location, + range, + rangeLimit, + ); + } + + late final __objc_msgSend_659Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_659 = __objc_msgSend_659Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer<_NSRange>, _NSRange)>(); + + late final _sel_attribute_atIndex_longestEffectiveRange_inRange_1 = + _registerName1("attribute:atIndex:longestEffectiveRange:inRange:"); + ffi.Pointer _objc_msgSend_660( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrName, + int location, + ffi.Pointer<_NSRange> range, + _NSRange rangeLimit, + ) { + return __objc_msgSend_660( + obj, + sel, + attrName, + location, + range, + rangeLimit, + ); + } + + late final __objc_msgSend_660Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer<_NSRange>, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_660 = __objc_msgSend_660Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_NSRange>, + _NSRange)>(); + + late final _sel_isEqualToAttributedString_1 = + _registerName1("isEqualToAttributedString:"); + bool _objc_msgSend_661( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer other, + ) { + return __objc_msgSend_661( + obj, + sel, + other, + ); + } + + late final __objc_msgSend_661Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_661 = __objc_msgSend_661Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithString_attributes_1 = + _registerName1("initWithString:attributes:"); + late final _sel_initWithAttributedString_1 = + _registerName1("initWithAttributedString:"); + instancetype _objc_msgSend_662( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrStr, + ) { + return __objc_msgSend_662( + obj, + sel, + attrStr, + ); + } + + late final __objc_msgSend_662Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_662 = __objc_msgSend_662Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_enumerateAttributesInRange_options_usingBlock_1 = + _registerName1("enumerateAttributesInRange:options:usingBlock:"); + void _objc_msgSend_663( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange enumerationRange, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_663( + obj, + sel, + enumerationRange, + opts, + block, + ); + } + + late final __objc_msgSend_663Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_663 = __objc_msgSend_663Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + int, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_enumerateAttribute_inRange_options_usingBlock_1 = + _registerName1("enumerateAttribute:inRange:options:usingBlock:"); + void _objc_msgSend_664( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrName, + _NSRange enumerationRange, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_664( + obj, + sel, + attrName, + enumerationRange, + opts, + block, + ); + } + + late final __objc_msgSend_664Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_664 = __objc_msgSend_664Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSAttributedStringMarkdownParsingOptions1 = + _getClass1("NSAttributedStringMarkdownParsingOptions"); + late final _sel_allowsExtendedAttributes1 = + _registerName1("allowsExtendedAttributes"); + late final _sel_setAllowsExtendedAttributes_1 = + _registerName1("setAllowsExtendedAttributes:"); + late final _sel_interpretedSyntax1 = _registerName1("interpretedSyntax"); + int _objc_msgSend_665( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_665( + obj, + sel, + ); + } + + late final __objc_msgSend_665Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_665 = __objc_msgSend_665Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setInterpretedSyntax_1 = + _registerName1("setInterpretedSyntax:"); + void _objc_msgSend_666( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_666( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_666Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_666 = __objc_msgSend_666Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_failurePolicy1 = _registerName1("failurePolicy"); + int _objc_msgSend_667( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_667( + obj, + sel, + ); + } + + late final __objc_msgSend_667Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_667 = __objc_msgSend_667Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setFailurePolicy_1 = _registerName1("setFailurePolicy:"); + void _objc_msgSend_668( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_668( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_668Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_668 = __objc_msgSend_668Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setLanguageCode_1 = _registerName1("setLanguageCode:"); + late final _sel_appliesSourcePositionAttributes1 = + _registerName1("appliesSourcePositionAttributes"); + late final _sel_setAppliesSourcePositionAttributes_1 = + _registerName1("setAppliesSourcePositionAttributes:"); + late final _sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1 = + _registerName1( + "initWithContentsOfMarkdownFileAtURL:options:baseURL:error:"); + instancetype _objc_msgSend_669( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdownFile, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_669( + obj, + sel, + markdownFile, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_669Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_669 = __objc_msgSend_669Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithMarkdown_options_baseURL_error_1 = + _registerName1("initWithMarkdown:options:baseURL:error:"); + instancetype _objc_msgSend_670( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdown, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_670( + obj, + sel, + markdown, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_670Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_670 = __objc_msgSend_670Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithMarkdownString_options_baseURL_error_1 = + _registerName1("initWithMarkdownString:options:baseURL:error:"); + instancetype _objc_msgSend_671( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer markdownString, + ffi.Pointer options, + ffi.Pointer baseURL, + ffi.Pointer> error, + ) { + return __objc_msgSend_671( + obj, + sel, + markdownString, + options, + baseURL, + error, + ); + } + + late final __objc_msgSend_671Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_671 = __objc_msgSend_671Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_initWithFormat_options_locale_1 = + _registerName1("initWithFormat:options:locale:"); + instancetype _objc_msgSend_672( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ffi.Pointer locale, + ) { + return __objc_msgSend_672( + obj, + sel, + format, + options, + locale, + ); + } + + late final __objc_msgSend_672Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_672 = __objc_msgSend_672Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_initWithFormat_options_locale_arguments_1 = + _registerName1("initWithFormat:options:locale:arguments:"); + instancetype _objc_msgSend_673( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ffi.Pointer locale, + ffi.Pointer<__va_list_tag> arguments, + ) { + return __objc_msgSend_673( + obj, + sel, + format, + options, + locale, + arguments, + ); + } + + late final __objc_msgSend_673Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_673 = __objc_msgSend_673Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _sel_localizedAttributedStringWithFormat_1 = + _registerName1("localizedAttributedStringWithFormat:"); + late final _sel_localizedAttributedStringWithFormat_options_1 = + _registerName1("localizedAttributedStringWithFormat:options:"); + instancetype _objc_msgSend_674( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer format, + int options, + ) { + return __objc_msgSend_674( + obj, + sel, + format, + options, + ); + } + + late final __objc_msgSend_674Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_674 = __objc_msgSend_674Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_attributedStringByInflectingString1 = + _registerName1("attributedStringByInflectingString"); + ffi.Pointer _objc_msgSend_675( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_675( + obj, + sel, + ); + } + + late final __objc_msgSend_675Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_675 = __objc_msgSend_675Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedAttributedStringForKey_value_table_1 = + _registerName1("localizedAttributedStringForKey:value:table:"); + ffi.Pointer _objc_msgSend_676( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer tableName, + ) { + return __objc_msgSend_676( + obj, + sel, + key, + value, + tableName, + ); + } + + late final __objc_msgSend_676Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_676 = __objc_msgSend_676Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_bundleIdentifier1 = _registerName1("bundleIdentifier"); + late final _sel_infoDictionary1 = _registerName1("infoDictionary"); + late final _sel_localizedInfoDictionary1 = + _registerName1("localizedInfoDictionary"); + late final _sel_objectForInfoDictionaryKey_1 = + _registerName1("objectForInfoDictionaryKey:"); + late final _sel_classNamed_1 = _registerName1("classNamed:"); + late final _sel_principalClass1 = _registerName1("principalClass"); + late final _sel_preferredLocalizations1 = + _registerName1("preferredLocalizations"); + late final _sel_localizations1 = _registerName1("localizations"); + late final _sel_developmentLocalization1 = + _registerName1("developmentLocalization"); + late final _sel_preferredLocalizationsFromArray_1 = + _registerName1("preferredLocalizationsFromArray:"); + late final _sel_preferredLocalizationsFromArray_forPreferences_1 = + _registerName1("preferredLocalizationsFromArray:forPreferences:"); + ffi.Pointer _objc_msgSend_677( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localizationsArray, + ffi.Pointer preferencesArray, + ) { + return __objc_msgSend_677( + obj, + sel, + localizationsArray, + preferencesArray, + ); + } + + late final __objc_msgSend_677Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_677 = __objc_msgSend_677Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_executableArchitectures1 = + _registerName1("executableArchitectures"); + late final _sel_setPreservationPriority_forTags_1 = + _registerName1("setPreservationPriority:forTags:"); + void _objc_msgSend_678( + ffi.Pointer obj, + ffi.Pointer sel, + double priority, + ffi.Pointer tags, + ) { + return __objc_msgSend_678( + obj, + sel, + priority, + tags, + ); + } + + late final __objc_msgSend_678Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Double, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_678 = __objc_msgSend_678Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double, + ffi.Pointer)>(); + + late final _sel_preservationPriorityForTag_1 = + _registerName1("preservationPriorityForTag:"); + late final _class_NSMutableAttributedString1 = + _getClass1("NSMutableAttributedString"); + late final _sel_setAttributes_range_1 = + _registerName1("setAttributes:range:"); + void _objc_msgSend_679( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrs, + _NSRange range, + ) { + return __objc_msgSend_679( + obj, + sel, + attrs, + range, + ); + } + + late final __objc_msgSend_679Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_679 = __objc_msgSend_679Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + late final _sel_mutableString1 = _registerName1("mutableString"); + ffi.Pointer _objc_msgSend_680( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_680( + obj, + sel, + ); + } + + late final __objc_msgSend_680Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_680 = __objc_msgSend_680Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addAttribute_value_range_1 = + _registerName1("addAttribute:value:range:"); + void _objc_msgSend_681( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer value, + _NSRange range, + ) { + return __objc_msgSend_681( + obj, + sel, + name, + value, + range, + ); + } + + late final __objc_msgSend_681Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_681 = __objc_msgSend_681Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_addAttributes_range_1 = + _registerName1("addAttributes:range:"); + late final _sel_removeAttribute_range_1 = + _registerName1("removeAttribute:range:"); + void _objc_msgSend_682( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + _NSRange range, + ) { + return __objc_msgSend_682( + obj, + sel, + name, + range, + ); + } + + late final __objc_msgSend_682Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_682 = __objc_msgSend_682Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + late final _sel_replaceCharactersInRange_withAttributedString_1 = + _registerName1("replaceCharactersInRange:withAttributedString:"); + void _objc_msgSend_683( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer attrString, + ) { + return __objc_msgSend_683( + obj, + sel, + range, + attrString, + ); + } + + late final __objc_msgSend_683Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + _NSRange, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_683 = __objc_msgSend_683Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, _NSRange, + ffi.Pointer)>(); + + late final _sel_insertAttributedString_atIndex_1 = + _registerName1("insertAttributedString:atIndex:"); + void _objc_msgSend_684( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrString, + int loc, + ) { + return __objc_msgSend_684( + obj, + sel, + attrString, + loc, + ); + } + + late final __objc_msgSend_684Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_684 = __objc_msgSend_684Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_appendAttributedString_1 = + _registerName1("appendAttributedString:"); + void _objc_msgSend_685( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attrString, + ) { + return __objc_msgSend_685( + obj, + sel, + attrString, + ); + } + + late final __objc_msgSend_685Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_685 = __objc_msgSend_685Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setAttributedString_1 = + _registerName1("setAttributedString:"); + late final _sel_beginEditing1 = _registerName1("beginEditing"); + late final _sel_endEditing1 = _registerName1("endEditing"); + late final _sel_appendLocalizedFormat_1 = + _registerName1("appendLocalizedFormat:"); + late final _class_NSDateFormatter1 = _getClass1("NSDateFormatter"); + late final _class_NSFormatter1 = _getClass1("NSFormatter"); + late final _sel_stringForObjectValue_1 = + _registerName1("stringForObjectValue:"); + late final _sel_attributedStringForObjectValue_withDefaultAttributes_1 = + _registerName1("attributedStringForObjectValue:withDefaultAttributes:"); + ffi.Pointer _objc_msgSend_686( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer obj1, + ffi.Pointer attrs, + ) { + return __objc_msgSend_686( + obj, + sel, + obj1, + attrs, + ); + } + + late final __objc_msgSend_686Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_686 = __objc_msgSend_686Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_editingStringForObjectValue_1 = + _registerName1("editingStringForObjectValue:"); + late final _sel_getObjectValue_forString_errorDescription_1 = + _registerName1("getObjectValue:forString:errorDescription:"); + bool _objc_msgSend_687( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> obj1, + ffi.Pointer string, + ffi.Pointer> error, + ) { + return __objc_msgSend_687( + obj, + sel, + obj1, + string, + error, + ); + } + + late final __objc_msgSend_687Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_687 = __objc_msgSend_687Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isPartialStringValid_newEditingString_errorDescription_1 = + _registerName1("isPartialStringValid:newEditingString:errorDescription:"); + bool _objc_msgSend_688( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer partialString, + ffi.Pointer> newString, + ffi.Pointer> error, + ) { + return __objc_msgSend_688( + obj, + sel, + partialString, + newString, + error, + ); + } + + late final __objc_msgSend_688Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_688 = __objc_msgSend_688Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1 = + _registerName1( + "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:"); + bool _objc_msgSend_689( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> partialStringPtr, + ffi.Pointer<_NSRange> proposedSelRangePtr, + ffi.Pointer origString, + _NSRange origSelRange, + ffi.Pointer> error, + ) { + return __objc_msgSend_689( + obj, + sel, + partialStringPtr, + proposedSelRangePtr, + origString, + origSelRange, + error, + ); + } + + late final __objc_msgSend_689Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_NSRange>, + ffi.Pointer, + _NSRange, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_689 = __objc_msgSend_689Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_NSRange>, + ffi.Pointer, + _NSRange, + ffi.Pointer>)>(); + + late final _sel_formattingContext1 = _registerName1("formattingContext"); + int _objc_msgSend_690( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_690( + obj, + sel, + ); + } + + late final __objc_msgSend_690Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_690 = __objc_msgSend_690Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setFormattingContext_1 = + _registerName1("setFormattingContext:"); + void _objc_msgSend_691( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_691( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_691Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_691 = __objc_msgSend_691Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_getObjectValue_forString_range_error_1 = + _registerName1("getObjectValue:forString:range:error:"); + bool _objc_msgSend_692( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> obj1, + ffi.Pointer string, + ffi.Pointer<_NSRange> rangep, + ffi.Pointer> error, + ) { + return __objc_msgSend_692( + obj, + sel, + obj1, + string, + rangep, + error, + ); + } + + late final __objc_msgSend_692Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer<_NSRange>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_692 = __objc_msgSend_692Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer<_NSRange>, + ffi.Pointer>)>(); + + late final _sel_stringFromDate_1 = _registerName1("stringFromDate:"); + late final _sel_dateFromString_1 = _registerName1("dateFromString:"); + late final _sel_localizedStringFromDate_dateStyle_timeStyle_1 = + _registerName1("localizedStringFromDate:dateStyle:timeStyle:"); + ffi.Pointer _objc_msgSend_693( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int dstyle, + int tstyle, + ) { + return __objc_msgSend_693( + obj, + sel, + date, + dstyle, + tstyle, + ); + } + + late final __objc_msgSend_693Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_693 = __objc_msgSend_693Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_dateFormatFromTemplate_options_locale_1 = + _registerName1("dateFormatFromTemplate:options:locale:"); + ffi.Pointer _objc_msgSend_694( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer tmplate, + int opts, + ffi.Pointer locale, + ) { + return __objc_msgSend_694( + obj, + sel, + tmplate, + opts, + locale, + ); + } + + late final __objc_msgSend_694Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_694 = __objc_msgSend_694Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_defaultFormatterBehavior1 = + _registerName1("defaultFormatterBehavior"); + int _objc_msgSend_695( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_695( + obj, + sel, + ); + } + + late final __objc_msgSend_695Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_695 = __objc_msgSend_695Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDefaultFormatterBehavior_1 = + _registerName1("setDefaultFormatterBehavior:"); + void _objc_msgSend_696( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_696( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_696Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_696 = __objc_msgSend_696Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setLocalizedDateFormatFromTemplate_1 = + _registerName1("setLocalizedDateFormatFromTemplate:"); + late final _sel_dateFormat1 = _registerName1("dateFormat"); + late final _sel_setDateFormat_1 = _registerName1("setDateFormat:"); + late final _sel_dateStyle1 = _registerName1("dateStyle"); + int _objc_msgSend_697( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_697( + obj, + sel, + ); + } + + late final __objc_msgSend_697Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_697 = __objc_msgSend_697Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDateStyle_1 = _registerName1("setDateStyle:"); + void _objc_msgSend_698( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_698( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_698Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_698 = __objc_msgSend_698Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_timeStyle1 = _registerName1("timeStyle"); + late final _sel_setTimeStyle_1 = _registerName1("setTimeStyle:"); + late final _sel_locale1 = _registerName1("locale"); + late final _sel_setLocale_1 = _registerName1("setLocale:"); + void _objc_msgSend_699( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_699( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_699Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_699 = __objc_msgSend_699Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_generatesCalendarDates1 = + _registerName1("generatesCalendarDates"); + late final _sel_setGeneratesCalendarDates_1 = + _registerName1("setGeneratesCalendarDates:"); + late final _sel_formatterBehavior1 = _registerName1("formatterBehavior"); + late final _sel_setFormatterBehavior_1 = + _registerName1("setFormatterBehavior:"); + late final _class_NSCalendar1 = _getClass1("NSCalendar"); + late final _sel_currentCalendar1 = _registerName1("currentCalendar"); + ffi.Pointer _objc_msgSend_700( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_700( + obj, + sel, + ); + } + + late final __objc_msgSend_700Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_700 = __objc_msgSend_700Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_autoupdatingCurrentCalendar1 = + _registerName1("autoupdatingCurrentCalendar"); + late final _sel_calendarWithIdentifier_1 = + _registerName1("calendarWithIdentifier:"); + ffi.Pointer _objc_msgSend_701( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer calendarIdentifierConstant, + ) { + return __objc_msgSend_701( + obj, + sel, + calendarIdentifierConstant, + ); + } + + late final __objc_msgSend_701Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_701 = __objc_msgSend_701Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithCalendarIdentifier_1 = + _registerName1("initWithCalendarIdentifier:"); + late final _sel_firstWeekday1 = _registerName1("firstWeekday"); + late final _sel_setFirstWeekday_1 = _registerName1("setFirstWeekday:"); + late final _sel_minimumDaysInFirstWeek1 = + _registerName1("minimumDaysInFirstWeek"); + late final _sel_setMinimumDaysInFirstWeek_1 = + _registerName1("setMinimumDaysInFirstWeek:"); + late final _sel_eraSymbols1 = _registerName1("eraSymbols"); + late final _sel_longEraSymbols1 = _registerName1("longEraSymbols"); + late final _sel_monthSymbols1 = _registerName1("monthSymbols"); + late final _sel_shortMonthSymbols1 = _registerName1("shortMonthSymbols"); + late final _sel_veryShortMonthSymbols1 = + _registerName1("veryShortMonthSymbols"); + late final _sel_standaloneMonthSymbols1 = + _registerName1("standaloneMonthSymbols"); + late final _sel_shortStandaloneMonthSymbols1 = + _registerName1("shortStandaloneMonthSymbols"); + late final _sel_veryShortStandaloneMonthSymbols1 = + _registerName1("veryShortStandaloneMonthSymbols"); + late final _sel_weekdaySymbols1 = _registerName1("weekdaySymbols"); + late final _sel_shortWeekdaySymbols1 = _registerName1("shortWeekdaySymbols"); + late final _sel_veryShortWeekdaySymbols1 = + _registerName1("veryShortWeekdaySymbols"); + late final _sel_standaloneWeekdaySymbols1 = + _registerName1("standaloneWeekdaySymbols"); + late final _sel_shortStandaloneWeekdaySymbols1 = + _registerName1("shortStandaloneWeekdaySymbols"); + late final _sel_veryShortStandaloneWeekdaySymbols1 = + _registerName1("veryShortStandaloneWeekdaySymbols"); + late final _sel_quarterSymbols1 = _registerName1("quarterSymbols"); + late final _sel_shortQuarterSymbols1 = _registerName1("shortQuarterSymbols"); + late final _sel_standaloneQuarterSymbols1 = + _registerName1("standaloneQuarterSymbols"); + late final _sel_shortStandaloneQuarterSymbols1 = + _registerName1("shortStandaloneQuarterSymbols"); + late final _sel_AMSymbol1 = _registerName1("AMSymbol"); + late final _sel_PMSymbol1 = _registerName1("PMSymbol"); + late final _sel_minimumRangeOfUnit_1 = _registerName1("minimumRangeOfUnit:"); + void _objc_msgSend_702( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_702( + stret, + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_702Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); + late final __objc_msgSend_702 = __objc_msgSend_702Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_maximumRangeOfUnit_1 = _registerName1("maximumRangeOfUnit:"); + late final _sel_rangeOfUnit_inUnit_forDate_1 = + _registerName1("rangeOfUnit:inUnit:forDate:"); + void _objc_msgSend_703( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_703( + stret, + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_703Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_703 = __objc_msgSend_703Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + late final _sel_ordinalityOfUnit_inUnit_forDate_1 = + _registerName1("ordinalityOfUnit:inUnit:forDate:"); + int _objc_msgSend_704( + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_704( + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_704Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_704 = __objc_msgSend_704Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + late final _sel_rangeOfUnit_startDate_interval_forDate_1 = + _registerName1("rangeOfUnit:startDate:interval:forDate:"); + bool _objc_msgSend_705( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ffi.Pointer> datep, + ffi.Pointer tip, + ffi.Pointer date, + ) { + return __objc_msgSend_705( + obj, + sel, + unit, + datep, + tip, + date, + ); + } + + late final __objc_msgSend_705Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_705 = __objc_msgSend_705Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSDateComponents1 = _getClass1("NSDateComponents"); + late final _sel_calendar1 = _registerName1("calendar"); + late final _sel_setCalendar_1 = _registerName1("setCalendar:"); + void _objc_msgSend_706( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_706( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_706Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_706 = __objc_msgSend_706Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_era1 = _registerName1("era"); + late final _sel_setEra_1 = _registerName1("setEra:"); + late final _sel_year1 = _registerName1("year"); + late final _sel_setYear_1 = _registerName1("setYear:"); + late final _sel_month1 = _registerName1("month"); + late final _sel_setMonth_1 = _registerName1("setMonth:"); + late final _sel_day1 = _registerName1("day"); + late final _sel_setDay_1 = _registerName1("setDay:"); + late final _sel_hour1 = _registerName1("hour"); + late final _sel_setHour_1 = _registerName1("setHour:"); + late final _sel_minute1 = _registerName1("minute"); + late final _sel_setMinute_1 = _registerName1("setMinute:"); + late final _sel_second1 = _registerName1("second"); + late final _sel_setSecond_1 = _registerName1("setSecond:"); + late final _sel_nanosecond1 = _registerName1("nanosecond"); + late final _sel_setNanosecond_1 = _registerName1("setNanosecond:"); + late final _sel_weekday1 = _registerName1("weekday"); + late final _sel_setWeekday_1 = _registerName1("setWeekday:"); + late final _sel_weekdayOrdinal1 = _registerName1("weekdayOrdinal"); + late final _sel_setWeekdayOrdinal_1 = _registerName1("setWeekdayOrdinal:"); + late final _sel_quarter1 = _registerName1("quarter"); + late final _sel_setQuarter_1 = _registerName1("setQuarter:"); + late final _sel_weekOfMonth1 = _registerName1("weekOfMonth"); + late final _sel_setWeekOfMonth_1 = _registerName1("setWeekOfMonth:"); + late final _sel_weekOfYear1 = _registerName1("weekOfYear"); + late final _sel_setWeekOfYear_1 = _registerName1("setWeekOfYear:"); + late final _sel_yearForWeekOfYear1 = _registerName1("yearForWeekOfYear"); + late final _sel_setYearForWeekOfYear_1 = + _registerName1("setYearForWeekOfYear:"); + late final _sel_isLeapMonth1 = _registerName1("isLeapMonth"); + late final _sel_setLeapMonth_1 = _registerName1("setLeapMonth:"); + late final _sel_week1 = _registerName1("week"); + late final _sel_setWeek_1 = _registerName1("setWeek:"); + late final _sel_setValue_forComponent_1 = + _registerName1("setValue:forComponent:"); + void _objc_msgSend_707( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + int unit, + ) { + return __objc_msgSend_707( + obj, + sel, + value, + unit, + ); + } + + late final __objc_msgSend_707Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Long, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_707 = __objc_msgSend_707Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_valueForComponent_1 = _registerName1("valueForComponent:"); + int _objc_msgSend_708( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_708( + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_708Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_708 = __objc_msgSend_708Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isValidDate1 = _registerName1("isValidDate"); + late final _sel_isValidDateInCalendar_1 = + _registerName1("isValidDateInCalendar:"); + bool _objc_msgSend_709( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer calendar, + ) { + return __objc_msgSend_709( + obj, + sel, + calendar, + ); + } + + late final __objc_msgSend_709Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_709 = __objc_msgSend_709Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_dateFromComponents_1 = _registerName1("dateFromComponents:"); + ffi.Pointer _objc_msgSend_710( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comps, + ) { + return __objc_msgSend_710( + obj, + sel, + comps, + ); + } + + late final __objc_msgSend_710Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_710 = __objc_msgSend_710Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_components_fromDate_1 = + _registerName1("components:fromDate:"); + ffi.Pointer _objc_msgSend_711( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer date, + ) { + return __objc_msgSend_711( + obj, + sel, + unitFlags, + date, + ); + } + + late final __objc_msgSend_711Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_711 = __objc_msgSend_711Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_dateByAddingComponents_toDate_options_1 = + _registerName1("dateByAddingComponents:toDate:options:"); + ffi.Pointer _objc_msgSend_712( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer comps, + ffi.Pointer date, + int opts, + ) { + return __objc_msgSend_712( + obj, + sel, + comps, + date, + opts, + ); + } + + late final __objc_msgSend_712Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_712 = __objc_msgSend_712Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_components_fromDate_toDate_options_1 = + _registerName1("components:fromDate:toDate:options:"); + ffi.Pointer _objc_msgSend_713( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer startingDate, + ffi.Pointer resultDate, + int opts, + ) { + return __objc_msgSend_713( + obj, + sel, + unitFlags, + startingDate, + resultDate, + opts, + ); + } + + late final __objc_msgSend_713Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_713 = __objc_msgSend_713Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_getEra_year_month_day_fromDate_1 = + _registerName1("getEra:year:month:day:fromDate:"); + void _objc_msgSend_714( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer monthValuePointer, + ffi.Pointer dayValuePointer, + ffi.Pointer date, + ) { + return __objc_msgSend_714( + obj, + sel, + eraValuePointer, + yearValuePointer, + monthValuePointer, + dayValuePointer, + date, + ); + } + + late final __objc_msgSend_714Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_714 = __objc_msgSend_714Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1 = + _registerName1("getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:"); + late final _sel_getHour_minute_second_nanosecond_fromDate_1 = + _registerName1("getHour:minute:second:nanosecond:fromDate:"); + late final _sel_component_fromDate_1 = _registerName1("component:fromDate:"); + int _objc_msgSend_715( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ffi.Pointer date, + ) { + return __objc_msgSend_715( + obj, + sel, + unit, + date, + ); + } + + late final __objc_msgSend_715Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_715 = __objc_msgSend_715Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1 = + _registerName1( + "dateWithEra:year:month:day:hour:minute:second:nanosecond:"); + ffi.Pointer _objc_msgSend_716( + ffi.Pointer obj, + ffi.Pointer sel, + int eraValue, + int yearValue, + int monthValue, + int dayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue, + ) { + return __objc_msgSend_716( + obj, + sel, + eraValue, + yearValue, + monthValue, + dayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue, + ); + } + + late final __objc_msgSend_716Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_716 = __objc_msgSend_716Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, int, int, int, int, int)>(); + + late final _sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1 = + _registerName1( + "dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:"); + late final _sel_startOfDayForDate_1 = _registerName1("startOfDayForDate:"); + late final _sel_componentsInTimeZone_fromDate_1 = + _registerName1("componentsInTimeZone:fromDate:"); + ffi.Pointer _objc_msgSend_717( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer timezone, + ffi.Pointer date, + ) { + return __objc_msgSend_717( + obj, + sel, + timezone, + date, + ); + } + + late final __objc_msgSend_717Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_717 = __objc_msgSend_717Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_compareDate_toDate_toUnitGranularity_1 = + _registerName1("compareDate:toDate:toUnitGranularity:"); + int _objc_msgSend_718( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + int unit, + ) { + return __objc_msgSend_718( + obj, + sel, + date1, + date2, + unit, + ); + } + + late final __objc_msgSend_718Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_718 = __objc_msgSend_718Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isDate_equalToDate_toUnitGranularity_1 = + _registerName1("isDate:equalToDate:toUnitGranularity:"); + bool _objc_msgSend_719( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + int unit, + ) { + return __objc_msgSend_719( + obj, + sel, + date1, + date2, + unit, + ); + } + + late final __objc_msgSend_719Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_719 = __objc_msgSend_719Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isDate_inSameDayAsDate_1 = + _registerName1("isDate:inSameDayAsDate:"); + bool _objc_msgSend_720( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date1, + ffi.Pointer date2, + ) { + return __objc_msgSend_720( + obj, + sel, + date1, + date2, + ); + } + + late final __objc_msgSend_720Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_720 = __objc_msgSend_720Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isDateInToday_1 = _registerName1("isDateInToday:"); + late final _sel_isDateInYesterday_1 = _registerName1("isDateInYesterday:"); + late final _sel_isDateInTomorrow_1 = _registerName1("isDateInTomorrow:"); + late final _sel_isDateInWeekend_1 = _registerName1("isDateInWeekend:"); + late final _sel_rangeOfWeekendStartDate_interval_containingDate_1 = + _registerName1("rangeOfWeekendStartDate:interval:containingDate:"); + bool _objc_msgSend_721( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> datep, + ffi.Pointer tip, + ffi.Pointer date, + ) { + return __objc_msgSend_721( + obj, + sel, + datep, + tip, + date, + ); + } + + late final __objc_msgSend_721Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_721 = __objc_msgSend_721Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_nextWeekendStartDate_interval_options_afterDate_1 = + _registerName1("nextWeekendStartDate:interval:options:afterDate:"); + bool _objc_msgSend_722( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> datep, + ffi.Pointer tip, + int options, + ffi.Pointer date, + ) { + return __objc_msgSend_722( + obj, + sel, + datep, + tip, + options, + date, + ); + } + + late final __objc_msgSend_722Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_722 = __objc_msgSend_722Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_components_fromDateComponents_toDateComponents_options_1 = + _registerName1("components:fromDateComponents:toDateComponents:options:"); + ffi.Pointer _objc_msgSend_723( + ffi.Pointer obj, + ffi.Pointer sel, + int unitFlags, + ffi.Pointer startingDateComp, + ffi.Pointer resultDateComp, + int options, + ) { + return __objc_msgSend_723( + obj, + sel, + unitFlags, + startingDateComp, + resultDateComp, + options, + ); + } + + late final __objc_msgSend_723Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_723 = __objc_msgSend_723Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_dateByAddingUnit_value_toDate_options_1 = + _registerName1("dateByAddingUnit:value:toDate:options:"); + ffi.Pointer _objc_msgSend_724( + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + int value, + ffi.Pointer date, + int options, + ) { + return __objc_msgSend_724( + obj, + sel, + unit, + value, + date, + options, + ); + } + + late final __objc_msgSend_724Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Long, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_724 = __objc_msgSend_724Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer, int)>(); + + late final _sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1 = + _registerName1( + "enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:"); + void _objc_msgSend_725( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer start, + ffi.Pointer comps, + int opts, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_725( + obj, + sel, + start, + comps, + opts, + block, + ); + } + + late final __objc_msgSend_725Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_725 = __objc_msgSend_725Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_nextDateAfterDate_matchingComponents_options_1 = + _registerName1("nextDateAfterDate:matchingComponents:options:"); + ffi.Pointer _objc_msgSend_726( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ffi.Pointer comps, + int options, + ) { + return __objc_msgSend_726( + obj, + sel, + date, + comps, + options, + ); + } + + late final __objc_msgSend_726Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_726 = __objc_msgSend_726Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_nextDateAfterDate_matchingUnit_value_options_1 = + _registerName1("nextDateAfterDate:matchingUnit:value:options:"); + ffi.Pointer _objc_msgSend_727( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int unit, + int value, + int options, + ) { + return __objc_msgSend_727( + obj, + sel, + date, + unit, + value, + options, + ); + } + + late final __objc_msgSend_727Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Long, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_727 = __objc_msgSend_727Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int, int)>(); + + late final _sel_nextDateAfterDate_matchingHour_minute_second_options_1 = + _registerName1("nextDateAfterDate:matchingHour:minute:second:options:"); + ffi.Pointer _objc_msgSend_728( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + int hourValue, + int minuteValue, + int secondValue, + int options, + ) { + return __objc_msgSend_728( + obj, + sel, + date, + hourValue, + minuteValue, + secondValue, + options, + ); + } + + late final __objc_msgSend_728Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_728 = __objc_msgSend_728Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int, int, int)>(); + + late final _sel_dateBySettingUnit_value_ofDate_options_1 = + _registerName1("dateBySettingUnit:value:ofDate:options:"); + late final _sel_dateBySettingHour_minute_second_ofDate_options_1 = + _registerName1("dateBySettingHour:minute:second:ofDate:options:"); + ffi.Pointer _objc_msgSend_729( + ffi.Pointer obj, + ffi.Pointer sel, + int h, + int m, + int s, + ffi.Pointer date, + int opts, + ) { + return __objc_msgSend_729( + obj, + sel, + h, + m, + s, + date, + opts, + ); + } + + late final __objc_msgSend_729Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Long, + ffi.Long, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_729 = __objc_msgSend_729Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, int, ffi.Pointer, int)>(); + + late final _sel_date_matchesComponents_1 = + _registerName1("date:matchesComponents:"); + bool _objc_msgSend_730( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer date, + ffi.Pointer components, + ) { + return __objc_msgSend_730( + obj, + sel, + date, + components, + ); + } + + late final __objc_msgSend_730Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_730 = __objc_msgSend_730Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isLenient1 = _registerName1("isLenient"); + late final _sel_setLenient_1 = _registerName1("setLenient:"); + late final _sel_twoDigitStartDate1 = _registerName1("twoDigitStartDate"); + late final _sel_setTwoDigitStartDate_1 = + _registerName1("setTwoDigitStartDate:"); + late final _sel_defaultDate1 = _registerName1("defaultDate"); + late final _sel_setDefaultDate_1 = _registerName1("setDefaultDate:"); + late final _sel_setEraSymbols_1 = _registerName1("setEraSymbols:"); + void _objc_msgSend_731( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_731( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_731Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_731 = __objc_msgSend_731Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setMonthSymbols_1 = _registerName1("setMonthSymbols:"); + late final _sel_setShortMonthSymbols_1 = + _registerName1("setShortMonthSymbols:"); + late final _sel_setWeekdaySymbols_1 = _registerName1("setWeekdaySymbols:"); + late final _sel_setShortWeekdaySymbols_1 = + _registerName1("setShortWeekdaySymbols:"); + late final _sel_setAMSymbol_1 = _registerName1("setAMSymbol:"); + late final _sel_setPMSymbol_1 = _registerName1("setPMSymbol:"); + late final _sel_setLongEraSymbols_1 = _registerName1("setLongEraSymbols:"); + late final _sel_setVeryShortMonthSymbols_1 = + _registerName1("setVeryShortMonthSymbols:"); + late final _sel_setStandaloneMonthSymbols_1 = + _registerName1("setStandaloneMonthSymbols:"); + late final _sel_setShortStandaloneMonthSymbols_1 = + _registerName1("setShortStandaloneMonthSymbols:"); + late final _sel_setVeryShortStandaloneMonthSymbols_1 = + _registerName1("setVeryShortStandaloneMonthSymbols:"); + late final _sel_setVeryShortWeekdaySymbols_1 = + _registerName1("setVeryShortWeekdaySymbols:"); + late final _sel_setStandaloneWeekdaySymbols_1 = + _registerName1("setStandaloneWeekdaySymbols:"); + late final _sel_setShortStandaloneWeekdaySymbols_1 = + _registerName1("setShortStandaloneWeekdaySymbols:"); + late final _sel_setVeryShortStandaloneWeekdaySymbols_1 = + _registerName1("setVeryShortStandaloneWeekdaySymbols:"); + late final _sel_setQuarterSymbols_1 = _registerName1("setQuarterSymbols:"); + late final _sel_setShortQuarterSymbols_1 = + _registerName1("setShortQuarterSymbols:"); + late final _sel_setStandaloneQuarterSymbols_1 = + _registerName1("setStandaloneQuarterSymbols:"); + late final _sel_setShortStandaloneQuarterSymbols_1 = + _registerName1("setShortStandaloneQuarterSymbols:"); + late final _sel_gregorianStartDate1 = _registerName1("gregorianStartDate"); + late final _sel_setGregorianStartDate_1 = + _registerName1("setGregorianStartDate:"); + late final _sel_doesRelativeDateFormatting1 = + _registerName1("doesRelativeDateFormatting"); + late final _sel_setDoesRelativeDateFormatting_1 = + _registerName1("setDoesRelativeDateFormatting:"); + late final _sel_initWithDateFormat_allowNaturalLanguage_1 = + _registerName1("initWithDateFormat:allowNaturalLanguage:"); + late final _sel_allowsNaturalLanguage1 = + _registerName1("allowsNaturalLanguage"); + late final _class_NSNumberFormatter1 = _getClass1("NSNumberFormatter"); + late final _sel_stringFromNumber_1 = _registerName1("stringFromNumber:"); + ffi.Pointer _objc_msgSend_732( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer number, + ) { + return __objc_msgSend_732( + obj, + sel, + number, + ); + } + + late final __objc_msgSend_732Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_732 = __objc_msgSend_732Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberFromString_1 = _registerName1("numberFromString:"); + ffi.Pointer _objc_msgSend_733( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ) { + return __objc_msgSend_733( + obj, + sel, + string, + ); + } + + late final __objc_msgSend_733Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_733 = __objc_msgSend_733Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_localizedStringFromNumber_numberStyle_1 = + _registerName1("localizedStringFromNumber:numberStyle:"); + ffi.Pointer _objc_msgSend_734( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer num, + int nstyle, + ) { + return __objc_msgSend_734( + obj, + sel, + num, + nstyle, + ); + } + + late final __objc_msgSend_734Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_734 = __objc_msgSend_734Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + int _objc_msgSend_735( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_735( + obj, + sel, + ); + } + + late final __objc_msgSend_735Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_735 = __objc_msgSend_735Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_736( + ffi.Pointer obj, + ffi.Pointer sel, + int behavior, + ) { + return __objc_msgSend_736( + obj, + sel, + behavior, + ); + } + + late final __objc_msgSend_736Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_736 = __objc_msgSend_736Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_numberStyle1 = _registerName1("numberStyle"); + int _objc_msgSend_737( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_737( + obj, + sel, + ); + } + + late final __objc_msgSend_737Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_737 = __objc_msgSend_737Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setNumberStyle_1 = _registerName1("setNumberStyle:"); + void _objc_msgSend_738( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_738( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_738Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_738 = __objc_msgSend_738Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_generatesDecimalNumbers1 = + _registerName1("generatesDecimalNumbers"); + late final _sel_setGeneratesDecimalNumbers_1 = + _registerName1("setGeneratesDecimalNumbers:"); + void _objc_msgSend_739( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_739( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_739Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_739 = __objc_msgSend_739Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_negativeFormat1 = _registerName1("negativeFormat"); + late final _sel_setNegativeFormat_1 = _registerName1("setNegativeFormat:"); + late final _sel_textAttributesForNegativeValues1 = + _registerName1("textAttributesForNegativeValues"); + late final _sel_setTextAttributesForNegativeValues_1 = + _registerName1("setTextAttributesForNegativeValues:"); + late final _sel_positiveFormat1 = _registerName1("positiveFormat"); + late final _sel_setPositiveFormat_1 = _registerName1("setPositiveFormat:"); + late final _sel_textAttributesForPositiveValues1 = + _registerName1("textAttributesForPositiveValues"); + late final _sel_setTextAttributesForPositiveValues_1 = + _registerName1("setTextAttributesForPositiveValues:"); + late final _sel_allowsFloats1 = _registerName1("allowsFloats"); + late final _sel_setAllowsFloats_1 = _registerName1("setAllowsFloats:"); + late final _sel_setDecimalSeparator_1 = + _registerName1("setDecimalSeparator:"); + late final _sel_alwaysShowsDecimalSeparator1 = + _registerName1("alwaysShowsDecimalSeparator"); + late final _sel_setAlwaysShowsDecimalSeparator_1 = + _registerName1("setAlwaysShowsDecimalSeparator:"); + late final _sel_currencyDecimalSeparator1 = + _registerName1("currencyDecimalSeparator"); + late final _sel_setCurrencyDecimalSeparator_1 = + _registerName1("setCurrencyDecimalSeparator:"); + late final _sel_usesGroupingSeparator1 = + _registerName1("usesGroupingSeparator"); + late final _sel_setUsesGroupingSeparator_1 = + _registerName1("setUsesGroupingSeparator:"); + late final _sel_setGroupingSeparator_1 = + _registerName1("setGroupingSeparator:"); + late final _sel_zeroSymbol1 = _registerName1("zeroSymbol"); + late final _sel_setZeroSymbol_1 = _registerName1("setZeroSymbol:"); + late final _sel_textAttributesForZero1 = + _registerName1("textAttributesForZero"); + late final _sel_setTextAttributesForZero_1 = + _registerName1("setTextAttributesForZero:"); + late final _sel_nilSymbol1 = _registerName1("nilSymbol"); + late final _sel_setNilSymbol_1 = _registerName1("setNilSymbol:"); + late final _sel_textAttributesForNil1 = + _registerName1("textAttributesForNil"); + late final _sel_setTextAttributesForNil_1 = + _registerName1("setTextAttributesForNil:"); + late final _sel_notANumberSymbol1 = _registerName1("notANumberSymbol"); + late final _sel_setNotANumberSymbol_1 = + _registerName1("setNotANumberSymbol:"); + late final _sel_textAttributesForNotANumber1 = + _registerName1("textAttributesForNotANumber"); + late final _sel_setTextAttributesForNotANumber_1 = + _registerName1("setTextAttributesForNotANumber:"); + late final _sel_positiveInfinitySymbol1 = + _registerName1("positiveInfinitySymbol"); + late final _sel_setPositiveInfinitySymbol_1 = + _registerName1("setPositiveInfinitySymbol:"); + late final _sel_textAttributesForPositiveInfinity1 = + _registerName1("textAttributesForPositiveInfinity"); + late final _sel_setTextAttributesForPositiveInfinity_1 = + _registerName1("setTextAttributesForPositiveInfinity:"); + late final _sel_negativeInfinitySymbol1 = + _registerName1("negativeInfinitySymbol"); + late final _sel_setNegativeInfinitySymbol_1 = + _registerName1("setNegativeInfinitySymbol:"); + late final _sel_textAttributesForNegativeInfinity1 = + _registerName1("textAttributesForNegativeInfinity"); + late final _sel_setTextAttributesForNegativeInfinity_1 = + _registerName1("setTextAttributesForNegativeInfinity:"); + late final _sel_positivePrefix1 = _registerName1("positivePrefix"); + late final _sel_setPositivePrefix_1 = _registerName1("setPositivePrefix:"); + late final _sel_positiveSuffix1 = _registerName1("positiveSuffix"); + late final _sel_setPositiveSuffix_1 = _registerName1("setPositiveSuffix:"); + late final _sel_negativePrefix1 = _registerName1("negativePrefix"); + late final _sel_setNegativePrefix_1 = _registerName1("setNegativePrefix:"); + late final _sel_negativeSuffix1 = _registerName1("negativeSuffix"); + late final _sel_setNegativeSuffix_1 = _registerName1("setNegativeSuffix:"); + late final _sel_setCurrencyCode_1 = _registerName1("setCurrencyCode:"); + late final _sel_setCurrencySymbol_1 = _registerName1("setCurrencySymbol:"); + late final _sel_internationalCurrencySymbol1 = + _registerName1("internationalCurrencySymbol"); + late final _sel_setInternationalCurrencySymbol_1 = + _registerName1("setInternationalCurrencySymbol:"); + late final _sel_percentSymbol1 = _registerName1("percentSymbol"); + late final _sel_setPercentSymbol_1 = _registerName1("setPercentSymbol:"); + late final _sel_perMillSymbol1 = _registerName1("perMillSymbol"); + late final _sel_setPerMillSymbol_1 = _registerName1("setPerMillSymbol:"); + late final _sel_minusSign1 = _registerName1("minusSign"); + late final _sel_setMinusSign_1 = _registerName1("setMinusSign:"); + late final _sel_plusSign1 = _registerName1("plusSign"); + late final _sel_setPlusSign_1 = _registerName1("setPlusSign:"); + late final _sel_exponentSymbol1 = _registerName1("exponentSymbol"); + late final _sel_setExponentSymbol_1 = _registerName1("setExponentSymbol:"); + late final _sel_groupingSize1 = _registerName1("groupingSize"); + late final _sel_setGroupingSize_1 = _registerName1("setGroupingSize:"); + late final _sel_secondaryGroupingSize1 = + _registerName1("secondaryGroupingSize"); + late final _sel_setSecondaryGroupingSize_1 = + _registerName1("setSecondaryGroupingSize:"); + late final _sel_multiplier1 = _registerName1("multiplier"); + late final _sel_setMultiplier_1 = _registerName1("setMultiplier:"); + late final _sel_formatWidth1 = _registerName1("formatWidth"); + late final _sel_setFormatWidth_1 = _registerName1("setFormatWidth:"); + late final _sel_paddingCharacter1 = _registerName1("paddingCharacter"); + late final _sel_setPaddingCharacter_1 = + _registerName1("setPaddingCharacter:"); + late final _sel_paddingPosition1 = _registerName1("paddingPosition"); + int _objc_msgSend_740( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_740( + obj, + sel, + ); + } + + late final __objc_msgSend_740Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_740 = __objc_msgSend_740Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPaddingPosition_1 = _registerName1("setPaddingPosition:"); + void _objc_msgSend_741( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_741( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_741Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_741 = __objc_msgSend_741Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_roundingMode1 = _registerName1("roundingMode"); + int _objc_msgSend_742( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_742( + obj, + sel, + ); + } + + late final __objc_msgSend_742Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_742 = __objc_msgSend_742Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setRoundingMode_1 = _registerName1("setRoundingMode:"); + void _objc_msgSend_743( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_743( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_743Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_743 = __objc_msgSend_743Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_roundingIncrement1 = _registerName1("roundingIncrement"); + late final _sel_setRoundingIncrement_1 = + _registerName1("setRoundingIncrement:"); + late final _sel_minimumIntegerDigits1 = + _registerName1("minimumIntegerDigits"); + late final _sel_setMinimumIntegerDigits_1 = + _registerName1("setMinimumIntegerDigits:"); + late final _sel_maximumIntegerDigits1 = + _registerName1("maximumIntegerDigits"); + late final _sel_setMaximumIntegerDigits_1 = + _registerName1("setMaximumIntegerDigits:"); + late final _sel_minimumFractionDigits1 = + _registerName1("minimumFractionDigits"); + late final _sel_setMinimumFractionDigits_1 = + _registerName1("setMinimumFractionDigits:"); + late final _sel_maximumFractionDigits1 = + _registerName1("maximumFractionDigits"); + late final _sel_setMaximumFractionDigits_1 = + _registerName1("setMaximumFractionDigits:"); + late final _sel_minimum1 = _registerName1("minimum"); + late final _sel_setMinimum_1 = _registerName1("setMinimum:"); + late final _sel_maximum1 = _registerName1("maximum"); + late final _sel_setMaximum_1 = _registerName1("setMaximum:"); + late final _sel_currencyGroupingSeparator1 = + _registerName1("currencyGroupingSeparator"); + late final _sel_setCurrencyGroupingSeparator_1 = + _registerName1("setCurrencyGroupingSeparator:"); + late final _sel_usesSignificantDigits1 = + _registerName1("usesSignificantDigits"); + late final _sel_setUsesSignificantDigits_1 = + _registerName1("setUsesSignificantDigits:"); + late final _sel_minimumSignificantDigits1 = + _registerName1("minimumSignificantDigits"); + late final _sel_setMinimumSignificantDigits_1 = + _registerName1("setMinimumSignificantDigits:"); + late final _sel_maximumSignificantDigits1 = + _registerName1("maximumSignificantDigits"); + late final _sel_setMaximumSignificantDigits_1 = + _registerName1("setMaximumSignificantDigits:"); + late final _sel_isPartialStringValidationEnabled1 = + _registerName1("isPartialStringValidationEnabled"); + late final _sel_setPartialStringValidationEnabled_1 = + _registerName1("setPartialStringValidationEnabled:"); + late final _sel_hasThousandSeparators1 = + _registerName1("hasThousandSeparators"); + late final _sel_setHasThousandSeparators_1 = + _registerName1("setHasThousandSeparators:"); + late final _sel_thousandSeparator1 = _registerName1("thousandSeparator"); + late final _sel_setThousandSeparator_1 = + _registerName1("setThousandSeparator:"); + late final _sel_localizesFormat1 = _registerName1("localizesFormat"); + late final _sel_setLocalizesFormat_1 = _registerName1("setLocalizesFormat:"); + late final _sel_format1 = _registerName1("format"); + late final _sel_setFormat_1 = _registerName1("setFormat:"); + late final _sel_attributedStringForZero1 = + _registerName1("attributedStringForZero"); + late final _sel_setAttributedStringForZero_1 = + _registerName1("setAttributedStringForZero:"); + void _objc_msgSend_744( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_744( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_744Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_744 = __objc_msgSend_744Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attributedStringForNil1 = + _registerName1("attributedStringForNil"); + late final _sel_setAttributedStringForNil_1 = + _registerName1("setAttributedStringForNil:"); + late final _sel_attributedStringForNotANumber1 = + _registerName1("attributedStringForNotANumber"); + late final _sel_setAttributedStringForNotANumber_1 = + _registerName1("setAttributedStringForNotANumber:"); + late final _class_NSDecimalNumberHandler1 = + _getClass1("NSDecimalNumberHandler"); + late final _sel_defaultDecimalNumberHandler1 = + _registerName1("defaultDecimalNumberHandler"); + ffi.Pointer _objc_msgSend_745( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_745( + obj, + sel, + ); + } + + late final __objc_msgSend_745Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_745 = __objc_msgSend_745Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = + _registerName1( + "initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); + instancetype _objc_msgSend_746( + ffi.Pointer obj, + ffi.Pointer sel, + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero, + ) { + return __objc_msgSend_746( + obj, + sel, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero, + ); + } + + late final __objc_msgSend_746Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Short, + ffi.Bool, + ffi.Bool, + ffi.Bool, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_746 = __objc_msgSend_746Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, bool, bool, bool, bool)>(); + + late final _sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1 = + _registerName1( + "decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:"); + late final _sel_roundingBehavior1 = _registerName1("roundingBehavior"); + late final _sel_setRoundingBehavior_1 = + _registerName1("setRoundingBehavior:"); + void _objc_msgSend_747( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_747( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_747Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_747 = __objc_msgSend_747Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSScanner1 = _getClass1("NSScanner"); + late final _sel_scanLocation1 = _registerName1("scanLocation"); + late final _sel_setScanLocation_1 = _registerName1("setScanLocation:"); + late final _sel_charactersToBeSkipped1 = + _registerName1("charactersToBeSkipped"); + late final _sel_setCharactersToBeSkipped_1 = + _registerName1("setCharactersToBeSkipped:"); + void _objc_msgSend_748( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_748( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_748Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_748 = __objc_msgSend_748Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_caseSensitive1 = _registerName1("caseSensitive"); + late final _sel_setCaseSensitive_1 = _registerName1("setCaseSensitive:"); + late final _sel_scanInt_1 = _registerName1("scanInt:"); + bool _objc_msgSend_749( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_749( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_749Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_749 = __objc_msgSend_749Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanInteger_1 = _registerName1("scanInteger:"); + bool _objc_msgSend_750( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_750( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_750Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_750 = __objc_msgSend_750Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanLongLong_1 = _registerName1("scanLongLong:"); + bool _objc_msgSend_751( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_751( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_751Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_751 = __objc_msgSend_751Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanUnsignedLongLong_1 = + _registerName1("scanUnsignedLongLong:"); + bool _objc_msgSend_752( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_752( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_752Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_752 = __objc_msgSend_752Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanFloat_1 = _registerName1("scanFloat:"); + bool _objc_msgSend_753( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_753( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_753Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_753 = __objc_msgSend_753Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanDouble_1 = _registerName1("scanDouble:"); + bool _objc_msgSend_754( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_754( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_754Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_754 = __objc_msgSend_754Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanHexInt_1 = _registerName1("scanHexInt:"); + bool _objc_msgSend_755( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ) { + return __objc_msgSend_755( + obj, + sel, + result, + ); + } + + late final __objc_msgSend_755Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_755 = __objc_msgSend_755Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_scanHexLongLong_1 = _registerName1("scanHexLongLong:"); + late final _sel_scanHexFloat_1 = _registerName1("scanHexFloat:"); + late final _sel_scanHexDouble_1 = _registerName1("scanHexDouble:"); + late final _sel_scanString_intoString_1 = + _registerName1("scanString:intoString:"); + bool _objc_msgSend_756( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + ffi.Pointer> result, + ) { + return __objc_msgSend_756( + obj, + sel, + string, + result, + ); + } + + late final __objc_msgSend_756Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_756 = __objc_msgSend_756Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_scanCharactersFromSet_intoString_1 = + _registerName1("scanCharactersFromSet:intoString:"); + bool _objc_msgSend_757( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer set1, + ffi.Pointer> result, + ) { + return __objc_msgSend_757( + obj, + sel, + set1, + result, + ); + } + + late final __objc_msgSend_757Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_757 = __objc_msgSend_757Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_scanUpToString_intoString_1 = + _registerName1("scanUpToString:intoString:"); + late final _sel_scanUpToCharactersFromSet_intoString_1 = + _registerName1("scanUpToCharactersFromSet:intoString:"); + late final _sel_isAtEnd1 = _registerName1("isAtEnd"); + late final _sel_scannerWithString_1 = _registerName1("scannerWithString:"); + late final _sel_localizedScannerWithString_1 = + _registerName1("localizedScannerWithString:"); + late final _sel_scanDecimal_1 = _registerName1("scanDecimal:"); + bool _objc_msgSend_758( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dcm, + ) { + return __objc_msgSend_758( + obj, + sel, + dcm, + ); + } + + late final __objc_msgSend_758Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_758 = __objc_msgSend_758Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSException1 = _getClass1("NSException"); + late final _sel_exceptionWithName_reason_userInfo_1 = + _registerName1("exceptionWithName:reason:userInfo:"); + ffi.Pointer _objc_msgSend_759( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer reason, + ffi.Pointer userInfo, + ) { + return __objc_msgSend_759( + obj, + sel, + name, + reason, + userInfo, + ); + } + + late final __objc_msgSend_759Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_759 = __objc_msgSend_759Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithName_reason_userInfo_1 = + _registerName1("initWithName:reason:userInfo:"); + late final _sel_reason1 = _registerName1("reason"); + late final _sel_raise1 = _registerName1("raise"); + late final _sel_raise_format_1 = _registerName1("raise:format:"); + late final _sel_raise_format_arguments_1 = + _registerName1("raise:format:arguments:"); + void _objc_msgSend_760( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer format, + ffi.Pointer<__va_list_tag> argList, + ) { + return __objc_msgSend_760( + obj, + sel, + name, + format, + argList, + ); + } + + late final __objc_msgSend_760Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>>('objc_msgSend'); + late final __objc_msgSend_760 = __objc_msgSend_760Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__va_list_tag>)>(); + + late final _class_NSFileHandle1 = _getClass1("NSFileHandle"); + late final _sel_availableData1 = _registerName1("availableData"); + late final _sel_initWithFileDescriptor_closeOnDealloc_1 = + _registerName1("initWithFileDescriptor:closeOnDealloc:"); + instancetype _objc_msgSend_761( + ffi.Pointer obj, + ffi.Pointer sel, + int fd, + bool closeopt, + ) { + return __objc_msgSend_761( + obj, + sel, + fd, + closeopt, + ); + } + + late final __objc_msgSend_761Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_761 = __objc_msgSend_761Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int, bool)>(); + + late final _sel_readDataToEndOfFileAndReturnError_1 = + _registerName1("readDataToEndOfFileAndReturnError:"); + ffi.Pointer _objc_msgSend_762( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> error, + ) { + return __objc_msgSend_762( + obj, + sel, + error, + ); + } + + late final __objc_msgSend_762Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_762 = __objc_msgSend_762Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_readDataUpToLength_error_1 = + _registerName1("readDataUpToLength:error:"); + ffi.Pointer _objc_msgSend_763( + ffi.Pointer obj, + ffi.Pointer sel, + int length, + ffi.Pointer> error, + ) { + return __objc_msgSend_763( + obj, + sel, + length, + error, + ); + } + + late final __objc_msgSend_763Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_763 = __objc_msgSend_763Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer>)>(); + + late final _sel_writeData_error_1 = _registerName1("writeData:error:"); + bool _objc_msgSend_764( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer> error, + ) { + return __objc_msgSend_764( + obj, + sel, + data, + error, + ); + } + + late final __objc_msgSend_764Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_764 = __objc_msgSend_764Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_getOffset_error_1 = _registerName1("getOffset:error:"); + bool _objc_msgSend_765( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer offsetInFile, + ffi.Pointer> error, + ) { + return __objc_msgSend_765( + obj, + sel, + offsetInFile, + error, + ); + } + + late final __objc_msgSend_765Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_765 = __objc_msgSend_765Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_seekToEndReturningOffset_error_1 = + _registerName1("seekToEndReturningOffset:error:"); + late final _sel_seekToOffset_error_1 = _registerName1("seekToOffset:error:"); + bool _objc_msgSend_766( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ffi.Pointer> error, + ) { + return __objc_msgSend_766( + obj, + sel, + offset, + error, + ); + } + + late final __objc_msgSend_766Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLongLong, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_766 = __objc_msgSend_766Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer>)>(); + + late final _sel_truncateAtOffset_error_1 = + _registerName1("truncateAtOffset:error:"); + late final _sel_synchronizeAndReturnError_1 = + _registerName1("synchronizeAndReturnError:"); + late final _sel_closeAndReturnError_1 = + _registerName1("closeAndReturnError:"); + late final _sel_fileHandleWithStandardInput1 = + _registerName1("fileHandleWithStandardInput"); + ffi.Pointer _objc_msgSend_767( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_767( + obj, + sel, + ); + } + + late final __objc_msgSend_767Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_fileHandleWithStandardOutput1 = + _registerName1("fileHandleWithStandardOutput"); + late final _sel_fileHandleWithStandardError1 = + _registerName1("fileHandleWithStandardError"); + late final _sel_fileHandleWithNullDevice1 = + _registerName1("fileHandleWithNullDevice"); + late final _sel_fileHandleForReadingAtPath_1 = + _registerName1("fileHandleForReadingAtPath:"); + late final _sel_fileHandleForWritingAtPath_1 = + _registerName1("fileHandleForWritingAtPath:"); + late final _sel_fileHandleForUpdatingAtPath_1 = + _registerName1("fileHandleForUpdatingAtPath:"); + late final _sel_fileHandleForReadingFromURL_error_1 = + _registerName1("fileHandleForReadingFromURL:error:"); + instancetype _objc_msgSend_768( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer> error, + ) { + return __objc_msgSend_768( + obj, + sel, + url, + error, + ); + } + + late final __objc_msgSend_768Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); + + late final _sel_fileHandleForWritingToURL_error_1 = + _registerName1("fileHandleForWritingToURL:error:"); + late final _sel_fileHandleForUpdatingURL_error_1 = + _registerName1("fileHandleForUpdatingURL:error:"); + late final _sel_readInBackgroundAndNotifyForModes_1 = + _registerName1("readInBackgroundAndNotifyForModes:"); + late final _sel_readInBackgroundAndNotify1 = + _registerName1("readInBackgroundAndNotify"); + late final _sel_readToEndOfFileInBackgroundAndNotifyForModes_1 = + _registerName1("readToEndOfFileInBackgroundAndNotifyForModes:"); + late final _sel_readToEndOfFileInBackgroundAndNotify1 = + _registerName1("readToEndOfFileInBackgroundAndNotify"); + late final _sel_acceptConnectionInBackgroundAndNotifyForModes_1 = + _registerName1("acceptConnectionInBackgroundAndNotifyForModes:"); + late final _sel_acceptConnectionInBackgroundAndNotify1 = + _registerName1("acceptConnectionInBackgroundAndNotify"); + late final _sel_waitForDataInBackgroundAndNotifyForModes_1 = + _registerName1("waitForDataInBackgroundAndNotifyForModes:"); + late final _sel_waitForDataInBackgroundAndNotify1 = + _registerName1("waitForDataInBackgroundAndNotify"); + late final _sel_readabilityHandler1 = _registerName1("readabilityHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_769( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_769( + obj, + sel, + ); + } + + late final __objc_msgSend_769Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_769 = __objc_msgSend_769Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setReadabilityHandler_1 = + _registerName1("setReadabilityHandler:"); + void _objc_msgSend_770( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_770( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_770Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_770 = __objc_msgSend_770Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_writeabilityHandler1 = _registerName1("writeabilityHandler"); + late final _sel_setWriteabilityHandler_1 = + _registerName1("setWriteabilityHandler:"); + late final _sel_initWithFileDescriptor_1 = + _registerName1("initWithFileDescriptor:"); + instancetype _objc_msgSend_771( + ffi.Pointer obj, + ffi.Pointer sel, + int fd, + ) { + return __objc_msgSend_771( + obj, + sel, + fd, + ); + } + + late final __objc_msgSend_771Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_771 = __objc_msgSend_771Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_fileDescriptor1 = _registerName1("fileDescriptor"); + late final _sel_readDataToEndOfFile1 = _registerName1("readDataToEndOfFile"); + late final _sel_readDataOfLength_1 = _registerName1("readDataOfLength:"); + late final _sel_offsetInFile1 = _registerName1("offsetInFile"); + late final _sel_seekToEndOfFile1 = _registerName1("seekToEndOfFile"); + late final _sel_seekToFileOffset_1 = _registerName1("seekToFileOffset:"); + void _objc_msgSend_772( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ) { + return __objc_msgSend_772( + obj, + sel, + offset, + ); + } + + late final __objc_msgSend_772Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLongLong)>>('objc_msgSend'); + late final __objc_msgSend_772 = __objc_msgSend_772Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_truncateFileAtOffset_1 = + _registerName1("truncateFileAtOffset:"); + late final _sel_synchronizeFile1 = _registerName1("synchronizeFile"); + late final _sel_closeFile1 = _registerName1("closeFile"); + late final _class_NSHTTPCookieStorage1 = _getClass1("NSHTTPCookieStorage"); + late final _sel_sharedHTTPCookieStorage1 = + _registerName1("sharedHTTPCookieStorage"); + ffi.Pointer _objc_msgSend_773( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_773( + obj, + sel, + ); + } + + late final __objc_msgSend_773Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_773 = __objc_msgSend_773Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sharedCookieStorageForGroupContainerIdentifier_1 = + _registerName1("sharedCookieStorageForGroupContainerIdentifier:"); + ffi.Pointer _objc_msgSend_774( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_774( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_774Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_774 = __objc_msgSend_774Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_cookies1 = _registerName1("cookies"); + late final _class_NSHTTPCookie1 = _getClass1("NSHTTPCookie"); + late final _sel_initWithProperties_1 = _registerName1("initWithProperties:"); + late final _sel_cookieWithProperties_1 = + _registerName1("cookieWithProperties:"); + ffi.Pointer _objc_msgSend_775( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer properties, + ) { + return __objc_msgSend_775( + obj, + sel, + properties, + ); + } + + late final __objc_msgSend_775Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_775 = __objc_msgSend_775Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestHeaderFieldsWithCookies_1 = + _registerName1("requestHeaderFieldsWithCookies:"); + late final _sel_cookiesWithResponseHeaderFields_forURL_1 = + _registerName1("cookiesWithResponseHeaderFields:forURL:"); + ffi.Pointer _objc_msgSend_776( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer headerFields, + ffi.Pointer URL, + ) { + return __objc_msgSend_776( + obj, + sel, + headerFields, + URL, + ); + } + + late final __objc_msgSend_776Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_776 = __objc_msgSend_776Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_properties1 = _registerName1("properties"); + late final _sel_value1 = _registerName1("value"); + late final _sel_expiresDate1 = _registerName1("expiresDate"); + late final _sel_isSessionOnly1 = _registerName1("isSessionOnly"); + late final _sel_isSecure1 = _registerName1("isSecure"); + late final _sel_isHTTPOnly1 = _registerName1("isHTTPOnly"); + late final _sel_comment1 = _registerName1("comment"); + late final _sel_commentURL1 = _registerName1("commentURL"); + late final _sel_portList1 = _registerName1("portList"); + late final _sel_sameSitePolicy1 = _registerName1("sameSitePolicy"); + late final _sel_setCookie_1 = _registerName1("setCookie:"); + void _objc_msgSend_777( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookie, + ) { + return __objc_msgSend_777( + obj, + sel, + cookie, + ); + } + + late final __objc_msgSend_777Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_777 = __objc_msgSend_777Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_deleteCookie_1 = _registerName1("deleteCookie:"); + late final _sel_removeCookiesSinceDate_1 = + _registerName1("removeCookiesSinceDate:"); + late final _sel_cookiesForURL_1 = _registerName1("cookiesForURL:"); + late final _sel_setCookies_forURL_mainDocumentURL_1 = + _registerName1("setCookies:forURL:mainDocumentURL:"); + void _objc_msgSend_778( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookies, + ffi.Pointer URL, + ffi.Pointer mainDocumentURL, + ) { + return __objc_msgSend_778( + obj, + sel, + cookies, + URL, + mainDocumentURL, + ); + } + + late final __objc_msgSend_778Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_778 = __objc_msgSend_778Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cookieAcceptPolicy1 = _registerName1("cookieAcceptPolicy"); + int _objc_msgSend_779( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_779( + obj, + sel, + ); + } + + late final __objc_msgSend_779Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_779 = __objc_msgSend_779Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCookieAcceptPolicy_1 = + _registerName1("setCookieAcceptPolicy:"); + void _objc_msgSend_780( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_780( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_780Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_780 = __objc_msgSend_780Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_sortedCookiesUsingDescriptors_1 = + _registerName1("sortedCookiesUsingDescriptors:"); + late final _class_NSURLSessionTask1 = _getClass1("NSURLSessionTask"); + late final _sel_taskIdentifier1 = _registerName1("taskIdentifier"); + late final _class_NSURLRequest1 = _getClass1("NSURLRequest"); + late final _sel_requestWithURL_1 = _registerName1("requestWithURL:"); + late final _sel_supportsSecureCoding1 = + _registerName1("supportsSecureCoding"); + late final _sel_requestWithURL_cachePolicy_timeoutInterval_1 = + _registerName1("requestWithURL:cachePolicy:timeoutInterval:"); + instancetype _objc_msgSend_781( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer URL, + int cachePolicy, + double timeoutInterval, + ) { + return __objc_msgSend_781( + obj, + sel, + URL, + cachePolicy, + timeoutInterval, + ); + } + + late final __objc_msgSend_781Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_781 = __objc_msgSend_781Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, double)>(); + + late final _sel_initWithURL_cachePolicy_timeoutInterval_1 = + _registerName1("initWithURL:cachePolicy:timeoutInterval:"); + late final _sel_URL1 = _registerName1("URL"); + late final _sel_cachePolicy1 = _registerName1("cachePolicy"); + int _objc_msgSend_782( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_782( + obj, + sel, + ); + } + + late final __objc_msgSend_782Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_782 = __objc_msgSend_782Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_timeoutInterval1 = _registerName1("timeoutInterval"); + late final _sel_mainDocumentURL1 = _registerName1("mainDocumentURL"); + late final _sel_networkServiceType1 = _registerName1("networkServiceType"); + int _objc_msgSend_783( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_783( + obj, + sel, + ); + } + + late final __objc_msgSend_783Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_783 = __objc_msgSend_783Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allowsCellularAccess1 = + _registerName1("allowsCellularAccess"); + late final _sel_allowsExpensiveNetworkAccess1 = + _registerName1("allowsExpensiveNetworkAccess"); + late final _sel_allowsConstrainedNetworkAccess1 = + _registerName1("allowsConstrainedNetworkAccess"); + late final _sel_assumesHTTP3Capable1 = _registerName1("assumesHTTP3Capable"); + late final _sel_attribution1 = _registerName1("attribution"); + int _objc_msgSend_784( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_784( + obj, + sel, + ); + } + + late final __objc_msgSend_784Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_784 = __objc_msgSend_784Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requiresDNSSECValidation1 = + _registerName1("requiresDNSSECValidation"); + late final _sel_HTTPMethod1 = _registerName1("HTTPMethod"); + late final _sel_allHTTPHeaderFields1 = _registerName1("allHTTPHeaderFields"); + late final _sel_valueForHTTPHeaderField_1 = + _registerName1("valueForHTTPHeaderField:"); + late final _sel_HTTPBody1 = _registerName1("HTTPBody"); + late final _class_NSInputStream1 = _getClass1("NSInputStream"); + late final _class_NSStream1 = _getClass1("NSStream"); + late final _sel_open1 = _registerName1("open"); + late final _sel_close1 = _registerName1("close"); + late final _sel_streamStatus1 = _registerName1("streamStatus"); + int _objc_msgSend_785( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_785( + obj, + sel, + ); + } + + late final __objc_msgSend_785Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_785 = __objc_msgSend_785Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_streamError1 = _registerName1("streamError"); + late final _class_NSOutputStream1 = _getClass1("NSOutputStream"); + late final _sel_write_maxLength_1 = _registerName1("write:maxLength:"); + int _objc_msgSend_786( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int len, + ) { + return __objc_msgSend_786( + obj, + sel, + buffer, + len, + ); + } + + late final __objc_msgSend_786Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_786 = __objc_msgSend_786Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_hasSpaceAvailable1 = _registerName1("hasSpaceAvailable"); + late final _sel_initToMemory1 = _registerName1("initToMemory"); + late final _sel_initToBuffer_capacity_1 = + _registerName1("initToBuffer:capacity:"); + instancetype _objc_msgSend_787( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer buffer, + int capacity, + ) { + return __objc_msgSend_787( + obj, + sel, + buffer, + capacity, + ); + } + + late final __objc_msgSend_787Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_787 = __objc_msgSend_787Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithURL_append_1 = _registerName1("initWithURL:append:"); + late final _sel_initToFileAtPath_append_1 = + _registerName1("initToFileAtPath:append:"); + late final _sel_outputStreamToMemory1 = + _registerName1("outputStreamToMemory"); + late final _sel_outputStreamToBuffer_capacity_1 = + _registerName1("outputStreamToBuffer:capacity:"); + late final _sel_outputStreamToFileAtPath_append_1 = + _registerName1("outputStreamToFileAtPath:append:"); + late final _sel_outputStreamWithURL_append_1 = + _registerName1("outputStreamWithURL:append:"); + late final _sel_getStreamsToHostWithName_port_inputStream_outputStream_1 = + _registerName1("getStreamsToHostWithName:port:inputStream:outputStream:"); + void _objc_msgSend_788( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_788( + obj, + sel, + hostname, + port, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_788Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_788 = __objc_msgSend_788Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _class_NSHost1 = _getClass1("NSHost"); + late final _sel_currentHost1 = _registerName1("currentHost"); + late final _sel_hostWithName_1 = _registerName1("hostWithName:"); + late final _sel_hostWithAddress_1 = _registerName1("hostWithAddress:"); + late final _sel_isEqualToHost_1 = _registerName1("isEqualToHost:"); + bool _objc_msgSend_789( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer aHost, + ) { + return __objc_msgSend_789( + obj, + sel, + aHost, + ); + } + + late final __objc_msgSend_789Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_789 = __objc_msgSend_789Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_names1 = _registerName1("names"); + late final _sel_address1 = _registerName1("address"); + late final _sel_addresses1 = _registerName1("addresses"); + late final _sel_localizedName1 = _registerName1("localizedName"); + late final _sel_setHostCacheEnabled_1 = + _registerName1("setHostCacheEnabled:"); + void _objc_msgSend_790( + ffi.Pointer obj, + ffi.Pointer sel, + bool flag, + ) { + return __objc_msgSend_790( + obj, + sel, + flag, + ); + } + + late final __objc_msgSend_790Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_790 = __objc_msgSend_790Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_isHostCacheEnabled1 = _registerName1("isHostCacheEnabled"); + late final _sel_flushHostCache1 = _registerName1("flushHostCache"); + late final _sel_getStreamsToHost_port_inputStream_outputStream_1 = + _registerName1("getStreamsToHost:port:inputStream:outputStream:"); + void _objc_msgSend_791( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_791( + obj, + sel, + host, + port, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_791Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_791 = __objc_msgSend_791Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1 = + _registerName1("getBoundStreamsWithBufferSize:inputStream:outputStream:"); + void _objc_msgSend_792( + ffi.Pointer obj, + ffi.Pointer sel, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_792( + obj, + sel, + bufferSize, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_792Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_792 = __objc_msgSend_792Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_read_maxLength_1 = _registerName1("read:maxLength:"); + late final _sel_getBuffer_length_1 = _registerName1("getBuffer:length:"); + bool _objc_msgSend_793( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> buffer, + ffi.Pointer len, + ) { + return __objc_msgSend_793( + obj, + sel, + buffer, + len, + ); + } + + late final __objc_msgSend_793Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_793 = __objc_msgSend_793Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); + + late final _sel_hasBytesAvailable1 = _registerName1("hasBytesAvailable"); + late final _sel_initWithFileAtPath_1 = _registerName1("initWithFileAtPath:"); + late final _sel_inputStreamWithData_1 = + _registerName1("inputStreamWithData:"); + late final _sel_inputStreamWithFileAtPath_1 = + _registerName1("inputStreamWithFileAtPath:"); + late final _sel_inputStreamWithURL_1 = _registerName1("inputStreamWithURL:"); + late final _sel_HTTPBodyStream1 = _registerName1("HTTPBodyStream"); + ffi.Pointer _objc_msgSend_794( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_794( + obj, + sel, + ); + } + + late final __objc_msgSend_794Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_794 = __objc_msgSend_794Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_HTTPShouldHandleCookies1 = + _registerName1("HTTPShouldHandleCookies"); + late final _sel_HTTPShouldUsePipelining1 = + _registerName1("HTTPShouldUsePipelining"); + late final _sel_originalRequest1 = _registerName1("originalRequest"); + ffi.Pointer _objc_msgSend_795( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_795( + obj, + sel, + ); + } + + late final __objc_msgSend_795Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_795 = __objc_msgSend_795Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_currentRequest1 = _registerName1("currentRequest"); + late final _class_NSURLResponse1 = _getClass1("NSURLResponse"); + late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1 = + _registerName1( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); + instancetype _objc_msgSend_796( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer URL, + ffi.Pointer MIMEType, + int length, + ffi.Pointer name, + ) { + return __objc_msgSend_796( + obj, + sel, + URL, + MIMEType, + length, + name, + ); + } + + late final __objc_msgSend_796Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_796 = __objc_msgSend_796Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_MIMEType1 = _registerName1("MIMEType"); + late final _sel_expectedContentLength1 = + _registerName1("expectedContentLength"); + late final _sel_textEncodingName1 = _registerName1("textEncodingName"); + late final _sel_suggestedFilename1 = _registerName1("suggestedFilename"); + late final _sel_response1 = _registerName1("response"); + ffi.Pointer _objc_msgSend_797( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_797( + obj, + sel, + ); + } + + late final __objc_msgSend_797Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_797 = __objc_msgSend_797Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_progress1 = _registerName1("progress"); + late final _sel_earliestBeginDate1 = _registerName1("earliestBeginDate"); + late final _sel_setEarliestBeginDate_1 = + _registerName1("setEarliestBeginDate:"); + late final _sel_countOfBytesClientExpectsToSend1 = + _registerName1("countOfBytesClientExpectsToSend"); + late final _sel_setCountOfBytesClientExpectsToSend_1 = + _registerName1("setCountOfBytesClientExpectsToSend:"); + late final _sel_countOfBytesClientExpectsToReceive1 = + _registerName1("countOfBytesClientExpectsToReceive"); + late final _sel_setCountOfBytesClientExpectsToReceive_1 = + _registerName1("setCountOfBytesClientExpectsToReceive:"); + late final _sel_countOfBytesSent1 = _registerName1("countOfBytesSent"); + late final _sel_countOfBytesReceived1 = + _registerName1("countOfBytesReceived"); + late final _sel_countOfBytesExpectedToSend1 = + _registerName1("countOfBytesExpectedToSend"); + late final _sel_countOfBytesExpectedToReceive1 = + _registerName1("countOfBytesExpectedToReceive"); + late final _sel_taskDescription1 = _registerName1("taskDescription"); + late final _sel_setTaskDescription_1 = _registerName1("setTaskDescription:"); + late final _sel_state1 = _registerName1("state"); + int _objc_msgSend_798( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_798( + obj, + sel, + ); + } + + late final __objc_msgSend_798Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_798 = __objc_msgSend_798Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_suspend1 = _registerName1("suspend"); + late final _sel_priority1 = _registerName1("priority"); + late final _sel_setPriority_1 = _registerName1("setPriority:"); + void _objc_msgSend_799( + ffi.Pointer obj, + ffi.Pointer sel, + double value, + ) { + return __objc_msgSend_799( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_799Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Float)>>('objc_msgSend'); + late final __objc_msgSend_799 = __objc_msgSend_799Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, double)>(); + + late final _sel_prefersIncrementalDelivery1 = + _registerName1("prefersIncrementalDelivery"); + late final _sel_setPrefersIncrementalDelivery_1 = + _registerName1("setPrefersIncrementalDelivery:"); + late final _sel_storeCookies_forTask_1 = + _registerName1("storeCookies:forTask:"); + void _objc_msgSend_800( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cookies, + ffi.Pointer task, + ) { + return __objc_msgSend_800( + obj, + sel, + cookies, + task, + ); + } + + late final __objc_msgSend_800Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_800 = __objc_msgSend_800Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getCookiesForTask_completionHandler_1 = + _registerName1("getCookiesForTask:completionHandler:"); + void _objc_msgSend_801( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_801( + obj, + sel, + task, + completionHandler, + ); + } + + late final __objc_msgSend_801Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_801 = __objc_msgSend_801Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSIndexPath1 = _getClass1("NSIndexPath"); + late final _sel_indexPathWithIndex_1 = _registerName1("indexPathWithIndex:"); + late final _sel_indexPathWithIndexes_length_1 = + _registerName1("indexPathWithIndexes:length:"); + instancetype _objc_msgSend_802( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + int length, + ) { + return __objc_msgSend_802( + obj, + sel, + indexes, + length, + ); + } + + late final __objc_msgSend_802Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_802 = __objc_msgSend_802Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_initWithIndexes_length_1 = + _registerName1("initWithIndexes:length:"); + late final _sel_indexPathByAddingIndex_1 = + _registerName1("indexPathByAddingIndex:"); + ffi.Pointer _objc_msgSend_803( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_803( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_803Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_803 = __objc_msgSend_803Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_indexPathByRemovingLastIndex1 = + _registerName1("indexPathByRemovingLastIndex"); + ffi.Pointer _objc_msgSend_804( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_804( + obj, + sel, + ); + } + + late final __objc_msgSend_804Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_804 = __objc_msgSend_804Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_indexAtPosition_1 = _registerName1("indexAtPosition:"); + late final _sel_getIndexes_range_1 = _registerName1("getIndexes:range:"); + void _objc_msgSend_805( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + _NSRange positionRange, + ) { + return __objc_msgSend_805( + obj, + sel, + indexes, + positionRange, + ); + } + + late final __objc_msgSend_805Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_805 = __objc_msgSend_805Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, _NSRange)>(); + + int _objc_msgSend_806( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherObject, + ) { + return __objc_msgSend_806( + obj, + sel, + otherObject, + ); + } + + late final __objc_msgSend_806Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_806 = __objc_msgSend_806Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getIndexes_1 = _registerName1("getIndexes:"); + void _objc_msgSend_807( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer indexes, + ) { + return __objc_msgSend_807( + obj, + sel, + indexes, + ); + } + + late final __objc_msgSend_807Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_807 = __objc_msgSend_807Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSInflectionRule1 = _getClass1("NSInflectionRule"); + late final _sel_automaticRule1 = _registerName1("automaticRule"); + ffi.Pointer _objc_msgSend_808( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_808( + obj, + sel, + ); + } + + late final __objc_msgSend_808Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_808 = __objc_msgSend_808Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canInflectLanguage_1 = _registerName1("canInflectLanguage:"); + late final _sel_canInflectPreferredLocalization1 = + _registerName1("canInflectPreferredLocalization"); + late final _class_NSMorphology1 = _getClass1("NSMorphology"); + late final _sel_grammaticalGender1 = _registerName1("grammaticalGender"); + int _objc_msgSend_809( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_809( + obj, + sel, + ); + } + + late final __objc_msgSend_809Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_809 = __objc_msgSend_809Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setGrammaticalGender_1 = + _registerName1("setGrammaticalGender:"); + void _objc_msgSend_810( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_810( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_810Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_810 = __objc_msgSend_810Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_partOfSpeech1 = _registerName1("partOfSpeech"); + int _objc_msgSend_811( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_811( + obj, + sel, + ); + } + + late final __objc_msgSend_811Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_811 = __objc_msgSend_811Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setPartOfSpeech_1 = _registerName1("setPartOfSpeech:"); + void _objc_msgSend_812( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_812( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_812Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_812 = __objc_msgSend_812Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_number1 = _registerName1("number"); + int _objc_msgSend_813( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_813( + obj, + sel, + ); + } + + late final __objc_msgSend_813Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_813 = __objc_msgSend_813Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setNumber_1 = _registerName1("setNumber:"); + void _objc_msgSend_814( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_814( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_814Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_814 = __objc_msgSend_814Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSMorphologyCustomPronoun1 = + _getClass1("NSMorphologyCustomPronoun"); + late final _sel_isSupportedForLanguage_1 = + _registerName1("isSupportedForLanguage:"); + late final _sel_requiredKeysForLanguage_1 = + _registerName1("requiredKeysForLanguage:"); + late final _sel_subjectForm1 = _registerName1("subjectForm"); + late final _sel_setSubjectForm_1 = _registerName1("setSubjectForm:"); + late final _sel_objectForm1 = _registerName1("objectForm"); + late final _sel_setObjectForm_1 = _registerName1("setObjectForm:"); + late final _sel_possessiveForm1 = _registerName1("possessiveForm"); + late final _sel_setPossessiveForm_1 = _registerName1("setPossessiveForm:"); + late final _sel_possessiveAdjectiveForm1 = + _registerName1("possessiveAdjectiveForm"); + late final _sel_setPossessiveAdjectiveForm_1 = + _registerName1("setPossessiveAdjectiveForm:"); + late final _sel_reflexiveForm1 = _registerName1("reflexiveForm"); + late final _sel_setReflexiveForm_1 = _registerName1("setReflexiveForm:"); + late final _sel_customPronounForLanguage_1 = + _registerName1("customPronounForLanguage:"); + ffi.Pointer _objc_msgSend_815( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer language, + ) { + return __objc_msgSend_815( + obj, + sel, + language, + ); + } + + late final __objc_msgSend_815Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_815 = __objc_msgSend_815Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setCustomPronoun_forLanguage_error_1 = + _registerName1("setCustomPronoun:forLanguage:error:"); + bool _objc_msgSend_816( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer features, + ffi.Pointer language, + ffi.Pointer> error, + ) { + return __objc_msgSend_816( + obj, + sel, + features, + language, + error, + ); + } + + late final __objc_msgSend_816Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_816 = __objc_msgSend_816Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_isUnspecified1 = _registerName1("isUnspecified"); + late final _sel_userMorphology1 = _registerName1("userMorphology"); + ffi.Pointer _objc_msgSend_817( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_817( + obj, + sel, + ); + } + + late final __objc_msgSend_817Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_817 = __objc_msgSend_817Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSOperationQueue1 = _getClass1("NSOperationQueue"); + late final _class_NSOperation1 = _getClass1("NSOperation"); + late final _sel_isConcurrent1 = _registerName1("isConcurrent"); + late final _sel_isAsynchronous1 = _registerName1("isAsynchronous"); + late final _sel_isReady1 = _registerName1("isReady"); + late final _sel_addDependency_1 = _registerName1("addDependency:"); + void _objc_msgSend_818( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer op, + ) { + return __objc_msgSend_818( + obj, + sel, + op, + ); + } + + late final __objc_msgSend_818Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_818 = __objc_msgSend_818Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeDependency_1 = _registerName1("removeDependency:"); + late final _sel_dependencies1 = _registerName1("dependencies"); + late final _sel_queuePriority1 = _registerName1("queuePriority"); + int _objc_msgSend_819( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_819( + obj, + sel, + ); + } + + late final __objc_msgSend_819Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_819 = __objc_msgSend_819Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setQueuePriority_1 = _registerName1("setQueuePriority:"); + void _objc_msgSend_820( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_820( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_820Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_820 = __objc_msgSend_820Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_completionBlock1 = _registerName1("completionBlock"); + late final _sel_setCompletionBlock_1 = _registerName1("setCompletionBlock:"); + late final _sel_waitUntilFinished1 = _registerName1("waitUntilFinished"); + late final _sel_addOperation_1 = _registerName1("addOperation:"); + late final _sel_addOperations_waitUntilFinished_1 = + _registerName1("addOperations:waitUntilFinished:"); + void _objc_msgSend_821( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer ops, + bool wait, + ) { + return __objc_msgSend_821( + obj, + sel, + ops, + wait, + ); + } + + late final __objc_msgSend_821Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_821 = __objc_msgSend_821Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_addOperationWithBlock_1 = + _registerName1("addOperationWithBlock:"); + late final _sel_addBarrierBlock_1 = _registerName1("addBarrierBlock:"); + late final _sel_maxConcurrentOperationCount1 = + _registerName1("maxConcurrentOperationCount"); + late final _sel_setMaxConcurrentOperationCount_1 = + _registerName1("setMaxConcurrentOperationCount:"); + late final _sel_isSuspended1 = _registerName1("isSuspended"); + late final _sel_setSuspended_1 = _registerName1("setSuspended:"); + late final _sel_underlyingQueue1 = _registerName1("underlyingQueue"); + ffi.Pointer _objc_msgSend_822( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_822( + obj, + sel, + ); + } + + late final __objc_msgSend_822Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_822 = __objc_msgSend_822Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setUnderlyingQueue_1 = _registerName1("setUnderlyingQueue:"); + void _objc_msgSend_823( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_823( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_823Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_823 = __objc_msgSend_823Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_cancelAllOperations1 = _registerName1("cancelAllOperations"); + late final _sel_waitUntilAllOperationsAreFinished1 = + _registerName1("waitUntilAllOperationsAreFinished"); + late final _sel_currentQueue1 = _registerName1("currentQueue"); + ffi.Pointer _objc_msgSend_824( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_824( + obj, + sel, + ); + } + + late final __objc_msgSend_824Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_824 = __objc_msgSend_824Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_mainQueue1 = _registerName1("mainQueue"); + late final _sel_operations1 = _registerName1("operations"); + late final _sel_operationCount1 = _registerName1("operationCount"); + late final _class_NSPointerArray1 = _getClass1("NSPointerArray"); + late final _sel_initWithOptions_1 = _registerName1("initWithOptions:"); + instancetype _objc_msgSend_825( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_825( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_825Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_825 = __objc_msgSend_825Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSPointerFunctions1 = _getClass1("NSPointerFunctions"); + late final _sel_pointerFunctionsWithOptions_1 = + _registerName1("pointerFunctionsWithOptions:"); + ffi.Pointer _objc_msgSend_826( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_826( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_826Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_826 = __objc_msgSend_826Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_hashFunction1 = _registerName1("hashFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + _objc_msgSend_827( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_827( + obj, + sel, + ); + } + + late final __objc_msgSend_827Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_827 = __objc_msgSend_827Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setHashFunction_1 = _registerName1("setHashFunction:"); + void _objc_msgSend_828( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_828( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_828Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_828 = __objc_msgSend_828Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_isEqualFunction1 = _registerName1("isEqualFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + _objc_msgSend_829( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_829( + obj, + sel, + ); + } + + late final __objc_msgSend_829Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_829 = __objc_msgSend_829Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setIsEqualFunction_1 = _registerName1("setIsEqualFunction:"); + void _objc_msgSend_830( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_830( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_830Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_830 = __objc_msgSend_830Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_sizeFunction1 = _registerName1("sizeFunction"); + ffi.Pointer< + ffi.NativeFunction)>> + _objc_msgSend_831( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_831( + obj, + sel, + ); + } + + late final __objc_msgSend_831Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_831 = __objc_msgSend_831Ptr.asFunction< + ffi.Pointer< + ffi + .NativeFunction)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSizeFunction_1 = _registerName1("setSizeFunction:"); + void _objc_msgSend_832( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi + .NativeFunction)>> + value, + ) { + return __objc_msgSend_832( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_832Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>('objc_msgSend'); + late final __objc_msgSend_832 = __objc_msgSend_832Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>(); + + late final _sel_descriptionFunction1 = _registerName1("descriptionFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + _objc_msgSend_833( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_833( + obj, + sel, + ); + } + + late final __objc_msgSend_833Ptr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_833 = __objc_msgSend_833Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDescriptionFunction_1 = + _registerName1("setDescriptionFunction:"); + void _objc_msgSend_834( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value, + ) { + return __objc_msgSend_834( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_834Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>)>>('objc_msgSend'); + late final __objc_msgSend_834 = __objc_msgSend_834Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>)>(); + + late final _sel_relinquishFunction1 = _registerName1("relinquishFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + _objc_msgSend_835( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_835( + obj, + sel, + ); + } + + late final __objc_msgSend_835Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_835 = __objc_msgSend_835Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setRelinquishFunction_1 = + _registerName1("setRelinquishFunction:"); + void _objc_msgSend_836( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value, + ) { + return __objc_msgSend_836( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_836Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>>( + 'objc_msgSend'); + late final __objc_msgSend_836 = __objc_msgSend_836Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>>)>(); + + late final _sel_acquireFunction1 = _registerName1("acquireFunction"); + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>, + ffi.Bool)>> _objc_msgSend_837( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_837( + obj, + sel, + ); + } + + late final __objc_msgSend_837Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>>( + 'objc_msgSend'); + late final __objc_msgSend_837 = __objc_msgSend_837Ptr.asFunction< + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>> + Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setAcquireFunction_1 = _registerName1("setAcquireFunction:"); + void _objc_msgSend_838( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>, + ffi.Bool)>> + value, + ) { + return __objc_msgSend_838( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_838Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>>)>>('objc_msgSend'); + late final __objc_msgSend_838 = __objc_msgSend_838Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>>)>(); + + late final _sel_usesStrongWriteBarrier1 = + _registerName1("usesStrongWriteBarrier"); + late final _sel_setUsesStrongWriteBarrier_1 = + _registerName1("setUsesStrongWriteBarrier:"); + late final _sel_usesWeakReadAndWriteBarriers1 = + _registerName1("usesWeakReadAndWriteBarriers"); + late final _sel_setUsesWeakReadAndWriteBarriers_1 = + _registerName1("setUsesWeakReadAndWriteBarriers:"); + late final _sel_initWithPointerFunctions_1 = + _registerName1("initWithPointerFunctions:"); + instancetype _objc_msgSend_839( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer functions, + ) { + return __objc_msgSend_839( + obj, + sel, + functions, + ); + } + + late final __objc_msgSend_839Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_839 = __objc_msgSend_839Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_pointerArrayWithOptions_1 = + _registerName1("pointerArrayWithOptions:"); + ffi.Pointer _objc_msgSend_840( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_840( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_840Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_840 = __objc_msgSend_840Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_pointerArrayWithPointerFunctions_1 = + _registerName1("pointerArrayWithPointerFunctions:"); + ffi.Pointer _objc_msgSend_841( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer functions, + ) { + return __objc_msgSend_841( + obj, + sel, + functions, + ); + } + + late final __objc_msgSend_841Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_841 = __objc_msgSend_841Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerFunctions1 = _registerName1("pointerFunctions"); + ffi.Pointer _objc_msgSend_842( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_842( + obj, + sel, + ); + } + + late final __objc_msgSend_842Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_842 = __objc_msgSend_842Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_pointerAtIndex_1 = _registerName1("pointerAtIndex:"); + ffi.Pointer _objc_msgSend_843( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_843( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_843Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_843 = __objc_msgSend_843Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_addPointer_1 = _registerName1("addPointer:"); + late final _sel_removePointerAtIndex_1 = + _registerName1("removePointerAtIndex:"); + late final _sel_insertPointer_atIndex_1 = + _registerName1("insertPointer:atIndex:"); + late final _sel_replacePointerAtIndex_withPointer_1 = + _registerName1("replacePointerAtIndex:withPointer:"); + void _objc_msgSend_844( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer item, + ) { + return __objc_msgSend_844( + obj, + sel, + index, + item, + ); + } + + late final __objc_msgSend_844Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_844 = __objc_msgSend_844Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_compact1 = _registerName1("compact"); + late final _sel_setCount_1 = _registerName1("setCount:"); + late final _sel_pointerArrayWithStrongObjects1 = + _registerName1("pointerArrayWithStrongObjects"); + late final _sel_pointerArrayWithWeakObjects1 = + _registerName1("pointerArrayWithWeakObjects"); + late final _sel_strongObjectsPointerArray1 = + _registerName1("strongObjectsPointerArray"); + ffi.Pointer _objc_msgSend_845( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_845( + obj, + sel, + ); + } + + late final __objc_msgSend_845Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_845 = __objc_msgSend_845Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_weakObjectsPointerArray1 = + _registerName1("weakObjectsPointerArray"); + late final _class_NSProcessInfo1 = _getClass1("NSProcessInfo"); + late final _sel_processInfo1 = _registerName1("processInfo"); + ffi.Pointer _objc_msgSend_846( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_846( + obj, + sel, + ); + } + + late final __objc_msgSend_846Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_846 = __objc_msgSend_846Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_environment1 = _registerName1("environment"); + late final _sel_hostName1 = _registerName1("hostName"); + late final _sel_processName1 = _registerName1("processName"); + late final _sel_setProcessName_1 = _registerName1("setProcessName:"); + late final _sel_processIdentifier1 = _registerName1("processIdentifier"); + late final _sel_globallyUniqueString1 = + _registerName1("globallyUniqueString"); + late final _sel_operatingSystem1 = _registerName1("operatingSystem"); + late final _sel_operatingSystemName1 = _registerName1("operatingSystemName"); + late final _sel_operatingSystemVersionString1 = + _registerName1("operatingSystemVersionString"); + late final _sel_operatingSystemVersion1 = + _registerName1("operatingSystemVersion"); + void _objc_msgSend_847( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_847( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_847Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_stret'); + late final __objc_msgSend_847 = __objc_msgSend_847Ptr.asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_processorCount1 = _registerName1("processorCount"); + late final _sel_activeProcessorCount1 = + _registerName1("activeProcessorCount"); + late final _sel_physicalMemory1 = _registerName1("physicalMemory"); + late final _sel_isOperatingSystemAtLeastVersion_1 = + _registerName1("isOperatingSystemAtLeastVersion:"); + bool _objc_msgSend_848( + ffi.Pointer obj, + ffi.Pointer sel, + NSOperatingSystemVersion version, + ) { + return __objc_msgSend_848( + obj, + sel, + version, + ); + } + + late final __objc_msgSend_848Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + NSOperatingSystemVersion)>>('objc_msgSend'); + late final __objc_msgSend_848 = __objc_msgSend_848Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + NSOperatingSystemVersion)>(); + + late final _sel_systemUptime1 = _registerName1("systemUptime"); + late final _sel_disableSuddenTermination1 = + _registerName1("disableSuddenTermination"); + late final _sel_enableSuddenTermination1 = + _registerName1("enableSuddenTermination"); + late final _sel_disableAutomaticTermination_1 = + _registerName1("disableAutomaticTermination:"); + late final _sel_enableAutomaticTermination_1 = + _registerName1("enableAutomaticTermination:"); + late final _sel_automaticTerminationSupportEnabled1 = + _registerName1("automaticTerminationSupportEnabled"); + late final _sel_setAutomaticTerminationSupportEnabled_1 = + _registerName1("setAutomaticTerminationSupportEnabled:"); + late final _sel_beginActivityWithOptions_reason_1 = + _registerName1("beginActivityWithOptions:reason:"); + ffi.Pointer _objc_msgSend_849( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer reason, + ) { + return __objc_msgSend_849( + obj, + sel, + options, + reason, + ); + } + + late final __objc_msgSend_849Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_849 = __objc_msgSend_849Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); + + late final _sel_endActivity_1 = _registerName1("endActivity:"); + late final _sel_performActivityWithOptions_reason_usingBlock_1 = + _registerName1("performActivityWithOptions:reason:usingBlock:"); + void _objc_msgSend_850( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ffi.Pointer reason, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_850( + obj, + sel, + options, + reason, + block, + ); + } + + late final __objc_msgSend_850Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_850 = __objc_msgSend_850Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_performExpiringActivityWithReason_usingBlock_1 = + _registerName1("performExpiringActivityWithReason:usingBlock:"); + void _objc_msgSend_851( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer reason, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_851( + obj, + sel, + reason, + block, + ); + } + + late final __objc_msgSend_851Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_851 = __objc_msgSend_851Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_userName1 = _registerName1("userName"); + late final _sel_fullUserName1 = _registerName1("fullUserName"); + late final _sel_thermalState1 = _registerName1("thermalState"); + int _objc_msgSend_852( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_852( + obj, + sel, + ); + } + + late final __objc_msgSend_852Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_852 = __objc_msgSend_852Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_isLowPowerModeEnabled1 = + _registerName1("isLowPowerModeEnabled"); + late final _sel_isMacCatalystApp1 = _registerName1("isMacCatalystApp"); + late final _sel_isiOSAppOnMac1 = _registerName1("isiOSAppOnMac"); + late final _class_NSTextCheckingResult1 = _getClass1("NSTextCheckingResult"); + late final _sel_resultType1 = _registerName1("resultType"); + int _objc_msgSend_853( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_853( + obj, + sel, + ); + } + + late final __objc_msgSend_853Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_853 = __objc_msgSend_853Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_range1 = _registerName1("range"); + late final _sel_orthography1 = _registerName1("orthography"); + ffi.Pointer _objc_msgSend_854( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_854( + obj, + sel, + ); + } + + late final __objc_msgSend_854Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_854 = __objc_msgSend_854Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_grammarDetails1 = _registerName1("grammarDetails"); + late final _sel_duration1 = _registerName1("duration"); + late final _sel_components1 = _registerName1("components"); + late final _sel_replacementString1 = _registerName1("replacementString"); + late final _sel_alternativeStrings1 = _registerName1("alternativeStrings"); + late final _class_NSRegularExpression1 = _getClass1("NSRegularExpression"); + late final _sel_regularExpressionWithPattern_options_error_1 = + _registerName1("regularExpressionWithPattern:options:error:"); + ffi.Pointer _objc_msgSend_855( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pattern, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_855( + obj, + sel, + pattern, + options, + error, + ); + } + + late final __objc_msgSend_855Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_855 = __objc_msgSend_855Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithPattern_options_error_1 = + _registerName1("initWithPattern:options:error:"); + instancetype _objc_msgSend_856( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer pattern, + int options, + ffi.Pointer> error, + ) { + return __objc_msgSend_856( + obj, + sel, + pattern, + options, + error, + ); + } + + late final __objc_msgSend_856Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_856 = __objc_msgSend_856Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_pattern1 = _registerName1("pattern"); + late final _sel_options1 = _registerName1("options"); + int _objc_msgSend_857( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_857( + obj, + sel, + ); + } + + late final __objc_msgSend_857Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_857 = __objc_msgSend_857Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_numberOfCaptureGroups1 = + _registerName1("numberOfCaptureGroups"); + late final _sel_escapedPatternForString_1 = + _registerName1("escapedPatternForString:"); + late final _sel_enumerateMatchesInString_options_range_usingBlock_1 = + _registerName1("enumerateMatchesInString:options:range:usingBlock:"); + void _objc_msgSend_858( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ffi.Pointer<_ObjCBlock> block, + ) { + return __objc_msgSend_858( + obj, + sel, + string, + options, + range, + block, + ); + } + + late final __objc_msgSend_858Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_858 = __objc_msgSend_858Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_matchesInString_options_range_1 = + _registerName1("matchesInString:options:range:"); + ffi.Pointer _objc_msgSend_859( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ) { + return __objc_msgSend_859( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_859Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_859 = __objc_msgSend_859Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_numberOfMatchesInString_options_range_1 = + _registerName1("numberOfMatchesInString:options:range:"); + int _objc_msgSend_860( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ) { + return __objc_msgSend_860( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_860Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_860 = __objc_msgSend_860Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + late final _sel_firstMatchInString_options_range_1 = + _registerName1("firstMatchInString:options:range:"); + ffi.Pointer _objc_msgSend_861( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ) { + return __objc_msgSend_861( + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_861Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_861 = __objc_msgSend_861Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_rangeOfFirstMatchInString_options_range_1 = + _registerName1("rangeOfFirstMatchInString:options:range:"); + void _objc_msgSend_862( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ) { + return __objc_msgSend_862( + stret, + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_862Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange)>>('objc_msgSend_stret'); + late final __objc_msgSend_862 = __objc_msgSend_862Ptr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + + late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_1 = + _registerName1( + "stringByReplacingMatchesInString:options:range:withTemplate:"); + ffi.Pointer _objc_msgSend_863( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ffi.Pointer templ, + ) { + return __objc_msgSend_863( + obj, + sel, + string, + options, + range, + templ, + ); + } + + late final __objc_msgSend_863Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_863 = __objc_msgSend_863Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); + + late final _sel_replaceMatchesInString_options_range_withTemplate_1 = + _registerName1("replaceMatchesInString:options:range:withTemplate:"); + int _objc_msgSend_864( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ffi.Pointer templ, + ) { + return __objc_msgSend_864( + obj, + sel, + string, + options, + range, + templ, + ); + } + + late final __objc_msgSend_864Ptr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_864 = __objc_msgSend_864Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange, ffi.Pointer)>(); + + late final _sel_replacementStringForResult_inString_offset_template_1 = + _registerName1("replacementStringForResult:inString:offset:template:"); + ffi.Pointer _objc_msgSend_865( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer result, + ffi.Pointer string, + int offset, + ffi.Pointer templ, + ) { + return __objc_msgSend_865( + obj, + sel, + result, + string, + offset, + templ, + ); + } + + late final __objc_msgSend_865Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_865 = __objc_msgSend_865Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + late final _sel_escapedTemplateForString_1 = + _registerName1("escapedTemplateForString:"); + late final _sel_regularExpression1 = _registerName1("regularExpression"); + ffi.Pointer _objc_msgSend_866( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_866( + obj, + sel, + ); + } + + late final __objc_msgSend_866Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_866 = __objc_msgSend_866Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_phoneNumber1 = _registerName1("phoneNumber"); + late final _sel_numberOfRanges1 = _registerName1("numberOfRanges"); + late final _sel_rangeAtIndex_1 = _registerName1("rangeAtIndex:"); + late final _sel_rangeWithName_1 = _registerName1("rangeWithName:"); + late final _sel_resultByAdjustingRangesWithOffset_1 = + _registerName1("resultByAdjustingRangesWithOffset:"); + ffi.Pointer _objc_msgSend_867( + ffi.Pointer obj, + ffi.Pointer sel, + int offset, + ) { + return __objc_msgSend_867( + obj, + sel, + offset, + ); + } + + late final __objc_msgSend_867Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_867 = __objc_msgSend_867Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_addressComponents1 = _registerName1("addressComponents"); + late final _sel_orthographyCheckingResultWithRange_orthography_1 = + _registerName1("orthographyCheckingResultWithRange:orthography:"); + ffi.Pointer _objc_msgSend_868( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer orthography, + ) { + return __objc_msgSend_868( + obj, + sel, + range, + orthography, + ); + } + + late final __objc_msgSend_868Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_868 = __objc_msgSend_868Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_spellCheckingResultWithRange_1 = + _registerName1("spellCheckingResultWithRange:"); + ffi.Pointer _objc_msgSend_869( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_869( + obj, + sel, + range, + ); + } + + late final __objc_msgSend_869Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_869 = __objc_msgSend_869Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + late final _sel_grammarCheckingResultWithRange_details_1 = + _registerName1("grammarCheckingResultWithRange:details:"); + ffi.Pointer _objc_msgSend_870( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer details, + ) { + return __objc_msgSend_870( + obj, + sel, + range, + details, + ); + } + + late final __objc_msgSend_870Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_870 = __objc_msgSend_870Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_dateCheckingResultWithRange_date_1 = + _registerName1("dateCheckingResultWithRange:date:"); + ffi.Pointer _objc_msgSend_871( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer date, + ) { + return __objc_msgSend_871( + obj, + sel, + range, + date, + ); + } + + late final __objc_msgSend_871Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_871 = __objc_msgSend_871Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_dateCheckingResultWithRange_date_timeZone_duration_1 = + _registerName1("dateCheckingResultWithRange:date:timeZone:duration:"); + ffi.Pointer _objc_msgSend_872( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer date, + ffi.Pointer timeZone, + double duration, + ) { + return __objc_msgSend_872( + obj, + sel, + range, + date, + timeZone, + duration, + ); + } + + late final __objc_msgSend_872Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer, + ffi.Double)>>('objc_msgSend'); + late final __objc_msgSend_872 = __objc_msgSend_872Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer, + double)>(); + + late final _sel_addressCheckingResultWithRange_components_1 = + _registerName1("addressCheckingResultWithRange:components:"); + ffi.Pointer _objc_msgSend_873( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer components, + ) { + return __objc_msgSend_873( + obj, + sel, + range, + components, + ); + } + + late final __objc_msgSend_873Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_873 = __objc_msgSend_873Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_linkCheckingResultWithRange_URL_1 = + _registerName1("linkCheckingResultWithRange:URL:"); + ffi.Pointer _objc_msgSend_874( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer url, + ) { + return __objc_msgSend_874( + obj, + sel, + range, + url, + ); + } + + late final __objc_msgSend_874Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_874 = __objc_msgSend_874Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_quoteCheckingResultWithRange_replacementString_1 = + _registerName1("quoteCheckingResultWithRange:replacementString:"); + ffi.Pointer _objc_msgSend_875( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer replacementString, + ) { + return __objc_msgSend_875( + obj, + sel, + range, + replacementString, + ); + } + + late final __objc_msgSend_875Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_875 = __objc_msgSend_875Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, _NSRange, ffi.Pointer)>(); + + late final _sel_dashCheckingResultWithRange_replacementString_1 = + _registerName1("dashCheckingResultWithRange:replacementString:"); + late final _sel_replacementCheckingResultWithRange_replacementString_1 = + _registerName1("replacementCheckingResultWithRange:replacementString:"); + late final _sel_correctionCheckingResultWithRange_replacementString_1 = + _registerName1("correctionCheckingResultWithRange:replacementString:"); + late final _sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1 = + _registerName1( + "correctionCheckingResultWithRange:replacementString:alternativeStrings:"); + ffi.Pointer _objc_msgSend_876( + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ffi.Pointer replacementString, + ffi.Pointer alternativeStrings, + ) { + return __objc_msgSend_876( + obj, + sel, + range, + replacementString, + alternativeStrings, + ); + } + + late final __objc_msgSend_876Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_876 = __objc_msgSend_876Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + _NSRange, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1 = + _registerName1( + "regularExpressionCheckingResultWithRanges:count:regularExpression:"); + ffi.Pointer _objc_msgSend_877( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_NSRange> ranges, + int count, + ffi.Pointer regularExpression, + ) { + return __objc_msgSend_877( + obj, + sel, + ranges, + count, + regularExpression, + ); + } + + late final __objc_msgSend_877Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_NSRange>, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_877 = __objc_msgSend_877Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_NSRange>, + int, + ffi.Pointer)>(); + + late final _sel_phoneNumberCheckingResultWithRange_phoneNumber_1 = + _registerName1("phoneNumberCheckingResultWithRange:phoneNumber:"); + late final _sel_transitInformationCheckingResultWithRange_components_1 = + _registerName1("transitInformationCheckingResultWithRange:components:"); + late final _class_NSURLCache1 = _getClass1("NSURLCache"); + late final _sel_sharedURLCache1 = _registerName1("sharedURLCache"); + ffi.Pointer _objc_msgSend_878( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_878( + obj, + sel, + ); + } + + late final __objc_msgSend_878Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_878 = __objc_msgSend_878Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setSharedURLCache_1 = _registerName1("setSharedURLCache:"); + void _objc_msgSend_879( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_879( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_879Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_879 = __objc_msgSend_879Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_1 = + _registerName1("initWithMemoryCapacity:diskCapacity:diskPath:"); + instancetype _objc_msgSend_880( + ffi.Pointer obj, + ffi.Pointer sel, + int memoryCapacity, + int diskCapacity, + ffi.Pointer path, + ) { + return __objc_msgSend_880( + obj, + sel, + memoryCapacity, + diskCapacity, + path, + ); + } + + late final __objc_msgSend_880Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_880 = __objc_msgSend_880Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer)>(); + + late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_1 = + _registerName1("initWithMemoryCapacity:diskCapacity:directoryURL:"); + instancetype _objc_msgSend_881( + ffi.Pointer obj, + ffi.Pointer sel, + int memoryCapacity, + int diskCapacity, + ffi.Pointer directoryURL, + ) { + return __objc_msgSend_881( + obj, + sel, + memoryCapacity, + diskCapacity, + directoryURL, + ); + } + + late final __objc_msgSend_881Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_881 = __objc_msgSend_881Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, int, + int, ffi.Pointer)>(); + + late final _class_NSCachedURLResponse1 = _getClass1("NSCachedURLResponse"); + late final _sel_initWithResponse_data_1 = + _registerName1("initWithResponse:data:"); + instancetype _objc_msgSend_882( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer response, + ffi.Pointer data, + ) { + return __objc_msgSend_882( + obj, + sel, + response, + data, + ); + } + + late final __objc_msgSend_882Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_882 = __objc_msgSend_882Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithResponse_data_userInfo_storagePolicy_1 = + _registerName1("initWithResponse:data:userInfo:storagePolicy:"); + instancetype _objc_msgSend_883( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer response, + ffi.Pointer data, + ffi.Pointer userInfo, + int storagePolicy, + ) { + return __objc_msgSend_883( + obj, + sel, + response, + data, + userInfo, + storagePolicy, + ); + } + + late final __objc_msgSend_883Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_883 = __objc_msgSend_883Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_storagePolicy1 = _registerName1("storagePolicy"); + int _objc_msgSend_884( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_884( + obj, + sel, + ); + } + + late final __objc_msgSend_884Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_884 = __objc_msgSend_884Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_cachedResponseForRequest_1 = + _registerName1("cachedResponseForRequest:"); + ffi.Pointer _objc_msgSend_885( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_885( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_885Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_885 = __objc_msgSend_885Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_storeCachedResponse_forRequest_1 = + _registerName1("storeCachedResponse:forRequest:"); + void _objc_msgSend_886( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cachedResponse, + ffi.Pointer request, + ) { + return __objc_msgSend_886( + obj, + sel, + cachedResponse, + request, + ); + } + + late final __objc_msgSend_886Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_886 = __objc_msgSend_886Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeCachedResponseForRequest_1 = + _registerName1("removeCachedResponseForRequest:"); + void _objc_msgSend_887( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_887( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_887Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_887 = __objc_msgSend_887Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeAllCachedResponses1 = + _registerName1("removeAllCachedResponses"); + late final _sel_removeCachedResponsesSinceDate_1 = + _registerName1("removeCachedResponsesSinceDate:"); + late final _sel_memoryCapacity1 = _registerName1("memoryCapacity"); + late final _sel_setMemoryCapacity_1 = _registerName1("setMemoryCapacity:"); + late final _sel_diskCapacity1 = _registerName1("diskCapacity"); + late final _sel_setDiskCapacity_1 = _registerName1("setDiskCapacity:"); + late final _sel_currentMemoryUsage1 = _registerName1("currentMemoryUsage"); + late final _sel_currentDiskUsage1 = _registerName1("currentDiskUsage"); + late final _class_NSURLSessionDataTask1 = _getClass1("NSURLSessionDataTask"); + late final _sel_storeCachedResponse_forDataTask_1 = + _registerName1("storeCachedResponse:forDataTask:"); + void _objc_msgSend_888( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer cachedResponse, + ffi.Pointer dataTask, + ) { + return __objc_msgSend_888( + obj, + sel, + cachedResponse, + dataTask, + ); + } + + late final __objc_msgSend_888Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_888 = __objc_msgSend_888Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getCachedResponseForDataTask_completionHandler_1 = + _registerName1("getCachedResponseForDataTask:completionHandler:"); + void _objc_msgSend_889( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataTask, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_889( + obj, + sel, + dataTask, + completionHandler, + ); + } + + late final __objc_msgSend_889Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_889 = __objc_msgSend_889Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_removeCachedResponseForDataTask_1 = + _registerName1("removeCachedResponseForDataTask:"); + void _objc_msgSend_890( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataTask, + ) { + return __objc_msgSend_890( + obj, + sel, + dataTask, + ); + } + + late final __objc_msgSend_890Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_890 = __objc_msgSend_890Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSURLConnection1 = _getClass1("NSURLConnection"); + late final _sel_initWithRequest_delegate_startImmediately_1 = + _registerName1("initWithRequest:delegate:startImmediately:"); + instancetype _objc_msgSend_891( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + bool startImmediately, + ) { + return __objc_msgSend_891( + obj, + sel, + request, + delegate, + startImmediately, + ); + } + + late final __objc_msgSend_891Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_891 = __objc_msgSend_891Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_initWithRequest_delegate_1 = + _registerName1("initWithRequest:delegate:"); + instancetype _objc_msgSend_892( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + ) { + return __objc_msgSend_892( + obj, + sel, + request, + delegate, + ); + } + + late final __objc_msgSend_892Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_892 = __objc_msgSend_892Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_connectionWithRequest_delegate_1 = + _registerName1("connectionWithRequest:delegate:"); + ffi.Pointer _objc_msgSend_893( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer delegate, + ) { + return __objc_msgSend_893( + obj, + sel, + request, + delegate, + ); + } + + late final __objc_msgSend_893Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_893 = __objc_msgSend_893Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_unscheduleFromRunLoop_forMode_1 = + _registerName1("unscheduleFromRunLoop:forMode:"); + late final _sel_setDelegateQueue_1 = _registerName1("setDelegateQueue:"); + void _objc_msgSend_894( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer queue, + ) { + return __objc_msgSend_894( + obj, + sel, + queue, + ); + } + + late final __objc_msgSend_894Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_894 = __objc_msgSend_894Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_canHandleRequest_1 = _registerName1("canHandleRequest:"); + bool _objc_msgSend_895( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_895( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_895Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_895 = __objc_msgSend_895Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sendSynchronousRequest_returningResponse_error_1 = + _registerName1("sendSynchronousRequest:returningResponse:error:"); + ffi.Pointer _objc_msgSend_896( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer> response, + ffi.Pointer> error, + ) { + return __objc_msgSend_896( + obj, + sel, + request, + response, + error, + ); + } + + late final __objc_msgSend_896Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_896 = __objc_msgSend_896Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_sendAsynchronousRequest_queue_completionHandler_1 = + _registerName1("sendAsynchronousRequest:queue:completionHandler:"); + void _objc_msgSend_897( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer queue, + ffi.Pointer<_ObjCBlock> handler, + ) { + return __objc_msgSend_897( + obj, + sel, + request, + queue, + handler, + ); + } + + late final __objc_msgSend_897Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_897 = __objc_msgSend_897Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSURLCredential1 = _getClass1("NSURLCredential"); + late final _sel_persistence1 = _registerName1("persistence"); + int _objc_msgSend_898( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_898( + obj, + sel, + ); + } + + late final __objc_msgSend_898Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_898 = __objc_msgSend_898Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithUser_password_persistence_1 = + _registerName1("initWithUser:password:persistence:"); + instancetype _objc_msgSend_899( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer user, + ffi.Pointer password, + int persistence, + ) { + return __objc_msgSend_899( + obj, + sel, + user, + password, + persistence, + ); + } + + late final __objc_msgSend_899Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_899 = __objc_msgSend_899Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_credentialWithUser_password_persistence_1 = + _registerName1("credentialWithUser:password:persistence:"); + ffi.Pointer _objc_msgSend_900( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer user, + ffi.Pointer password, + int persistence, + ) { + return __objc_msgSend_900( + obj, + sel, + user, + password, + persistence, + ); + } + + late final __objc_msgSend_900Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_900 = __objc_msgSend_900Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_hasPassword1 = _registerName1("hasPassword"); + late final _sel_initWithIdentity_certificates_persistence_1 = + _registerName1("initWithIdentity:certificates:persistence:"); + instancetype _objc_msgSend_901( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<__SecIdentity> identity, + ffi.Pointer certArray, + int persistence, + ) { + return __objc_msgSend_901( + obj, + sel, + identity, + certArray, + persistence, + ); + } + + late final __objc_msgSend_901Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_901 = __objc_msgSend_901Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<__SecIdentity>, ffi.Pointer, int)>(); + + late final _sel_credentialWithIdentity_certificates_persistence_1 = + _registerName1("credentialWithIdentity:certificates:persistence:"); + ffi.Pointer _objc_msgSend_902( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<__SecIdentity> identity, + ffi.Pointer certArray, + int persistence, + ) { + return __objc_msgSend_902( + obj, + sel, + identity, + certArray, + persistence, + ); + } + + late final __objc_msgSend_902Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_902 = __objc_msgSend_902Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<__SecIdentity>, + ffi.Pointer, + int)>(); + + late final _sel_identity1 = _registerName1("identity"); + ffi.Pointer<__SecIdentity> _objc_msgSend_903( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_903( + obj, + sel, + ); + } + + late final __objc_msgSend_903Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<__SecIdentity> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_903 = __objc_msgSend_903Ptr.asFunction< + ffi.Pointer<__SecIdentity> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_certificates1 = _registerName1("certificates"); + late final _sel_initWithTrust_1 = _registerName1("initWithTrust:"); + instancetype _objc_msgSend_904( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<__SecTrust> trust, + ) { + return __objc_msgSend_904( + obj, + sel, + trust, + ); + } + + late final __objc_msgSend_904Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<__SecTrust>)>>('objc_msgSend'); + late final __objc_msgSend_904 = __objc_msgSend_904Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<__SecTrust>)>(); + + late final _sel_credentialForTrust_1 = _registerName1("credentialForTrust:"); + ffi.Pointer _objc_msgSend_905( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<__SecTrust> trust, + ) { + return __objc_msgSend_905( + obj, + sel, + trust, + ); + } + + late final __objc_msgSend_905Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<__SecTrust>)>>('objc_msgSend'); + late final __objc_msgSend_905 = __objc_msgSend_905Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<__SecTrust>)>(); + + late final _class_NSURLProtectionSpace1 = _getClass1("NSURLProtectionSpace"); + late final _sel_initWithHost_port_protocol_realm_authenticationMethod_1 = + _registerName1("initWithHost:port:protocol:realm:authenticationMethod:"); + instancetype _objc_msgSend_906( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer host, + int port, + ffi.Pointer protocol, + ffi.Pointer realm, + ffi.Pointer authenticationMethod, + ) { + return __objc_msgSend_906( + obj, + sel, + host, + port, + protocol, + realm, + authenticationMethod, + ); + } + + late final __objc_msgSend_906Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_906 = __objc_msgSend_906Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithProxyHost_port_type_realm_authenticationMethod_1 = + _registerName1("initWithProxyHost:port:type:realm:authenticationMethod:"); + late final _sel_realm1 = _registerName1("realm"); + late final _sel_receivesCredentialSecurely1 = + _registerName1("receivesCredentialSecurely"); + late final _sel_isProxy1 = _registerName1("isProxy"); + late final _sel_proxyType1 = _registerName1("proxyType"); + late final _sel_protocol1 = _registerName1("protocol"); + late final _sel_authenticationMethod1 = + _registerName1("authenticationMethod"); + late final _sel_distinguishedNames1 = _registerName1("distinguishedNames"); + late final _sel_serverTrust1 = _registerName1("serverTrust"); + ffi.Pointer<__SecTrust> _objc_msgSend_907( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_907( + obj, + sel, + ); + } + + late final __objc_msgSend_907Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<__SecTrust> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_907 = __objc_msgSend_907Ptr.asFunction< + ffi.Pointer<__SecTrust> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLCredentialStorage1 = + _getClass1("NSURLCredentialStorage"); + late final _sel_sharedCredentialStorage1 = + _registerName1("sharedCredentialStorage"); + ffi.Pointer _objc_msgSend_908( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_908( + obj, + sel, + ); + } + + late final __objc_msgSend_908Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_908 = __objc_msgSend_908Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_credentialsForProtectionSpace_1 = + _registerName1("credentialsForProtectionSpace:"); + ffi.Pointer _objc_msgSend_909( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ) { + return __objc_msgSend_909( + obj, + sel, + space, + ); + } + + late final __objc_msgSend_909Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_909 = __objc_msgSend_909Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_allCredentials1 = _registerName1("allCredentials"); + late final _sel_setCredential_forProtectionSpace_1 = + _registerName1("setCredential:forProtectionSpace:"); + void _objc_msgSend_910( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer space, + ) { + return __objc_msgSend_910( + obj, + sel, + credential, + space, + ); + } + + late final __objc_msgSend_910Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_910 = __objc_msgSend_910Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_removeCredential_forProtectionSpace_1 = + _registerName1("removeCredential:forProtectionSpace:"); + late final _sel_removeCredential_forProtectionSpace_options_1 = + _registerName1("removeCredential:forProtectionSpace:options:"); + void _objc_msgSend_911( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer space, + ffi.Pointer options, + ) { + return __objc_msgSend_911( + obj, + sel, + credential, + space, + options, + ); + } + + late final __objc_msgSend_911Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_911 = __objc_msgSend_911Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_defaultCredentialForProtectionSpace_1 = + _registerName1("defaultCredentialForProtectionSpace:"); + ffi.Pointer _objc_msgSend_912( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ) { + return __objc_msgSend_912( + obj, + sel, + space, + ); + } + + late final __objc_msgSend_912Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_912 = __objc_msgSend_912Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDefaultCredential_forProtectionSpace_1 = + _registerName1("setDefaultCredential:forProtectionSpace:"); + late final _sel_getCredentialsForProtectionSpace_task_completionHandler_1 = + _registerName1( + "getCredentialsForProtectionSpace:task:completionHandler:"); + void _objc_msgSend_913( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer protectionSpace, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_913( + obj, + sel, + protectionSpace, + task, + completionHandler, + ); + } + + late final __objc_msgSend_913Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_913 = __objc_msgSend_913Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setCredential_forProtectionSpace_task_1 = + _registerName1("setCredential:forProtectionSpace:task:"); + void _objc_msgSend_914( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer protectionSpace, + ffi.Pointer task, + ) { + return __objc_msgSend_914( + obj, + sel, + credential, + protectionSpace, + task, + ); + } + + late final __objc_msgSend_914Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_914 = __objc_msgSend_914Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeCredential_forProtectionSpace_options_task_1 = + _registerName1("removeCredential:forProtectionSpace:options:task:"); + void _objc_msgSend_915( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer credential, + ffi.Pointer protectionSpace, + ffi.Pointer options, + ffi.Pointer task, + ) { + return __objc_msgSend_915( + obj, + sel, + credential, + protectionSpace, + options, + task, + ); + } + + late final __objc_msgSend_915Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_915 = __objc_msgSend_915Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1 = + _registerName1( + "getDefaultCredentialForProtectionSpace:task:completionHandler:"); + void _objc_msgSend_916( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer space, + ffi.Pointer task, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_916( + obj, + sel, + space, + task, + completionHandler, + ); + } + + late final __objc_msgSend_916Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_916 = __objc_msgSend_916Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_setDefaultCredential_forProtectionSpace_task_1 = + _registerName1("setDefaultCredential:forProtectionSpace:task:"); + late final _class_NSURLProtocol1 = _getClass1("NSURLProtocol"); + late final _sel_initWithRequest_cachedResponse_client_1 = + _registerName1("initWithRequest:cachedResponse:client:"); + instancetype _objc_msgSend_917( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer cachedResponse, + ffi.Pointer client, + ) { + return __objc_msgSend_917( + obj, + sel, + request, + cachedResponse, + client, + ); + } + + late final __objc_msgSend_917Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_917 = __objc_msgSend_917Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_client1 = _registerName1("client"); + late final _sel_request1 = _registerName1("request"); + late final _sel_cachedResponse1 = _registerName1("cachedResponse"); + ffi.Pointer _objc_msgSend_918( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_918( + obj, + sel, + ); + } + + late final __objc_msgSend_918Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_918 = __objc_msgSend_918Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_canInitWithRequest_1 = _registerName1("canInitWithRequest:"); + late final _sel_canonicalRequestForRequest_1 = + _registerName1("canonicalRequestForRequest:"); + ffi.Pointer _objc_msgSend_919( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_919( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_919Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_919 = __objc_msgSend_919Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_requestIsCacheEquivalent_toRequest_1 = + _registerName1("requestIsCacheEquivalent:toRequest:"); + bool _objc_msgSend_920( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer a, + ffi.Pointer b, + ) { + return __objc_msgSend_920( + obj, + sel, + a, + b, + ); + } + + late final __objc_msgSend_920Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_920 = __objc_msgSend_920Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_startLoading1 = _registerName1("startLoading"); + late final _sel_stopLoading1 = _registerName1("stopLoading"); + late final _sel_propertyForKey_inRequest_1 = + _registerName1("propertyForKey:inRequest:"); + ffi.Pointer _objc_msgSend_921( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_921( + obj, + sel, + key, + request, + ); + } + + late final __objc_msgSend_921Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_921 = __objc_msgSend_921Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSMutableURLRequest1 = _getClass1("NSMutableURLRequest"); + late final _sel_setURL_1 = _registerName1("setURL:"); + late final _sel_setCachePolicy_1 = _registerName1("setCachePolicy:"); + void _objc_msgSend_922( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_922( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_922Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_922 = __objc_msgSend_922Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setTimeoutInterval_1 = _registerName1("setTimeoutInterval:"); + late final _sel_setMainDocumentURL_1 = _registerName1("setMainDocumentURL:"); + late final _sel_setNetworkServiceType_1 = + _registerName1("setNetworkServiceType:"); + void _objc_msgSend_923( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_923( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_923Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_923 = __objc_msgSend_923Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setAllowsCellularAccess_1 = + _registerName1("setAllowsCellularAccess:"); + late final _sel_setAllowsExpensiveNetworkAccess_1 = + _registerName1("setAllowsExpensiveNetworkAccess:"); + late final _sel_setAllowsConstrainedNetworkAccess_1 = + _registerName1("setAllowsConstrainedNetworkAccess:"); + late final _sel_setAssumesHTTP3Capable_1 = + _registerName1("setAssumesHTTP3Capable:"); + late final _sel_setAttribution_1 = _registerName1("setAttribution:"); + void _objc_msgSend_924( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_924( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_924Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_924 = __objc_msgSend_924Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setRequiresDNSSECValidation_1 = + _registerName1("setRequiresDNSSECValidation:"); + late final _sel_setHTTPMethod_1 = _registerName1("setHTTPMethod:"); + late final _sel_setAllHTTPHeaderFields_1 = + _registerName1("setAllHTTPHeaderFields:"); + late final _sel_setValue_forHTTPHeaderField_1 = + _registerName1("setValue:forHTTPHeaderField:"); + late final _sel_addValue_forHTTPHeaderField_1 = + _registerName1("addValue:forHTTPHeaderField:"); + late final _sel_setHTTPBody_1 = _registerName1("setHTTPBody:"); + void _objc_msgSend_925( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_925( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_925Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_925 = __objc_msgSend_925Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setHTTPBodyStream_1 = _registerName1("setHTTPBodyStream:"); + void _objc_msgSend_926( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_926( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_926Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_926 = __objc_msgSend_926Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setHTTPShouldHandleCookies_1 = + _registerName1("setHTTPShouldHandleCookies:"); + late final _sel_setHTTPShouldUsePipelining_1 = + _registerName1("setHTTPShouldUsePipelining:"); + late final _sel_setProperty_forKey_inRequest_1 = + _registerName1("setProperty:forKey:inRequest:"); + void _objc_msgSend_927( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_927( + obj, + sel, + value, + key, + request, + ); + } + + late final __objc_msgSend_927Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_927 = __objc_msgSend_927Ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removePropertyForKey_inRequest_1 = + _registerName1("removePropertyForKey:inRequest:"); + void _objc_msgSend_928( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ffi.Pointer request, + ) { + return __objc_msgSend_928( + obj, + sel, + key, + request, + ); + } + + late final __objc_msgSend_928Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_928 = __objc_msgSend_928Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_registerClass_1 = _registerName1("registerClass:"); + late final _sel_unregisterClass_1 = _registerName1("unregisterClass:"); + late final _sel_canInitWithTask_1 = _registerName1("canInitWithTask:"); + bool _objc_msgSend_929( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ) { + return __objc_msgSend_929( + obj, + sel, + task, + ); + } + + late final __objc_msgSend_929Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_929 = __objc_msgSend_929Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_initWithTask_cachedResponse_client_1 = + _registerName1("initWithTask:cachedResponse:client:"); + instancetype _objc_msgSend_930( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer task, + ffi.Pointer cachedResponse, + ffi.Pointer client, + ) { + return __objc_msgSend_930( + obj, + sel, + task, + cachedResponse, + client, + ); + } + + late final __objc_msgSend_930Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_930 = __objc_msgSend_930Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_task1 = _registerName1("task"); + ffi.Pointer _objc_msgSend_931( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_931( + obj, + sel, + ); + } + + late final __objc_msgSend_931Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_931 = __objc_msgSend_931Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSXMLParser1 = _getClass1("NSXMLParser"); + late final _sel_initWithStream_1 = _registerName1("initWithStream:"); + instancetype _objc_msgSend_932( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer stream, + ) { + return __objc_msgSend_932( + obj, + sel, + stream, + ); + } + + late final __objc_msgSend_932Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_932 = __objc_msgSend_932Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_shouldProcessNamespaces1 = + _registerName1("shouldProcessNamespaces"); + late final _sel_setShouldProcessNamespaces_1 = + _registerName1("setShouldProcessNamespaces:"); + late final _sel_shouldReportNamespacePrefixes1 = + _registerName1("shouldReportNamespacePrefixes"); + late final _sel_setShouldReportNamespacePrefixes_1 = + _registerName1("setShouldReportNamespacePrefixes:"); + late final _sel_externalEntityResolvingPolicy1 = + _registerName1("externalEntityResolvingPolicy"); + int _objc_msgSend_933( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_933( + obj, + sel, + ); + } + + late final __objc_msgSend_933Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_933 = __objc_msgSend_933Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setExternalEntityResolvingPolicy_1 = + _registerName1("setExternalEntityResolvingPolicy:"); + void _objc_msgSend_934( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_934( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_934Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_934 = __objc_msgSend_934Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_allowedExternalEntityURLs1 = + _registerName1("allowedExternalEntityURLs"); + late final _sel_setAllowedExternalEntityURLs_1 = + _registerName1("setAllowedExternalEntityURLs:"); + void _objc_msgSend_935( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_935( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_935Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_935 = __objc_msgSend_935Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_parse1 = _registerName1("parse"); + late final _sel_abortParsing1 = _registerName1("abortParsing"); + late final _sel_parserError1 = _registerName1("parserError"); + late final _sel_shouldResolveExternalEntities1 = + _registerName1("shouldResolveExternalEntities"); + late final _sel_setShouldResolveExternalEntities_1 = + _registerName1("setShouldResolveExternalEntities:"); + late final _sel_publicID1 = _registerName1("publicID"); + late final _sel_systemID1 = _registerName1("systemID"); + late final _sel_lineNumber1 = _registerName1("lineNumber"); + late final _sel_columnNumber1 = _registerName1("columnNumber"); + late final _class_NSFileWrapper1 = _getClass1("NSFileWrapper"); + late final _sel_initWithURL_options_error_1 = + _registerName1("initWithURL:options:error:"); + instancetype _objc_msgSend_936( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_936( + obj, + sel, + url, + options, + outError, + ); + } + + late final __objc_msgSend_936Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_936 = __objc_msgSend_936Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initDirectoryWithFileWrappers_1 = + _registerName1("initDirectoryWithFileWrappers:"); + late final _sel_initRegularFileWithContents_1 = + _registerName1("initRegularFileWithContents:"); + late final _sel_initSymbolicLinkWithDestinationURL_1 = + _registerName1("initSymbolicLinkWithDestinationURL:"); + late final _sel_initWithSerializedRepresentation_1 = + _registerName1("initWithSerializedRepresentation:"); + late final _sel_isDirectory1 = _registerName1("isDirectory"); + late final _sel_isRegularFile1 = _registerName1("isRegularFile"); + late final _sel_isSymbolicLink1 = _registerName1("isSymbolicLink"); + late final _sel_preferredFilename1 = _registerName1("preferredFilename"); + late final _sel_setPreferredFilename_1 = + _registerName1("setPreferredFilename:"); + late final _sel_filename1 = _registerName1("filename"); + late final _sel_setFilename_1 = _registerName1("setFilename:"); + late final _sel_fileAttributes1 = _registerName1("fileAttributes"); + late final _sel_setFileAttributes_1 = _registerName1("setFileAttributes:"); + late final _sel_matchesContentsOfURL_1 = + _registerName1("matchesContentsOfURL:"); + late final _sel_readFromURL_options_error_1 = + _registerName1("readFromURL:options:error:"); + bool _objc_msgSend_937( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer> outError, + ) { + return __objc_msgSend_937( + obj, + sel, + url, + options, + outError, + ); + } + + late final __objc_msgSend_937Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_937 = __objc_msgSend_937Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_writeToURL_options_originalContentsURL_error_1 = + _registerName1("writeToURL:options:originalContentsURL:error:"); + bool _objc_msgSend_938( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int options, + ffi.Pointer originalContentsURL, + ffi.Pointer> outError, + ) { + return __objc_msgSend_938( + obj, + sel, + url, + options, + originalContentsURL, + outError, + ); + } + + late final __objc_msgSend_938Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_938 = __objc_msgSend_938Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_serializedRepresentation1 = + _registerName1("serializedRepresentation"); + late final _sel_addFileWrapper_1 = _registerName1("addFileWrapper:"); + ffi.Pointer _objc_msgSend_939( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_939( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_939Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_939 = __objc_msgSend_939Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_addRegularFileWithContents_preferredFilename_1 = + _registerName1("addRegularFileWithContents:preferredFilename:"); + ffi.Pointer _objc_msgSend_940( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ffi.Pointer fileName, + ) { + return __objc_msgSend_940( + obj, + sel, + data, + fileName, + ); + } + + late final __objc_msgSend_940Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_removeFileWrapper_1 = _registerName1("removeFileWrapper:"); + void _objc_msgSend_941( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_941( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_941Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_941 = __objc_msgSend_941Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_fileWrappers1 = _registerName1("fileWrappers"); + late final _sel_keyForFileWrapper_1 = _registerName1("keyForFileWrapper:"); + late final _sel_regularFileContents1 = _registerName1("regularFileContents"); + late final _sel_symbolicLinkDestinationURL1 = + _registerName1("symbolicLinkDestinationURL"); + late final _sel_initSymbolicLinkWithDestination_1 = + _registerName1("initSymbolicLinkWithDestination:"); + late final _sel_needsToBeUpdatedFromPath_1 = + _registerName1("needsToBeUpdatedFromPath:"); + late final _sel_updateFromPath_1 = _registerName1("updateFromPath:"); + late final _sel_writeToFile_atomically_updateFilenames_1 = + _registerName1("writeToFile:atomically:updateFilenames:"); + bool _objc_msgSend_942( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + bool atomicFlag, + bool updateFilenamesFlag, + ) { + return __objc_msgSend_942( + obj, + sel, + path, + atomicFlag, + updateFilenamesFlag, + ); + } + + late final __objc_msgSend_942Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_942 = __objc_msgSend_942Ptr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool, bool)>(); + + late final _sel_addFileWithPath_1 = _registerName1("addFileWithPath:"); + late final _sel_addSymbolicLinkWithDestination_preferredFilename_1 = + _registerName1("addSymbolicLinkWithDestination:preferredFilename:"); + late final _sel_symbolicLinkDestination1 = + _registerName1("symbolicLinkDestination"); + late final _class_NSURLSession1 = _getClass1("NSURLSession"); + late final _sel_sharedSession1 = _registerName1("sharedSession"); + ffi.Pointer _objc_msgSend_943( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_943( + obj, + sel, + ); + } + + late final __objc_msgSend_943Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_943 = __objc_msgSend_943Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionConfiguration1 = + _getClass1("NSURLSessionConfiguration"); + late final _sel_defaultSessionConfiguration1 = + _registerName1("defaultSessionConfiguration"); + ffi.Pointer _objc_msgSend_944( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_944( + obj, + sel, + ); + } + + late final __objc_msgSend_944Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_944 = __objc_msgSend_944Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_ephemeralSessionConfiguration1 = + _registerName1("ephemeralSessionConfiguration"); + late final _sel_backgroundSessionConfigurationWithIdentifier_1 = + _registerName1("backgroundSessionConfigurationWithIdentifier:"); + ffi.Pointer _objc_msgSend_945( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer identifier, + ) { + return __objc_msgSend_945( + obj, + sel, + identifier, + ); + } + + late final __objc_msgSend_945Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_945 = __objc_msgSend_945Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_identifier1 = _registerName1("identifier"); + late final _sel_requestCachePolicy1 = _registerName1("requestCachePolicy"); + late final _sel_setRequestCachePolicy_1 = + _registerName1("setRequestCachePolicy:"); + late final _sel_timeoutIntervalForRequest1 = + _registerName1("timeoutIntervalForRequest"); + late final _sel_setTimeoutIntervalForRequest_1 = + _registerName1("setTimeoutIntervalForRequest:"); + late final _sel_timeoutIntervalForResource1 = + _registerName1("timeoutIntervalForResource"); + late final _sel_setTimeoutIntervalForResource_1 = + _registerName1("setTimeoutIntervalForResource:"); + late final _sel_waitsForConnectivity1 = + _registerName1("waitsForConnectivity"); + late final _sel_setWaitsForConnectivity_1 = + _registerName1("setWaitsForConnectivity:"); + late final _sel_isDiscretionary1 = _registerName1("isDiscretionary"); + late final _sel_setDiscretionary_1 = _registerName1("setDiscretionary:"); + late final _sel_sharedContainerIdentifier1 = + _registerName1("sharedContainerIdentifier"); + late final _sel_setSharedContainerIdentifier_1 = + _registerName1("setSharedContainerIdentifier:"); + late final _sel_sessionSendsLaunchEvents1 = + _registerName1("sessionSendsLaunchEvents"); + late final _sel_setSessionSendsLaunchEvents_1 = + _registerName1("setSessionSendsLaunchEvents:"); + late final _sel_connectionProxyDictionary1 = + _registerName1("connectionProxyDictionary"); + late final _sel_setConnectionProxyDictionary_1 = + _registerName1("setConnectionProxyDictionary:"); + late final _sel_TLSMinimumSupportedProtocol1 = + _registerName1("TLSMinimumSupportedProtocol"); + int _objc_msgSend_946( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_946( + obj, + sel, + ); + } + + late final __objc_msgSend_946Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_946 = __objc_msgSend_946Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTLSMinimumSupportedProtocol_1 = + _registerName1("setTLSMinimumSupportedProtocol:"); + void _objc_msgSend_947( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_947( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_947Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_947 = __objc_msgSend_947Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_TLSMaximumSupportedProtocol1 = + _registerName1("TLSMaximumSupportedProtocol"); + late final _sel_setTLSMaximumSupportedProtocol_1 = + _registerName1("setTLSMaximumSupportedProtocol:"); + late final _sel_TLSMinimumSupportedProtocolVersion1 = + _registerName1("TLSMinimumSupportedProtocolVersion"); + int _objc_msgSend_948( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_948( + obj, + sel, + ); + } + + late final __objc_msgSend_948Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_948 = __objc_msgSend_948Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTLSMinimumSupportedProtocolVersion_1 = + _registerName1("setTLSMinimumSupportedProtocolVersion:"); + void _objc_msgSend_949( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_949( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_949Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_949 = __objc_msgSend_949Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_TLSMaximumSupportedProtocolVersion1 = + _registerName1("TLSMaximumSupportedProtocolVersion"); + late final _sel_setTLSMaximumSupportedProtocolVersion_1 = + _registerName1("setTLSMaximumSupportedProtocolVersion:"); + late final _sel_HTTPShouldSetCookies1 = + _registerName1("HTTPShouldSetCookies"); + late final _sel_setHTTPShouldSetCookies_1 = + _registerName1("setHTTPShouldSetCookies:"); + late final _sel_HTTPCookieAcceptPolicy1 = + _registerName1("HTTPCookieAcceptPolicy"); + late final _sel_setHTTPCookieAcceptPolicy_1 = + _registerName1("setHTTPCookieAcceptPolicy:"); + late final _sel_HTTPAdditionalHeaders1 = + _registerName1("HTTPAdditionalHeaders"); + late final _sel_setHTTPAdditionalHeaders_1 = + _registerName1("setHTTPAdditionalHeaders:"); + late final _sel_HTTPMaximumConnectionsPerHost1 = + _registerName1("HTTPMaximumConnectionsPerHost"); + late final _sel_setHTTPMaximumConnectionsPerHost_1 = + _registerName1("setHTTPMaximumConnectionsPerHost:"); + late final _sel_HTTPCookieStorage1 = _registerName1("HTTPCookieStorage"); + late final _sel_setHTTPCookieStorage_1 = + _registerName1("setHTTPCookieStorage:"); + void _objc_msgSend_950( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_950( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_950Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_950 = __objc_msgSend_950Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLCredentialStorage1 = + _registerName1("URLCredentialStorage"); + late final _sel_setURLCredentialStorage_1 = + _registerName1("setURLCredentialStorage:"); + void _objc_msgSend_951( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_951( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_951Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_951 = __objc_msgSend_951Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_URLCache1 = _registerName1("URLCache"); + late final _sel_setURLCache_1 = _registerName1("setURLCache:"); + late final _sel_shouldUseExtendedBackgroundIdleMode1 = + _registerName1("shouldUseExtendedBackgroundIdleMode"); + late final _sel_setShouldUseExtendedBackgroundIdleMode_1 = + _registerName1("setShouldUseExtendedBackgroundIdleMode:"); + late final _sel_protocolClasses1 = _registerName1("protocolClasses"); + late final _sel_setProtocolClasses_1 = _registerName1("setProtocolClasses:"); + late final _sel_multipathServiceType1 = + _registerName1("multipathServiceType"); + int _objc_msgSend_952( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_952( + obj, + sel, + ); + } + + late final __objc_msgSend_952Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_952 = __objc_msgSend_952Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setMultipathServiceType_1 = + _registerName1("setMultipathServiceType:"); + void _objc_msgSend_953( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_953( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_953Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_953 = __objc_msgSend_953Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_backgroundSessionConfiguration_1 = + _registerName1("backgroundSessionConfiguration:"); + late final _sel_sessionWithConfiguration_1 = + _registerName1("sessionWithConfiguration:"); + ffi.Pointer _objc_msgSend_954( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer configuration, + ) { + return __objc_msgSend_954( + obj, + sel, + configuration, + ); + } + + late final __objc_msgSend_954Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_954 = __objc_msgSend_954Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sessionWithConfiguration_delegate_delegateQueue_1 = + _registerName1("sessionWithConfiguration:delegate:delegateQueue:"); + ffi.Pointer _objc_msgSend_955( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer configuration, + ffi.Pointer delegate, + ffi.Pointer queue, + ) { + return __objc_msgSend_955( + obj, + sel, + configuration, + delegate, + queue, + ); + } + + late final __objc_msgSend_955Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_delegateQueue1 = _registerName1("delegateQueue"); + late final _sel_configuration1 = _registerName1("configuration"); + late final _sel_sessionDescription1 = _registerName1("sessionDescription"); + late final _sel_setSessionDescription_1 = + _registerName1("setSessionDescription:"); + late final _sel_finishTasksAndInvalidate1 = + _registerName1("finishTasksAndInvalidate"); + late final _sel_invalidateAndCancel1 = _registerName1("invalidateAndCancel"); + late final _sel_resetWithCompletionHandler_1 = + _registerName1("resetWithCompletionHandler:"); + late final _sel_flushWithCompletionHandler_1 = + _registerName1("flushWithCompletionHandler:"); + late final _sel_getTasksWithCompletionHandler_1 = + _registerName1("getTasksWithCompletionHandler:"); + void _objc_msgSend_956( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_956( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_956Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_956 = __objc_msgSend_956Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_getAllTasksWithCompletionHandler_1 = + _registerName1("getAllTasksWithCompletionHandler:"); + void _objc_msgSend_957( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_957( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_957Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_957 = __objc_msgSend_957Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataTaskWithRequest_1 = + _registerName1("dataTaskWithRequest:"); + ffi.Pointer _objc_msgSend_958( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_958( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_958Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_958 = __objc_msgSend_958Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataTaskWithURL_1 = _registerName1("dataTaskWithURL:"); + ffi.Pointer _objc_msgSend_959( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_959( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_959Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_959 = __objc_msgSend_959Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionUploadTask1 = + _getClass1("NSURLSessionUploadTask"); + late final _sel_uploadTaskWithRequest_fromFile_1 = + _registerName1("uploadTaskWithRequest:fromFile:"); + ffi.Pointer _objc_msgSend_960( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer fileURL, + ) { + return __objc_msgSend_960( + obj, + sel, + request, + fileURL, + ); + } + + late final __objc_msgSend_960Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_960 = __objc_msgSend_960Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_uploadTaskWithRequest_fromData_1 = + _registerName1("uploadTaskWithRequest:fromData:"); + ffi.Pointer _objc_msgSend_961( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer bodyData, + ) { + return __objc_msgSend_961( + obj, + sel, + request, + bodyData, + ); + } + + late final __objc_msgSend_961Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_961 = __objc_msgSend_961Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_uploadTaskWithStreamedRequest_1 = + _registerName1("uploadTaskWithStreamedRequest:"); + ffi.Pointer _objc_msgSend_962( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_962( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_962Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_962 = __objc_msgSend_962Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionDownloadTask1 = + _getClass1("NSURLSessionDownloadTask"); + late final _sel_cancelByProducingResumeData_1 = + _registerName1("cancelByProducingResumeData:"); + void _objc_msgSend_963( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_963( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_963Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_963 = __objc_msgSend_963Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithRequest_1 = + _registerName1("downloadTaskWithRequest:"); + ffi.Pointer _objc_msgSend_964( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_964( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_964Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_964 = __objc_msgSend_964Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_downloadTaskWithURL_1 = + _registerName1("downloadTaskWithURL:"); + ffi.Pointer _objc_msgSend_965( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_965( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_965Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_965 = __objc_msgSend_965Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_downloadTaskWithResumeData_1 = + _registerName1("downloadTaskWithResumeData:"); + ffi.Pointer _objc_msgSend_966( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer resumeData, + ) { + return __objc_msgSend_966( + obj, + sel, + resumeData, + ); + } + + late final __objc_msgSend_966Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_966 = __objc_msgSend_966Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionStreamTask1 = + _getClass1("NSURLSessionStreamTask"); + late final _sel_readDataOfMinLength_maxLength_timeout_completionHandler_1 = + _registerName1( + "readDataOfMinLength:maxLength:timeout:completionHandler:"); + void _objc_msgSend_967( + ffi.Pointer obj, + ffi.Pointer sel, + int minBytes, + int maxBytes, + double timeout, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_967( + obj, + sel, + minBytes, + maxBytes, + timeout, + completionHandler, + ); + } + + late final __objc_msgSend_967Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Double, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_967 = __objc_msgSend_967Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, int, + double, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_writeData_timeout_completionHandler_1 = + _registerName1("writeData:timeout:completionHandler:"); + void _objc_msgSend_968( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + double timeout, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_968( + obj, + sel, + data, + timeout, + completionHandler, + ); + } + + late final __objc_msgSend_968Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_968 = __objc_msgSend_968Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, double, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_captureStreams1 = _registerName1("captureStreams"); + late final _sel_closeWrite1 = _registerName1("closeWrite"); + late final _sel_closeRead1 = _registerName1("closeRead"); + late final _sel_startSecureConnection1 = + _registerName1("startSecureConnection"); + late final _sel_stopSecureConnection1 = + _registerName1("stopSecureConnection"); + late final _sel_streamTaskWithHostName_port_1 = + _registerName1("streamTaskWithHostName:port:"); + ffi.Pointer _objc_msgSend_969( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer hostname, + int port, + ) { + return __objc_msgSend_969( + obj, + sel, + hostname, + port, + ); + } + + late final __objc_msgSend_969Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long)>>('objc_msgSend'); + late final __objc_msgSend_969 = __objc_msgSend_969Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); + + late final _class_NSNetService1 = _getClass1("NSNetService"); + late final _sel_initWithDomain_type_name_port_1 = + _registerName1("initWithDomain:type:name:port:"); + instancetype _objc_msgSend_970( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer domain, + ffi.Pointer type, + ffi.Pointer name, + int port, + ) { + return __objc_msgSend_970( + obj, + sel, + domain, + type, + name, + port, + ); + } + + late final __objc_msgSend_970Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int)>>('objc_msgSend'); + late final __objc_msgSend_970 = __objc_msgSend_970Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + late final _sel_initWithDomain_type_name_1 = + _registerName1("initWithDomain:type:name:"); + late final _sel_includesPeerToPeer1 = _registerName1("includesPeerToPeer"); + late final _sel_setIncludesPeerToPeer_1 = + _registerName1("setIncludesPeerToPeer:"); + late final _sel_type1 = _registerName1("type"); + late final _sel_publishWithOptions_1 = _registerName1("publishWithOptions:"); + void _objc_msgSend_971( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_971( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_971Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_971 = __objc_msgSend_971Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_resolve1 = _registerName1("resolve"); + late final _sel_stop1 = _registerName1("stop"); + late final _sel_dictionaryFromTXTRecordData_1 = + _registerName1("dictionaryFromTXTRecordData:"); + ffi.Pointer _objc_msgSend_972( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer txtData, + ) { + return __objc_msgSend_972( + obj, + sel, + txtData, + ); + } + + late final __objc_msgSend_972Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_972 = __objc_msgSend_972Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataFromTXTRecordDictionary_1 = + _registerName1("dataFromTXTRecordDictionary:"); + ffi.Pointer _objc_msgSend_973( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer txtDictionary, + ) { + return __objc_msgSend_973( + obj, + sel, + txtDictionary, + ); + } + + late final __objc_msgSend_973Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_973 = __objc_msgSend_973Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_resolveWithTimeout_1 = _registerName1("resolveWithTimeout:"); + late final _sel_getInputStream_outputStream_1 = + _registerName1("getInputStream:outputStream:"); + bool _objc_msgSend_974( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream, + ) { + return __objc_msgSend_974( + obj, + sel, + inputStream, + outputStream, + ); + } + + late final __objc_msgSend_974Ptr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_974 = __objc_msgSend_974Ptr.asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); + + late final _sel_setTXTRecordData_1 = _registerName1("setTXTRecordData:"); + late final _sel_TXTRecordData1 = _registerName1("TXTRecordData"); + late final _sel_startMonitoring1 = _registerName1("startMonitoring"); + late final _sel_stopMonitoring1 = _registerName1("stopMonitoring"); + late final _sel_streamTaskWithNetService_1 = + _registerName1("streamTaskWithNetService:"); + ffi.Pointer _objc_msgSend_975( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer service, + ) { + return __objc_msgSend_975( + obj, + sel, + service, + ); + } + + late final __objc_msgSend_975Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_975 = __objc_msgSend_975Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_NSURLSessionWebSocketTask1 = + _getClass1("NSURLSessionWebSocketTask"); + late final _class_NSURLSessionWebSocketMessage1 = + _getClass1("NSURLSessionWebSocketMessage"); + int _objc_msgSend_976( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_976( + obj, + sel, + ); + } + + late final __objc_msgSend_976Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_976 = __objc_msgSend_976Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sendMessage_completionHandler_1 = + _registerName1("sendMessage:completionHandler:"); + void _objc_msgSend_977( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer message, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_977( + obj, + sel, + message, + completionHandler, + ); + } + + late final __objc_msgSend_977Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_977 = __objc_msgSend_977Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_receiveMessageWithCompletionHandler_1 = + _registerName1("receiveMessageWithCompletionHandler:"); + void _objc_msgSend_978( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_978( + obj, + sel, + completionHandler, + ); + } + + late final __objc_msgSend_978Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_978 = __objc_msgSend_978Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_sendPingWithPongReceiveHandler_1 = + _registerName1("sendPingWithPongReceiveHandler:"); + void _objc_msgSend_979( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> pongReceiveHandler, + ) { + return __objc_msgSend_979( + obj, + sel, + pongReceiveHandler, + ); + } + + late final __objc_msgSend_979Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_979 = __objc_msgSend_979Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_cancelWithCloseCode_reason_1 = + _registerName1("cancelWithCloseCode:reason:"); + void _objc_msgSend_980( + ffi.Pointer obj, + ffi.Pointer sel, + int closeCode, + ffi.Pointer reason, + ) { + return __objc_msgSend_980( + obj, + sel, + closeCode, + reason, + ); + } + + late final __objc_msgSend_980Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_980 = __objc_msgSend_980Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _sel_maximumMessageSize1 = _registerName1("maximumMessageSize"); + late final _sel_setMaximumMessageSize_1 = + _registerName1("setMaximumMessageSize:"); + late final _sel_closeCode1 = _registerName1("closeCode"); + int _objc_msgSend_981( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_981( + obj, + sel, + ); + } + + late final __objc_msgSend_981Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_981 = __objc_msgSend_981Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_closeReason1 = _registerName1("closeReason"); + late final _sel_webSocketTaskWithURL_1 = + _registerName1("webSocketTaskWithURL:"); + ffi.Pointer _objc_msgSend_982( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ) { + return __objc_msgSend_982( + obj, + sel, + url, + ); + } + + late final __objc_msgSend_982Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_982 = __objc_msgSend_982Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_webSocketTaskWithURL_protocols_1 = + _registerName1("webSocketTaskWithURL:protocols:"); + ffi.Pointer _objc_msgSend_983( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer protocols, + ) { + return __objc_msgSend_983( + obj, + sel, + url, + protocols, + ); + } + + late final __objc_msgSend_983Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_983 = __objc_msgSend_983Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_webSocketTaskWithRequest_1 = + _registerName1("webSocketTaskWithRequest:"); + ffi.Pointer _objc_msgSend_984( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ) { + return __objc_msgSend_984( + obj, + sel, + request, + ); + } + + late final __objc_msgSend_984Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_984 = __objc_msgSend_984Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_dataTaskWithRequest_completionHandler_1 = + _registerName1("dataTaskWithRequest:completionHandler:"); + ffi.Pointer _objc_msgSend_985( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_985( + obj, + sel, + request, + completionHandler, + ); + } + + late final __objc_msgSend_985Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_985 = __objc_msgSend_985Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_dataTaskWithURL_completionHandler_1 = + _registerName1("dataTaskWithURL:completionHandler:"); + ffi.Pointer _objc_msgSend_986( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_986( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_986Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_986 = __objc_msgSend_986Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_uploadTaskWithRequest_fromFile_completionHandler_1 = + _registerName1("uploadTaskWithRequest:fromFile:completionHandler:"); + ffi.Pointer _objc_msgSend_987( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer fileURL, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_987( + obj, + sel, + request, + fileURL, + completionHandler, + ); + } + + late final __objc_msgSend_987Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_987 = __objc_msgSend_987Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_uploadTaskWithRequest_fromData_completionHandler_1 = + _registerName1("uploadTaskWithRequest:fromData:completionHandler:"); + ffi.Pointer _objc_msgSend_988( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer bodyData, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_988( + obj, + sel, + request, + bodyData, + completionHandler, + ); + } + + late final __objc_msgSend_988Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_988 = __objc_msgSend_988Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithRequest_completionHandler_1 = + _registerName1("downloadTaskWithRequest:completionHandler:"); + ffi.Pointer _objc_msgSend_989( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer request, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_989( + obj, + sel, + request, + completionHandler, + ); + } + + late final __objc_msgSend_989Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_989 = __objc_msgSend_989Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithURL_completionHandler_1 = + _registerName1("downloadTaskWithURL:completionHandler:"); + ffi.Pointer _objc_msgSend_990( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_990( + obj, + sel, + url, + completionHandler, + ); + } + + late final __objc_msgSend_990Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_990 = __objc_msgSend_990Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_downloadTaskWithResumeData_completionHandler_1 = + _registerName1("downloadTaskWithResumeData:completionHandler:"); + ffi.Pointer _objc_msgSend_991( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer resumeData, + ffi.Pointer<_ObjCBlock> completionHandler, + ) { + return __objc_msgSend_991( + obj, + sel, + resumeData, + completionHandler, + ); + } + + late final __objc_msgSend_991Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_991 = __objc_msgSend_991Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _class_NSProtocolChecker1 = _getClass1("NSProtocolChecker"); + ffi.Pointer _objc_msgSend_992( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_992( + obj, + sel, + ); + } + + late final __objc_msgSend_992Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_992 = __objc_msgSend_992Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_protocolCheckerWithTarget_protocol_1 = + _registerName1("protocolCheckerWithTarget:protocol:"); + instancetype _objc_msgSend_993( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anObject, + ffi.Pointer aProtocol, + ) { + return __objc_msgSend_993( + obj, + sel, + anObject, + aProtocol, + ); + } + + late final __objc_msgSend_993Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_993 = __objc_msgSend_993Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithTarget_protocol_1 = + _registerName1("initWithTarget:protocol:"); + late final _class_NSTask1 = _getClass1("NSTask"); + late final _sel_setExecutableURL_1 = _registerName1("setExecutableURL:"); + late final _sel_setEnvironment_1 = _registerName1("setEnvironment:"); + late final _sel_currentDirectoryURL1 = _registerName1("currentDirectoryURL"); + late final _sel_setCurrentDirectoryURL_1 = + _registerName1("setCurrentDirectoryURL:"); + late final _sel_standardInput1 = _registerName1("standardInput"); + late final _sel_setStandardInput_1 = _registerName1("setStandardInput:"); + late final _sel_standardOutput1 = _registerName1("standardOutput"); + late final _sel_setStandardOutput_1 = _registerName1("setStandardOutput:"); + late final _sel_standardError1 = _registerName1("standardError"); + late final _sel_setStandardError_1 = _registerName1("setStandardError:"); + late final _sel_launchAndReturnError_1 = + _registerName1("launchAndReturnError:"); + late final _sel_interrupt1 = _registerName1("interrupt"); + late final _sel_terminate1 = _registerName1("terminate"); + late final _sel_isRunning1 = _registerName1("isRunning"); + late final _sel_terminationStatus1 = _registerName1("terminationStatus"); + late final _sel_terminationReason1 = _registerName1("terminationReason"); + int _objc_msgSend_994( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_994( + obj, + sel, + ); + } + + late final __objc_msgSend_994Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_994 = __objc_msgSend_994Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_terminationHandler1 = _registerName1("terminationHandler"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_995( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_995( + obj, + sel, + ); + } + + late final __objc_msgSend_995Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_995 = __objc_msgSend_995Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setTerminationHandler_1 = + _registerName1("setTerminationHandler:"); + void _objc_msgSend_996( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_996( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_996Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_996 = __objc_msgSend_996Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1 = + _registerName1( + "launchedTaskWithExecutableURL:arguments:error:terminationHandler:"); + ffi.Pointer _objc_msgSend_997( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + ffi.Pointer arguments, + ffi.Pointer> error, + ffi.Pointer<_ObjCBlock> terminationHandler, + ) { + return __objc_msgSend_997( + obj, + sel, + url, + arguments, + error, + terminationHandler, + ); + } + + late final __objc_msgSend_997Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_997 = __objc_msgSend_997Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_waitUntilExit1 = _registerName1("waitUntilExit"); + late final _sel_launchPath1 = _registerName1("launchPath"); + late final _sel_setLaunchPath_1 = _registerName1("setLaunchPath:"); + late final _sel_setCurrentDirectoryPath_1 = + _registerName1("setCurrentDirectoryPath:"); + late final _sel_launch1 = _registerName1("launch"); + late final _sel_launchedTaskWithLaunchPath_arguments_1 = + _registerName1("launchedTaskWithLaunchPath:arguments:"); + ffi.Pointer _objc_msgSend_998( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer path, + ffi.Pointer arguments, + ) { + return __objc_msgSend_998( + obj, + sel, + path, + arguments, + ); + } + + late final __objc_msgSend_998Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_998 = __objc_msgSend_998Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _class_NSXMLElement1 = _getClass1("NSXMLElement"); + late final _class_NSXMLNode1 = _getClass1("NSXMLNode"); + late final _sel_initWithKind_1 = _registerName1("initWithKind:"); + instancetype _objc_msgSend_999( + ffi.Pointer obj, + ffi.Pointer sel, + int kind, + ) { + return __objc_msgSend_999( + obj, + sel, + kind, + ); + } + + late final __objc_msgSend_999Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_999 = __objc_msgSend_999Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_initWithKind_options_1 = + _registerName1("initWithKind:options:"); + instancetype _objc_msgSend_1000( + ffi.Pointer obj, + ffi.Pointer sel, + int kind, + int options, + ) { + return __objc_msgSend_1000( + obj, + sel, + kind, + options, + ); + } + + late final __objc_msgSend_1000Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_1000 = __objc_msgSend_1000Ptr.asFunction< + instancetype Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + late final _sel_document1 = _registerName1("document"); + late final _sel_documentWithRootElement_1 = + _registerName1("documentWithRootElement:"); + ffi.Pointer _objc_msgSend_1001( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer element, + ) { + return __objc_msgSend_1001( + obj, + sel, + element, + ); + } + + late final __objc_msgSend_1001Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1001 = __objc_msgSend_1001Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_elementWithName_1 = _registerName1("elementWithName:"); + late final _sel_elementWithName_URI_1 = + _registerName1("elementWithName:URI:"); + late final _sel_elementWithName_stringValue_1 = + _registerName1("elementWithName:stringValue:"); + late final _sel_elementWithName_children_attributes_1 = + _registerName1("elementWithName:children:attributes:"); + ffi.Pointer _objc_msgSend_1002( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer children, + ffi.Pointer attributes, + ) { + return __objc_msgSend_1002( + obj, + sel, + name, + children, + attributes, + ); + } + + late final __objc_msgSend_1002Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1002 = __objc_msgSend_1002Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_attributeWithName_stringValue_1 = + _registerName1("attributeWithName:stringValue:"); + late final _sel_attributeWithName_URI_stringValue_1 = + _registerName1("attributeWithName:URI:stringValue:"); + late final _sel_namespaceWithName_stringValue_1 = + _registerName1("namespaceWithName:stringValue:"); + late final _sel_processingInstructionWithName_stringValue_1 = + _registerName1("processingInstructionWithName:stringValue:"); + late final _sel_commentWithStringValue_1 = + _registerName1("commentWithStringValue:"); + late final _sel_textWithStringValue_1 = + _registerName1("textWithStringValue:"); + late final _sel_DTDNodeWithXMLString_1 = + _registerName1("DTDNodeWithXMLString:"); + int _objc_msgSend_1003( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1003( + obj, + sel, + ); + } + + late final __objc_msgSend_1003Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1003 = __objc_msgSend_1003Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_objectValue1 = _registerName1("objectValue"); + late final _sel_setObjectValue_1 = _registerName1("setObjectValue:"); + late final _sel_setStringValue_1 = _registerName1("setStringValue:"); + late final _sel_setStringValue_resolvingEntities_1 = + _registerName1("setStringValue:resolvingEntities:"); + void _objc_msgSend_1004( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + bool resolve, + ) { + return __objc_msgSend_1004( + obj, + sel, + string, + resolve, + ); + } + + late final __objc_msgSend_1004Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_1004 = __objc_msgSend_1004Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, bool)>(); + + late final _sel_index1 = _registerName1("index"); + late final _sel_level1 = _registerName1("level"); + late final _class_NSXMLDocument1 = _getClass1("NSXMLDocument"); + late final _sel_initWithXMLString_options_error_1 = + _registerName1("initWithXMLString:options:error:"); + instancetype _objc_msgSend_1005( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_1005( + obj, + sel, + string, + mask, + error, + ); + } + + late final __objc_msgSend_1005Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1005 = __objc_msgSend_1005Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + instancetype _objc_msgSend_1006( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer url, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_1006( + obj, + sel, + url, + mask, + error, + ); + } + + late final __objc_msgSend_1006Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1006 = __objc_msgSend_1006Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithData_options_error_1 = + _registerName1("initWithData:options:error:"); + instancetype _objc_msgSend_1007( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + int mask, + ffi.Pointer> error, + ) { + return __objc_msgSend_1007( + obj, + sel, + data, + mask, + error, + ); + } + + late final __objc_msgSend_1007Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1007 = __objc_msgSend_1007Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); + + late final _sel_initWithRootElement_1 = + _registerName1("initWithRootElement:"); + late final _sel_replacementClassForClass_1 = + _registerName1("replacementClassForClass:"); + late final _sel_characterEncoding1 = _registerName1("characterEncoding"); + late final _sel_setCharacterEncoding_1 = + _registerName1("setCharacterEncoding:"); + late final _sel_isStandalone1 = _registerName1("isStandalone"); + late final _sel_setStandalone_1 = _registerName1("setStandalone:"); + late final _sel_documentContentKind1 = _registerName1("documentContentKind"); + int _objc_msgSend_1008( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1008( + obj, + sel, + ); + } + + late final __objc_msgSend_1008Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1008 = __objc_msgSend_1008Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDocumentContentKind_1 = + _registerName1("setDocumentContentKind:"); + void _objc_msgSend_1009( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_1009( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_1009Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_1009 = __objc_msgSend_1009Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_setMIMEType_1 = _registerName1("setMIMEType:"); + late final _class_NSXMLDTD1 = _getClass1("NSXMLDTD"); + late final _sel_setPublicID_1 = _registerName1("setPublicID:"); + late final _sel_setSystemID_1 = _registerName1("setSystemID:"); + late final _sel_insertChild_atIndex_1 = + _registerName1("insertChild:atIndex:"); + void _objc_msgSend_1010( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + int index, + ) { + return __objc_msgSend_1010( + obj, + sel, + child, + index, + ); + } + + late final __objc_msgSend_1010Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_1010 = __objc_msgSend_1010Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_insertChildren_atIndex_1 = + _registerName1("insertChildren:atIndex:"); + void _objc_msgSend_1011( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer children, + int index, + ) { + return __objc_msgSend_1011( + obj, + sel, + children, + index, + ); + } + + late final __objc_msgSend_1011Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_1011 = __objc_msgSend_1011Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _sel_removeChildAtIndex_1 = _registerName1("removeChildAtIndex:"); + late final _sel_setChildren_1 = _registerName1("setChildren:"); + late final _sel_addChild_1 = _registerName1("addChild:"); + void _objc_msgSend_1012( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer child, + ) { + return __objc_msgSend_1012( + obj, + sel, + child, + ); + } + + late final __objc_msgSend_1012Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1012 = __objc_msgSend_1012Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_replaceChildAtIndex_withNode_1 = + _registerName1("replaceChildAtIndex:withNode:"); + void _objc_msgSend_1013( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ffi.Pointer node, + ) { + return __objc_msgSend_1013( + obj, + sel, + index, + node, + ); + } + + late final __objc_msgSend_1013Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1013 = __objc_msgSend_1013Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); + + late final _class_NSXMLDTDNode1 = _getClass1("NSXMLDTDNode"); + late final _sel_initWithXMLString_1 = _registerName1("initWithXMLString:"); + late final _sel_DTDKind1 = _registerName1("DTDKind"); + int _objc_msgSend_1014( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1014( + obj, + sel, + ); + } + + late final __objc_msgSend_1014Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1014 = __objc_msgSend_1014Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDTDKind_1 = _registerName1("setDTDKind:"); + void _objc_msgSend_1015( + ffi.Pointer obj, + ffi.Pointer sel, + int value, + ) { + return __objc_msgSend_1015( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_1015Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_1015 = __objc_msgSend_1015Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_isExternal1 = _registerName1("isExternal"); + late final _sel_notationName1 = _registerName1("notationName"); + late final _sel_setNotationName_1 = _registerName1("setNotationName:"); + late final _sel_localNameForName_1 = _registerName1("localNameForName:"); + late final _sel_prefixForName_1 = _registerName1("prefixForName:"); + late final _sel_predefinedNamespaceForPrefix_1 = + _registerName1("predefinedNamespaceForPrefix:"); + ffi.Pointer _objc_msgSend_1016( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_1016( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_1016Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1016 = __objc_msgSend_1016Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_entityDeclarationForName_1 = + _registerName1("entityDeclarationForName:"); + ffi.Pointer _objc_msgSend_1017( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ) { + return __objc_msgSend_1017( + obj, + sel, + name, + ); + } + + late final __objc_msgSend_1017Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1017 = __objc_msgSend_1017Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_notationDeclarationForName_1 = + _registerName1("notationDeclarationForName:"); + late final _sel_elementDeclarationForName_1 = + _registerName1("elementDeclarationForName:"); + late final _sel_attributeDeclarationForName_elementName_1 = + _registerName1("attributeDeclarationForName:elementName:"); + ffi.Pointer _objc_msgSend_1018( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer name, + ffi.Pointer elementName, + ) { + return __objc_msgSend_1018( + obj, + sel, + name, + elementName, + ); + } + + late final __objc_msgSend_1018Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1018 = __objc_msgSend_1018Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_predefinedEntityDeclarationForName_1 = + _registerName1("predefinedEntityDeclarationForName:"); + late final _sel_DTD1 = _registerName1("DTD"); + ffi.Pointer _objc_msgSend_1019( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1019( + obj, + sel, + ); + } + + late final __objc_msgSend_1019Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1019 = __objc_msgSend_1019Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setDTD_1 = _registerName1("setDTD:"); + void _objc_msgSend_1020( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer value, + ) { + return __objc_msgSend_1020( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_1020Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1020 = __objc_msgSend_1020Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_setRootElement_1 = _registerName1("setRootElement:"); + void _objc_msgSend_1021( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer root, + ) { + return __objc_msgSend_1021( + obj, + sel, + root, + ); + } + + late final __objc_msgSend_1021Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1021 = __objc_msgSend_1021Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_rootElement1 = _registerName1("rootElement"); + ffi.Pointer _objc_msgSend_1022( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1022( + obj, + sel, + ); + } + + late final __objc_msgSend_1022Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1022 = __objc_msgSend_1022Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_XMLData1 = _registerName1("XMLData"); + late final _sel_XMLDataWithOptions_1 = _registerName1("XMLDataWithOptions:"); + ffi.Pointer _objc_msgSend_1023( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_1023( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_1023Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_1023 = __objc_msgSend_1023Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_objectByApplyingXSLT_arguments_error_1 = + _registerName1("objectByApplyingXSLT:arguments:error:"); + ffi.Pointer _objc_msgSend_1024( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xslt, + ffi.Pointer arguments, + ffi.Pointer> error, + ) { + return __objc_msgSend_1024( + obj, + sel, + xslt, + arguments, + error, + ); + } + + late final __objc_msgSend_1024Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1024 = __objc_msgSend_1024Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectByApplyingXSLTString_arguments_error_1 = + _registerName1("objectByApplyingXSLTString:arguments:error:"); + ffi.Pointer _objc_msgSend_1025( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xslt, + ffi.Pointer arguments, + ffi.Pointer> error, + ) { + return __objc_msgSend_1025( + obj, + sel, + xslt, + arguments, + error, + ); + } + + late final __objc_msgSend_1025Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1025 = __objc_msgSend_1025Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectByApplyingXSLTAtURL_arguments_error_1 = + _registerName1("objectByApplyingXSLTAtURL:arguments:error:"); + ffi.Pointer _objc_msgSend_1026( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xsltURL, + ffi.Pointer argument, + ffi.Pointer> error, + ) { + return __objc_msgSend_1026( + obj, + sel, + xsltURL, + argument, + error, + ); + } + + late final __objc_msgSend_1026Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1026 = __objc_msgSend_1026Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_validateAndReturnError_1 = + _registerName1("validateAndReturnError:"); + late final _sel_rootDocument1 = _registerName1("rootDocument"); + ffi.Pointer _objc_msgSend_1027( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1027( + obj, + sel, + ); + } + + late final __objc_msgSend_1027Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1027 = __objc_msgSend_1027Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_parent1 = _registerName1("parent"); + ffi.Pointer _objc_msgSend_1028( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1028( + obj, + sel, + ); + } + + late final __objc_msgSend_1028Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1028 = __objc_msgSend_1028Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_childCount1 = _registerName1("childCount"); + late final _sel_children1 = _registerName1("children"); + late final _sel_childAtIndex_1 = _registerName1("childAtIndex:"); + ffi.Pointer _objc_msgSend_1029( + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_1029( + obj, + sel, + index, + ); + } + + late final __objc_msgSend_1029Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_1029 = __objc_msgSend_1029Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_previousSibling1 = _registerName1("previousSibling"); + late final _sel_nextSibling1 = _registerName1("nextSibling"); + late final _sel_previousNode1 = _registerName1("previousNode"); + late final _sel_nextNode1 = _registerName1("nextNode"); + late final _sel_detach1 = _registerName1("detach"); + late final _sel_XPath1 = _registerName1("XPath"); + late final _sel_localName1 = _registerName1("localName"); + late final _sel_prefix1 = _registerName1("prefix"); + late final _sel_URI1 = _registerName1("URI"); + late final _sel_setURI_1 = _registerName1("setURI:"); + late final _sel_XMLString1 = _registerName1("XMLString"); + late final _sel_XMLStringWithOptions_1 = + _registerName1("XMLStringWithOptions:"); + ffi.Pointer _objc_msgSend_1030( + ffi.Pointer obj, + ffi.Pointer sel, + int options, + ) { + return __objc_msgSend_1030( + obj, + sel, + options, + ); + } + + late final __objc_msgSend_1030Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_1030 = __objc_msgSend_1030Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + late final _sel_canonicalXMLStringPreservingComments_1 = + _registerName1("canonicalXMLStringPreservingComments:"); + ffi.Pointer _objc_msgSend_1031( + ffi.Pointer obj, + ffi.Pointer sel, + bool comments, + ) { + return __objc_msgSend_1031( + obj, + sel, + comments, + ); + } + + late final __objc_msgSend_1031Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_1031 = __objc_msgSend_1031Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_nodesForXPath_error_1 = + _registerName1("nodesForXPath:error:"); + late final _sel_objectsForXQuery_constants_error_1 = + _registerName1("objectsForXQuery:constants:error:"); + ffi.Pointer _objc_msgSend_1032( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer xquery, + ffi.Pointer constants, + ffi.Pointer> error, + ) { + return __objc_msgSend_1032( + obj, + sel, + xquery, + constants, + error, + ); + } + + late final __objc_msgSend_1032Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('objc_msgSend'); + late final __objc_msgSend_1032 = __objc_msgSend_1032Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + + late final _sel_objectsForXQuery_error_1 = + _registerName1("objectsForXQuery:error:"); + late final _sel_initWithName_URI_1 = _registerName1("initWithName:URI:"); + late final _sel_initWithName_stringValue_1 = + _registerName1("initWithName:stringValue:"); + late final _sel_initWithXMLString_error_1 = + _registerName1("initWithXMLString:error:"); + late final _sel_elementsForName_1 = _registerName1("elementsForName:"); + late final _sel_elementsForLocalName_URI_1 = + _registerName1("elementsForLocalName:URI:"); + late final _sel_addAttribute_1 = _registerName1("addAttribute:"); + late final _sel_removeAttributeForName_1 = + _registerName1("removeAttributeForName:"); + late final _sel_attributes1 = _registerName1("attributes"); + late final _sel_setAttributes_1 = _registerName1("setAttributes:"); + late final _sel_setAttributesWithDictionary_1 = + _registerName1("setAttributesWithDictionary:"); + late final _sel_attributeForName_1 = _registerName1("attributeForName:"); + late final _sel_attributeForLocalName_URI_1 = + _registerName1("attributeForLocalName:URI:"); + ffi.Pointer _objc_msgSend_1033( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer localName, + ffi.Pointer URI, + ) { + return __objc_msgSend_1033( + obj, + sel, + localName, + URI, + ); + } + + late final __objc_msgSend_1033Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1033 = __objc_msgSend_1033Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_addNamespace_1 = _registerName1("addNamespace:"); + late final _sel_removeNamespaceForPrefix_1 = + _registerName1("removeNamespaceForPrefix:"); + late final _sel_namespaces1 = _registerName1("namespaces"); + late final _sel_setNamespaces_1 = _registerName1("setNamespaces:"); + late final _sel_namespaceForPrefix_1 = _registerName1("namespaceForPrefix:"); + late final _sel_resolveNamespaceForName_1 = + _registerName1("resolveNamespaceForName:"); + late final _sel_resolvePrefixForNamespaceURI_1 = + _registerName1("resolvePrefixForNamespaceURI:"); + late final _sel_normalizeAdjacentTextNodesPreservingCDATA_1 = + _registerName1("normalizeAdjacentTextNodesPreservingCDATA:"); + late final _sel_setAttributesAsDictionary_1 = + _registerName1("setAttributesAsDictionary:"); + late final _class_PrivateSentrySDKOnly1 = _getClass1("PrivateSentrySDKOnly"); + late final _class_SentryEnvelope1 = _getClass1("SentryEnvelope"); + late final _class_SentryId1 = _getClass1("SentryId"); + late final _class_NSUUID1 = _getClass1("NSUUID"); + late final _sel_UUID1 = _registerName1("UUID"); + late final _sel_initWithUUIDString_1 = _registerName1("initWithUUIDString:"); + late final _sel_initWithUUIDBytes_1 = _registerName1("initWithUUIDBytes:"); + instancetype _objc_msgSend_1034( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer bytes, + ) { + return __objc_msgSend_1034( + obj, + sel, + bytes, + ); + } + + late final __objc_msgSend_1034Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1034 = __objc_msgSend_1034Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_getUUIDBytes_1 = _registerName1("getUUIDBytes:"); + void _objc_msgSend_1035( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer uuid, + ) { + return __objc_msgSend_1035( + obj, + sel, + uuid, + ); + } + + late final __objc_msgSend_1035Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1035 = __objc_msgSend_1035Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + int _objc_msgSend_1036( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer otherUUID, + ) { + return __objc_msgSend_1036( + obj, + sel, + otherUUID, + ); + } + + late final __objc_msgSend_1036Ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1036 = __objc_msgSend_1036Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_UUIDString1 = _registerName1("UUIDString"); + late final _sel_initWithUUID_1 = _registerName1("initWithUUID:"); + instancetype _objc_msgSend_1037( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer uuid, + ) { + return __objc_msgSend_1037( + obj, + sel, + uuid, + ); + } + + late final __objc_msgSend_1037Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1037 = __objc_msgSend_1037Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_sentryIdString1 = _registerName1("sentryIdString"); + late final _sel_empty1 = _registerName1("empty"); + ffi.Pointer _objc_msgSend_1038( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1038( + obj, + sel, + ); + } + + late final __objc_msgSend_1038Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1038 = __objc_msgSend_1038Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _class_SentryEnvelopeItem1 = _getClass1("SentryEnvelopeItem"); + late final _class_SentryEvent1 = _getClass1("SentryEvent"); + late final _sel_initWithEvent_1 = _registerName1("initWithEvent:"); + instancetype _objc_msgSend_1039( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer event, + ) { + return __objc_msgSend_1039( + obj, + sel, + event, + ); + } + + late final __objc_msgSend_1039Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1039 = __objc_msgSend_1039Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_SentrySession1 = _getClass1("SentrySession"); + late final _sel_initWithSession_1 = _registerName1("initWithSession:"); + instancetype _objc_msgSend_1040( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer session, + ) { + return __objc_msgSend_1040( + obj, + sel, + session, + ); + } + + late final __objc_msgSend_1040Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1040 = __objc_msgSend_1040Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_SentryUserFeedback1 = _getClass1("SentryUserFeedback"); + late final _sel_initWithUserFeedback_1 = + _registerName1("initWithUserFeedback:"); + instancetype _objc_msgSend_1041( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer userFeedback, + ) { + return __objc_msgSend_1041( + obj, + sel, + userFeedback, + ); + } + + late final __objc_msgSend_1041Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1041 = __objc_msgSend_1041Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_SentryAttachment1 = _getClass1("SentryAttachment"); + late final _sel_initWithAttachment_maxAttachmentSize_1 = + _registerName1("initWithAttachment:maxAttachmentSize:"); + instancetype _objc_msgSend_1042( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer attachment, + int maxAttachmentSize, + ) { + return __objc_msgSend_1042( + obj, + sel, + attachment, + maxAttachmentSize, + ); + } + + late final __objc_msgSend_1042Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_1042 = __objc_msgSend_1042Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + late final _class_SentryEnvelopeItemHeader1 = + _getClass1("SentryEnvelopeItemHeader"); + late final _sel_initWithHeader_data_1 = + _registerName1("initWithHeader:data:"); + instancetype _objc_msgSend_1043( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer header, + ffi.Pointer data, + ) { + return __objc_msgSend_1043( + obj, + sel, + header, + data, + ); + } + + late final __objc_msgSend_1043Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1043 = __objc_msgSend_1043Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_header1 = _registerName1("header"); + ffi.Pointer _objc_msgSend_1044( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1044( + obj, + sel, + ); + } + + late final __objc_msgSend_1044Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1044 = __objc_msgSend_1044Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithId_singleItem_1 = + _registerName1("initWithId:singleItem:"); + instancetype _objc_msgSend_1045( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer id, + ffi.Pointer item, + ) { + return __objc_msgSend_1045( + obj, + sel, + id, + item, + ); + } + + late final __objc_msgSend_1045Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1045 = __objc_msgSend_1045Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_SentryEnvelopeHeader1 = _getClass1("SentryEnvelopeHeader"); + late final _sel_initWithId_1 = _registerName1("initWithId:"); + instancetype _objc_msgSend_1046( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer eventId, + ) { + return __objc_msgSend_1046( + obj, + sel, + eventId, + ); + } + + late final __objc_msgSend_1046Ptr = _lookup< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1046 = __objc_msgSend_1046Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_SentryTraceContext1 = _getClass1("SentryTraceContext"); + late final _sel_initWithId_traceContext_1 = + _registerName1("initWithId:traceContext:"); + instancetype _objc_msgSend_1047( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer eventId, + ffi.Pointer traceContext, + ) { + return __objc_msgSend_1047( + obj, + sel, + eventId, + traceContext, + ); + } + + late final __objc_msgSend_1047Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1047 = __objc_msgSend_1047Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_SentrySdkInfo1 = _getClass1("SentrySdkInfo"); + late final _sel_initWithId_sdkInfo_traceContext_1 = + _registerName1("initWithId:sdkInfo:traceContext:"); + instancetype _objc_msgSend_1048( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer eventId, + ffi.Pointer sdkInfo, + ffi.Pointer traceContext, + ) { + return __objc_msgSend_1048( + obj, + sel, + eventId, + sdkInfo, + traceContext, + ); + } + + late final __objc_msgSend_1048Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1048 = __objc_msgSend_1048Ptr.asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_eventId1 = _registerName1("eventId"); + late final _sel_sdkInfo1 = _registerName1("sdkInfo"); + ffi.Pointer _objc_msgSend_1049( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1049( + obj, + sel, + ); + } + + late final __objc_msgSend_1049Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1049 = __objc_msgSend_1049Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_traceContext1 = _registerName1("traceContext"); + ffi.Pointer _objc_msgSend_1050( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1050( + obj, + sel, + ); + } + + late final __objc_msgSend_1050Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1050 = __objc_msgSend_1050Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_sentAt1 = _registerName1("sentAt"); + late final _sel_setSentAt_1 = _registerName1("setSentAt:"); + late final _sel_initWithHeader_singleItem_1 = + _registerName1("initWithHeader:singleItem:"); + instancetype _objc_msgSend_1051( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer header, + ffi.Pointer item, + ) { + return __objc_msgSend_1051( + obj, + sel, + header, + item, + ); + } + + late final __objc_msgSend_1051Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1051 = __objc_msgSend_1051Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithId_items_1 = _registerName1("initWithId:items:"); + instancetype _objc_msgSend_1052( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer id, + ffi.Pointer items, + ) { + return __objc_msgSend_1052( + obj, + sel, + id, + items, + ); + } + + late final __objc_msgSend_1052Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1052 = __objc_msgSend_1052Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_initWithSessions_1 = _registerName1("initWithSessions:"); + late final _sel_initWithHeader_items_1 = + _registerName1("initWithHeader:items:"); + instancetype _objc_msgSend_1053( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer header, + ffi.Pointer items, + ) { + return __objc_msgSend_1053( + obj, + sel, + header, + items, + ); + } + + late final __objc_msgSend_1053Ptr = _lookup< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1053 = __objc_msgSend_1053Ptr.asFunction< + instancetype Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer _objc_msgSend_1054( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1054( + obj, + sel, + ); + } + + late final __objc_msgSend_1054Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1054 = __objc_msgSend_1054Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_items1 = _registerName1("items"); + late final _sel_storeEnvelope_1 = _registerName1("storeEnvelope:"); + void _objc_msgSend_1055( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer envelope, + ) { + return __objc_msgSend_1055( + obj, + sel, + envelope, + ); + } + + late final __objc_msgSend_1055Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1055 = __objc_msgSend_1055Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_captureEnvelope_1 = _registerName1("captureEnvelope:"); + late final _sel_envelopeWithData_1 = _registerName1("envelopeWithData:"); + ffi.Pointer _objc_msgSend_1056( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer data, + ) { + return __objc_msgSend_1056( + obj, + sel, + data, + ); + } + + late final __objc_msgSend_1056Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1056 = __objc_msgSend_1056Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_getDebugImages1 = _registerName1("getDebugImages"); + late final _sel_getDebugImagesCrashed_1 = + _registerName1("getDebugImagesCrashed:"); + ffi.Pointer _objc_msgSend_1057( + ffi.Pointer obj, + ffi.Pointer sel, + bool isCrash, + ) { + return __objc_msgSend_1057( + obj, + sel, + isCrash, + ); + } + + late final __objc_msgSend_1057Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>('objc_msgSend'); + late final __objc_msgSend_1057 = __objc_msgSend_1057Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, bool)>(); + + late final _sel_setSdkName_andVersionString_1 = + _registerName1("setSdkName:andVersionString:"); + late final _sel_setSdkName_1 = _registerName1("setSdkName:"); + late final _sel_getSdkName1 = _registerName1("getSdkName"); + late final _sel_getSdkVersionString1 = _registerName1("getSdkVersionString"); + late final _sel_getExtraContext1 = _registerName1("getExtraContext"); + late final _sel_startProfilerForTrace_1 = + _registerName1("startProfilerForTrace:"); + int _objc_msgSend_1058( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer traceId, + ) { + return __objc_msgSend_1058( + obj, + sel, + traceId, + ); + } + + late final __objc_msgSend_1058Ptr = _lookup< + ffi.NativeFunction< + ffi.Uint64 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1058 = __objc_msgSend_1058Ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _sel_collectProfileBetween_and_forTrace_1 = + _registerName1("collectProfileBetween:and:forTrace:"); + ffi.Pointer _objc_msgSend_1059( + ffi.Pointer obj, + ffi.Pointer sel, + int startSystemTime, + int endSystemTime, + ffi.Pointer traceId, + ) { + return __objc_msgSend_1059( + obj, + sel, + startSystemTime, + endSystemTime, + traceId, + ); + } + + late final __objc_msgSend_1059Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint64, + ffi.Uint64, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1059 = __objc_msgSend_1059Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); + + late final _sel_discardProfilerForTrace_1 = + _registerName1("discardProfilerForTrace:"); + void _objc_msgSend_1060( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer traceId, + ) { + return __objc_msgSend_1060( + obj, + sel, + traceId, + ); + } + + late final __objc_msgSend_1060Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1060 = __objc_msgSend_1060Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + late final _class_SentryAppStartMeasurement1 = + _getClass1("SentryAppStartMeasurement"); + late final _sel_onAppStartMeasurementAvailable1 = + _registerName1("onAppStartMeasurementAvailable"); + ffi.Pointer<_ObjCBlock> _objc_msgSend_1061( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1061( + obj, + sel, + ); + } + + late final __objc_msgSend_1061Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1061 = __objc_msgSend_1061Ptr.asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_setOnAppStartMeasurementAvailable_1 = + _registerName1("setOnAppStartMeasurementAvailable:"); + void _objc_msgSend_1062( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer<_ObjCBlock> value, + ) { + return __objc_msgSend_1062( + obj, + sel, + value, + ); + } + + late final __objc_msgSend_1062Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); + late final __objc_msgSend_1062 = __objc_msgSend_1062Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer<_ObjCBlock>)>(); + + late final _sel_appStartMeasurement1 = _registerName1("appStartMeasurement"); + ffi.Pointer _objc_msgSend_1063( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1063( + obj, + sel, + ); + } + + late final __objc_msgSend_1063Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1063 = __objc_msgSend_1063Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_installationID1 = _registerName1("installationID"); + late final _class_SentryOptions1 = _getClass1("SentryOptions"); + ffi.Pointer _objc_msgSend_1064( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_1064( + obj, + sel, + ); + } + + late final __objc_msgSend_1064Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1064 = __objc_msgSend_1064Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + late final _sel_appStartMeasurementHybridSDKMode1 = + _registerName1("appStartMeasurementHybridSDKMode"); + late final _sel_setAppStartMeasurementHybridSDKMode_1 = + _registerName1("setAppStartMeasurementHybridSDKMode:"); + late final _class_SentryUser1 = _getClass1("SentryUser"); + late final _sel_userWithDictionary_1 = _registerName1("userWithDictionary:"); + ffi.Pointer _objc_msgSend_1065( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dictionary, + ) { + return __objc_msgSend_1065( + obj, + sel, + dictionary, + ); + } + + late final __objc_msgSend_1065Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1065 = __objc_msgSend_1065Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + + late final _class_SentryBreadcrumb1 = _getClass1("SentryBreadcrumb"); + late final _sel_breadcrumbWithDictionary_1 = + _registerName1("breadcrumbWithDictionary:"); + ffi.Pointer _objc_msgSend_1066( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dictionary, + ) { + return __objc_msgSend_1066( + obj, + sel, + dictionary, + ); + } + + late final __objc_msgSend_1066Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_1066 = __objc_msgSend_1066Ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +} + +class _ObjCWrapper implements ffi.Finalizable { + final ffi.Pointer _id; + final SentryCocoa _lib; + bool _pendingRelease; + + _ObjCWrapper._(this._id, this._lib, + {bool retain = false, bool release = false}) + : _pendingRelease = release { + if (retain) { + _lib._objc_retain(_id.cast()); + } + if (release) { + _lib._objc_releaseFinalizer2.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC object held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib._objc_release(_id.cast()); + _lib._objc_releaseFinalizer2.detach(this); + } else { + throw StateError( + 'Released an ObjC object that was unowned or already released.'); + } + } + + @override + bool operator ==(Object other) { + return other is _ObjCWrapper && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; + + /// Return a pointer to this object. + ffi.Pointer get pointer => _id; +} + +class NSObject extends _ObjCWrapper { + NSObject._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSObject] that points to the same underlying object as [other]. + static NSObject castFrom(T other) { + return NSObject._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSObject] that wraps the given raw object pointer. + static NSObject castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSObject._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSObject]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSObject1); + } + + static void load(SentryCocoa _lib) { + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_load1); + } + + static void initialize(SentryCocoa _lib) { + _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_initialize1); + } + + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_new1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + void dealloc() { + _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_1(_id, _lib._sel_finalize1); + } + + NSObject copy() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_copy1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject mutableCopy() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_mutableCopy1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject copyWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_copyWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject mutableCopyWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSObject1, _lib._sel_mutableCopyWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool instancesRespondToSelector_( + SentryCocoa _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSObject1, + _lib._sel_instancesRespondToSelector_1, aSelector); + } + + static bool conformsToProtocol_(SentryCocoa _lib, Protocol? protocol) { + return _lib._objc_msgSend_5(_lib._class_NSObject1, + _lib._sel_conformsToProtocol_1, protocol?._id ?? ffi.nullptr); + } + + ffi.Pointer> methodForSelector_( + ffi.Pointer aSelector) { + return _lib._objc_msgSend_6(_id, _lib._sel_methodForSelector_1, aSelector); + } + + static ffi.Pointer> + instanceMethodForSelector_( + SentryCocoa _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_6(_lib._class_NSObject1, + _lib._sel_instanceMethodForSelector_1, aSelector); + } + + void doesNotRecognizeSelector_(ffi.Pointer aSelector) { + _lib._objc_msgSend_7(_id, _lib._sel_doesNotRecognizeSelector_1, aSelector); + } + + NSObject forwardingTargetForSelector_(ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_8( + _id, _lib._sel_forwardingTargetForSelector_1, aSelector); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void forwardInvocation_(NSInvocation? anInvocation) { + _lib._objc_msgSend_392( + _id, _lib._sel_forwardInvocation_1, anInvocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector_( + ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_393( + _id, _lib._sel_methodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + static NSMethodSignature instanceMethodSignatureForSelector_( + SentryCocoa _lib, ffi.Pointer aSelector) { + final _ret = _lib._objc_msgSend_393(_lib._class_NSObject1, + _lib._sel_instanceMethodSignatureForSelector_1, aSelector); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); + } + + static bool isSubclassOfClass_(SentryCocoa _lib, NSObject aClass) { + return _lib._objc_msgSend_0( + _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); + } + + static bool resolveClassMethod_(SentryCocoa _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); + } + + static bool resolveInstanceMethod_( + SentryCocoa _lib, ffi.Pointer sel) { + return _lib._objc_msgSend_4( + _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); + } + + static int hash(SentryCocoa _lib) { + return _lib._objc_msgSend_10(_lib._class_NSObject1, _lib._sel_hash1); + } + + static NSObject superclass(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_superclass1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject class1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_class1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString description(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_20(_lib._class_NSObject1, _lib._sel_description1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString debugDescription(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_NSObject1, _lib._sel_debugDescription1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int version(SentryCocoa _lib) { + return _lib._objc_msgSend_78(_lib._class_NSObject1, _lib._sel_version1); + } + + static void setVersion_(SentryCocoa _lib, int aVersion) { + _lib._objc_msgSend_394( + _lib._class_NSObject1, _lib._sel_setVersion_1, aVersion); + } + + NSObject get classForCoder { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForCoder1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_replacementObjectForCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject awakeAfterUsingCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_awakeAfterUsingCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static void poseAsClass_(SentryCocoa _lib, NSObject aClass) { + _lib._objc_msgSend_15( + _lib._class_NSObject1, _lib._sel_poseAsClass_1, aClass._id); + } + + NSObject get autoContentAccessingProxy { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_autoContentAccessingProxy1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void + attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_( + NSError? error, + int recoveryOptionIndex, + NSObject delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo) { + _lib._objc_msgSend_395( + _id, + _lib._sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1, + error?._id ?? ffi.nullptr, + recoveryOptionIndex, + delegate._id, + didRecoverSelector, + contextInfo); + } + + bool attemptRecoveryFromError_optionIndex_( + NSError? error, int recoveryOptionIndex) { + return _lib._objc_msgSend_396( + _id, + _lib._sel_attemptRecoveryFromError_optionIndex_1, + error?._id ?? ffi.nullptr, + recoveryOptionIndex); + } + + void performSelector_withObject_afterDelay_inModes_( + ffi.Pointer aSelector, + NSObject anArgument, + double delay, + NSArray? modes) { + _lib._objc_msgSend_397( + _id, + _lib._sel_performSelector_withObject_afterDelay_inModes_1, + aSelector, + anArgument._id, + delay, + modes?._id ?? ffi.nullptr); + } + + void performSelector_withObject_afterDelay_( + ffi.Pointer aSelector, NSObject anArgument, double delay) { + _lib._objc_msgSend_398( + _id, + _lib._sel_performSelector_withObject_afterDelay_1, + aSelector, + anArgument._id, + delay); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSObject1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSObject1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + void URL_resourceDataDidBecomeAvailable_(NSURL? sender, NSData? newBytes) { + _lib._objc_msgSend_399(_id, _lib._sel_URL_resourceDataDidBecomeAvailable_1, + sender?._id ?? ffi.nullptr, newBytes?._id ?? ffi.nullptr); + } + + void URLResourceDidFinishLoading_(NSURL? sender) { + _lib._objc_msgSend_400(_id, _lib._sel_URLResourceDidFinishLoading_1, + sender?._id ?? ffi.nullptr); + } + + void URLResourceDidCancelLoading_(NSURL? sender) { + _lib._objc_msgSend_400(_id, _lib._sel_URLResourceDidCancelLoading_1, + sender?._id ?? ffi.nullptr); + } + + void URL_resourceDidFailLoadingWithReason_(NSURL? sender, NSString? reason) { + _lib._objc_msgSend_401( + _id, + _lib._sel_URL_resourceDidFailLoadingWithReason_1, + sender?._id ?? ffi.nullptr, + reason?._id ?? ffi.nullptr); + } + + bool fileManager_shouldProceedAfterError_( + NSFileManager? fm, NSDictionary? errorInfo) { + return _lib._objc_msgSend_436( + _id, + _lib._sel_fileManager_shouldProceedAfterError_1, + fm?._id ?? ffi.nullptr, + errorInfo?._id ?? ffi.nullptr); + } + + void fileManager_willProcessPath_(NSFileManager? fm, NSString? path) { + _lib._objc_msgSend_437(_id, _lib._sel_fileManager_willProcessPath_1, + fm?._id ?? ffi.nullptr, path?._id ?? ffi.nullptr); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSObject1, _lib._sel_accessInstanceVariablesDirectly1); + } + + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + bool validateValue_forKey_error_(ffi.Pointer> ioValue, + NSString? inKey, ffi.Pointer> outError) { + return _lib._objc_msgSend_226(_id, _lib._sel_validateValue_forKey_error_1, + ioValue, inKey?._id ?? ffi.nullptr, outError); + } + + NSMutableArray mutableArrayValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_454( + _id, _lib._sel_mutableArrayValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet mutableOrderedSetValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_473( + _id, _lib._sel_mutableOrderedSetValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet mutableSetValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_474( + _id, _lib._sel_mutableSetValueForKey_1, key?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSObject valueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKeyPath_(NSObject value, NSString? keyPath) { + _lib._objc_msgSend_126(_id, _lib._sel_setValue_forKeyPath_1, value._id, + keyPath?._id ?? ffi.nullptr); + } + + bool validateValue_forKeyPath_error_( + ffi.Pointer> ioValue, + NSString? inKeyPath, + ffi.Pointer> outError) { + return _lib._objc_msgSend_226( + _id, + _lib._sel_validateValue_forKeyPath_error_1, + ioValue, + inKeyPath?._id ?? ffi.nullptr, + outError); + } + + NSMutableArray mutableArrayValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_454(_id, + _lib._sel_mutableArrayValueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet mutableOrderedSetValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_473( + _id, + _lib._sel_mutableOrderedSetValueForKeyPath_1, + keyPath?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet mutableSetValueForKeyPath_(NSString? keyPath) { + final _ret = _lib._objc_msgSend_474(_id, + _lib._sel_mutableSetValueForKeyPath_1, keyPath?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSObject valueForUndefinedKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForUndefinedKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setValue_forUndefinedKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_setValue_forUndefinedKey_1, value._id, + key?._id ?? ffi.nullptr); + } + + void setNilValueForKey_(NSString? key) { + _lib._objc_msgSend_192( + _id, _lib._sel_setNilValueForKey_1, key?._id ?? ffi.nullptr); + } + + NSDictionary dictionaryWithValuesForKeys_(NSArray? keys) { + final _ret = _lib._objc_msgSend_475( + _id, _lib._sel_dictionaryWithValuesForKeys_1, keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void setValuesForKeysWithDictionary_(NSDictionary? keyedValues) { + _lib._objc_msgSend_476(_id, _lib._sel_setValuesForKeysWithDictionary_1, + keyedValues?._id ?? ffi.nullptr); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSObject1, _lib._sel_useStoredAccessor1); + } + + NSObject storedValueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_storedValueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void takeStoredValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_takeStoredValue_forKey_1, value._id, + key?._id ?? ffi.nullptr); + } + + void takeValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126( + _id, _lib._sel_takeValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + void takeValue_forKeyPath_(NSObject value, NSString? keyPath) { + _lib._objc_msgSend_126(_id, _lib._sel_takeValue_forKeyPath_1, value._id, + keyPath?._id ?? ffi.nullptr); + } + + NSObject handleQueryWithUnboundKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_handleQueryWithUnboundKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void handleTakeValue_forUnboundKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_handleTakeValue_forUnboundKey_1, + value._id, key?._id ?? ffi.nullptr); + } + + void unableToSetNilForKey_(NSString? key) { + _lib._objc_msgSend_192( + _id, _lib._sel_unableToSetNilForKey_1, key?._id ?? ffi.nullptr); + } + + NSDictionary valuesForKeys_(NSArray? keys) { + final _ret = _lib._objc_msgSend_475( + _id, _lib._sel_valuesForKeys_1, keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void takeValuesFromDictionary_(NSDictionary? properties) { + _lib._objc_msgSend_476(_id, _lib._sel_takeValuesFromDictionary_1, + properties?._id ?? ffi.nullptr); + } + + void observeValueForKeyPath_ofObject_change_context_(NSString? keyPath, + NSObject object, NSDictionary? change, ffi.Pointer context) { + _lib._objc_msgSend_477( + _id, + _lib._sel_observeValueForKeyPath_ofObject_change_context_1, + keyPath?._id ?? ffi.nullptr, + object._id, + change?._id ?? ffi.nullptr, + context); + } + + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + _lib._objc_msgSend_130( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + _lib._objc_msgSend_131(_id, _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr, context); + } + + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + _lib._objc_msgSend_132(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + void willChangeValueForKey_(NSString? key) { + _lib._objc_msgSend_192( + _id, _lib._sel_willChangeValueForKey_1, key?._id ?? ffi.nullptr); + } + + void didChangeValueForKey_(NSString? key) { + _lib._objc_msgSend_192( + _id, _lib._sel_didChangeValueForKey_1, key?._id ?? ffi.nullptr); + } + + void willChange_valuesAtIndexes_forKey_( + int changeKind, NSIndexSet? indexes, NSString? key) { + _lib._objc_msgSend_478(_id, _lib._sel_willChange_valuesAtIndexes_forKey_1, + changeKind, indexes?._id ?? ffi.nullptr, key?._id ?? ffi.nullptr); + } + + void didChange_valuesAtIndexes_forKey_( + int changeKind, NSIndexSet? indexes, NSString? key) { + _lib._objc_msgSend_478(_id, _lib._sel_didChange_valuesAtIndexes_forKey_1, + changeKind, indexes?._id ?? ffi.nullptr, key?._id ?? ffi.nullptr); + } + + void willChangeValueForKey_withSetMutation_usingObjects_( + NSString? key, int mutationKind, NSSet? objects) { + _lib._objc_msgSend_479( + _id, + _lib._sel_willChangeValueForKey_withSetMutation_usingObjects_1, + key?._id ?? ffi.nullptr, + mutationKind, + objects?._id ?? ffi.nullptr); + } + + void didChangeValueForKey_withSetMutation_usingObjects_( + NSString? key, int mutationKind, NSSet? objects) { + _lib._objc_msgSend_479( + _id, + _lib._sel_didChangeValueForKey_withSetMutation_usingObjects_1, + key?._id ?? ffi.nullptr, + mutationKind, + objects?._id ?? ffi.nullptr); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSObject1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSObject1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + ffi.Pointer get observationInfo { + return _lib._objc_msgSend_19(_id, _lib._sel_observationInfo1); + } + + set observationInfo(ffi.Pointer value) { + return _lib._objc_msgSend_480(_id, _lib._sel_setObservationInfo_1, value); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSObject1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + NSObject get classForKeyedArchiver { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForKeyedArchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForKeyedArchiver_(NSKeyedArchiver? archiver) { + final _ret = _lib._objc_msgSend_493( + _id, + _lib._sel_replacementObjectForKeyedArchiver_1, + archiver?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSObject1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSObject1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void performSelectorOnMainThread_withObject_waitUntilDone_modes_( + ffi.Pointer aSelector, NSObject arg, bool wait, NSArray? array) { + _lib._objc_msgSend_494( + _id, + _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_modes_1, + aSelector, + arg._id, + wait, + array?._id ?? ffi.nullptr); + } + + void performSelectorOnMainThread_withObject_waitUntilDone_( + ffi.Pointer aSelector, NSObject arg, bool wait) { + _lib._objc_msgSend_495( + _id, + _lib._sel_performSelectorOnMainThread_withObject_waitUntilDone_1, + aSelector, + arg._id, + wait); + } + + void performSelector_onThread_withObject_waitUntilDone_modes_( + ffi.Pointer aSelector, + NSThread? thr, + NSObject arg, + bool wait, + NSArray? array) { + _lib._objc_msgSend_512( + _id, + _lib._sel_performSelector_onThread_withObject_waitUntilDone_modes_1, + aSelector, + thr?._id ?? ffi.nullptr, + arg._id, + wait, + array?._id ?? ffi.nullptr); + } + + void performSelector_onThread_withObject_waitUntilDone_( + ffi.Pointer aSelector, NSThread? thr, NSObject arg, bool wait) { + _lib._objc_msgSend_513( + _id, + _lib._sel_performSelector_onThread_withObject_waitUntilDone_1, + aSelector, + thr?._id ?? ffi.nullptr, + arg._id, + wait); + } + + void performSelectorInBackground_withObject_( + ffi.Pointer aSelector, NSObject arg) { + _lib._objc_msgSend_84(_id, + _lib._sel_performSelectorInBackground_withObject_1, aSelector, arg._id); + } + + NSObject get classForArchiver { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForArchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForArchiver_(NSArchiver? archiver) { + final _ret = _lib._objc_msgSend_516(_id, + _lib._sel_replacementObjectForArchiver_1, archiver?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get classForPortCoder { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_classForPortCoder1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject replacementObjectForPortCoder_(NSPortCoder? coder) { + final _ret = _lib._objc_msgSend_554(_id, + _lib._sel_replacementObjectForPortCoder_1, coder?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSClassDescription? get classDescription { + final _ret = _lib._objc_msgSend_557(_id, _lib._sel_classDescription1); + return _ret.address == 0 + ? null + : NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSArray? get attributeKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_attributeKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get toOneRelationshipKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_toOneRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get toManyRelationshipKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_toManyRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString inverseForRelationshipKey_(NSString? relationshipKey) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_inverseForRelationshipKey_1, + relationshipKey?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject scriptingValueForSpecifier_( + NSScriptObjectSpecifier? objectSpecifier) { + final _ret = _lib._objc_msgSend_601( + _id, + _lib._sel_scriptingValueForSpecifier_1, + objectSpecifier?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get scriptingProperties { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_scriptingProperties1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set scriptingProperties(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setScriptingProperties_1, value?._id ?? ffi.nullptr); + } + + NSObject copyScriptingValue_forKey_withProperties_( + NSObject value, NSString? key, NSDictionary? properties) { + final _ret = _lib._objc_msgSend_602( + _id, + _lib._sel_copyScriptingValue_forKey_withProperties_1, + value._id, + key?._id ?? ffi.nullptr, + properties?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject + newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_( + NSObject objectClass, + NSString? key, + NSObject contentsValue, + NSDictionary? properties) { + final _ret = _lib._objc_msgSend_603( + _id, + _lib._sel_newScriptingObjectOfClass_forValueForKey_withContentsValue_properties_1, + objectClass._id, + key?._id ?? ffi.nullptr, + contentsValue._id, + properties?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + int get classCode { + return _lib._objc_msgSend_197(_id, _lib._sel_classCode1); + } + + NSString? get className { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_className1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject valueAtIndex_inPropertyWithKey_(int index, NSString? key) { + final _ret = _lib._objc_msgSend_604( + _id, + _lib._sel_valueAtIndex_inPropertyWithKey_1, + index, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject valueWithName_inPropertyWithKey_(NSString? name, NSString? key) { + final _ret = _lib._objc_msgSend_165( + _id, + _lib._sel_valueWithName_inPropertyWithKey_1, + name?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject valueWithUniqueID_inPropertyWithKey_( + NSObject uniqueID, NSString? key) { + final _ret = _lib._objc_msgSend_287( + _id, + _lib._sel_valueWithUniqueID_inPropertyWithKey_1, + uniqueID._id, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void insertValue_atIndex_inPropertyWithKey_( + NSObject value, int index, NSString? key) { + _lib._objc_msgSend_605( + _id, + _lib._sel_insertValue_atIndex_inPropertyWithKey_1, + value._id, + index, + key?._id ?? ffi.nullptr); + } + + void removeValueAtIndex_fromPropertyWithKey_(int index, NSString? key) { + _lib._objc_msgSend_606( + _id, + _lib._sel_removeValueAtIndex_fromPropertyWithKey_1, + index, + key?._id ?? ffi.nullptr); + } + + void replaceValueAtIndex_inPropertyWithKey_withValue_( + int index, NSString? key, NSObject value) { + _lib._objc_msgSend_607( + _id, + _lib._sel_replaceValueAtIndex_inPropertyWithKey_withValue_1, + index, + key?._id ?? ffi.nullptr, + value._id); + } + + void insertValue_inPropertyWithKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_insertValue_inPropertyWithKey_1, + value._id, key?._id ?? ffi.nullptr); + } + + NSObject coerceValue_forKey_(NSObject value, NSString? key) { + final _ret = _lib._objc_msgSend_287(_id, _lib._sel_coerceValue_forKey_1, + value._id, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier? get objectSpecifier { + final _ret = _lib._objc_msgSend_588(_id, _lib._sel_objectSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSArray indicesOfObjectsByEvaluatingObjectSpecifier_( + NSScriptObjectSpecifier? specifier) { + final _ret = _lib._objc_msgSend_608( + _id, + _lib._sel_indicesOfObjectsByEvaluatingObjectSpecifier_1, + specifier?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool isEqualTo_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isEqualTo_1, object._id); + } + + bool isLessThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_isLessThanOrEqualTo_1, object._id); + } + + bool isLessThan_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isLessThan_1, object._id); + } + + bool isGreaterThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_isGreaterThanOrEqualTo_1, object._id); + } + + bool isGreaterThan_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isGreaterThan_1, object._id); + } + + bool isNotEqualTo_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_isNotEqualTo_1, object._id); + } + + bool doesContain_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_doesContain_1, object._id); + } + + bool isLike_(NSString? object) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isLike_1, object?._id ?? ffi.nullptr); + } + + bool isCaseInsensitiveLike_(NSString? object) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isCaseInsensitiveLike_1, object?._id ?? ffi.nullptr); + } + + bool scriptingIsEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsEqualTo_1, object._id); + } + + bool scriptingIsLessThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsLessThanOrEqualTo_1, object._id); + } + + bool scriptingIsLessThan_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsLessThan_1, object._id); + } + + bool scriptingIsGreaterThanOrEqualTo_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsGreaterThanOrEqualTo_1, object._id); + } + + bool scriptingIsGreaterThan_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingIsGreaterThan_1, object._id); + } + + bool scriptingBeginsWith_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_scriptingBeginsWith_1, object._id); + } + + bool scriptingEndsWith_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_scriptingEndsWith_1, object._id); + } + + bool scriptingContains_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_scriptingContains_1, object._id); + } +} + +class ObjCSel extends ffi.Opaque {} + +class ObjCObject extends ffi.Opaque {} + +typedef instancetype = ffi.Pointer; + +class _NSZone extends ffi.Opaque {} + +class Protocol extends _ObjCWrapper { + Protocol._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [Protocol] that points to the same underlying object as [other]. + static Protocol castFrom(T other) { + return Protocol._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [Protocol] that wraps the given raw object pointer. + static Protocol castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return Protocol._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [Protocol]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_Protocol1); + } +} + +class NSInvocation extends NSObject { + NSInvocation._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInvocation] that points to the same underlying object as [other]. + static NSInvocation castFrom(T other) { + return NSInvocation._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSInvocation] that wraps the given raw object pointer. + static NSInvocation castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInvocation._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInvocation]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInvocation1); + } + + static NSInvocation invocationWithMethodSignature_( + SentryCocoa _lib, NSMethodSignature? sig) { + final _ret = _lib._objc_msgSend_385(_lib._class_NSInvocation1, + _lib._sel_invocationWithMethodSignature_1, sig?._id ?? ffi.nullptr); + return NSInvocation._(_ret, _lib, retain: true, release: true); + } + + NSMethodSignature? get methodSignature { + final _ret = _lib._objc_msgSend_386(_id, _lib._sel_methodSignature1); + return _ret.address == 0 + ? null + : NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + void retainArguments() { + _lib._objc_msgSend_1(_id, _lib._sel_retainArguments1); + } + + bool get argumentsRetained { + return _lib._objc_msgSend_12(_id, _lib._sel_argumentsRetained1); + } + + NSObject get target { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_target1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set target(NSObject value) { + return _lib._objc_msgSend_387(_id, _lib._sel_setTarget_1, value._id); + } + + ffi.Pointer get selector { + return _lib._objc_msgSend_388(_id, _lib._sel_selector1); + } + + set selector(ffi.Pointer value) { + return _lib._objc_msgSend_389(_id, _lib._sel_setSelector_1, value); + } + + void getReturnValue_(ffi.Pointer retLoc) { + _lib._objc_msgSend_47(_id, _lib._sel_getReturnValue_1, retLoc); + } + + void setReturnValue_(ffi.Pointer retLoc) { + _lib._objc_msgSend_47(_id, _lib._sel_setReturnValue_1, retLoc); + } + + void getArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { + _lib._objc_msgSend_390( + _id, _lib._sel_getArgument_atIndex_1, argumentLocation, idx); + } + + void setArgument_atIndex_(ffi.Pointer argumentLocation, int idx) { + _lib._objc_msgSend_390( + _id, _lib._sel_setArgument_atIndex_1, argumentLocation, idx); + } + + void invoke() { + _lib._objc_msgSend_1(_id, _lib._sel_invoke1); + } + + void invokeWithTarget_(NSObject target) { + _lib._objc_msgSend_15(_id, _lib._sel_invokeWithTarget_1, target._id); + } + + void invokeUsingIMP_( + ffi.Pointer> imp) { + _lib._objc_msgSend_391(_id, _lib._sel_invokeUsingIMP_1, imp); + } + + @override + NSInvocation init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSInvocation._(_ret, _lib, retain: true, release: true); + } + + static NSInvocation new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_new1); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static NSInvocation allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSInvocation1, _lib._sel_allocWithZone_1, zone); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static NSInvocation alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInvocation1, _lib._sel_alloc1); + return NSInvocation._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSInvocation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSInvocation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInvocation1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInvocation1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInvocation1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInvocation1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSInvocation1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSInvocation1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInvocation1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMethodSignature extends NSObject { + NSMethodSignature._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMethodSignature] that points to the same underlying object as [other]. + static NSMethodSignature castFrom(T other) { + return NSMethodSignature._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMethodSignature] that wraps the given raw object pointer. + static NSMethodSignature castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMethodSignature._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMethodSignature]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMethodSignature1); + } + + static NSMethodSignature signatureWithObjCTypes_( + SentryCocoa _lib, ffi.Pointer types) { + final _ret = _lib._objc_msgSend_9(_lib._class_NSMethodSignature1, + _lib._sel_signatureWithObjCTypes_1, types); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + int get numberOfArguments { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfArguments1); + } + + ffi.Pointer getArgumentTypeAtIndex_(int idx) { + return _lib._objc_msgSend_11(_id, _lib._sel_getArgumentTypeAtIndex_1, idx); + } + + int get frameLength { + return _lib._objc_msgSend_10(_id, _lib._sel_frameLength1); + } + + bool isOneway() { + return _lib._objc_msgSend_12(_id, _lib._sel_isOneway1); + } + + ffi.Pointer get methodReturnType { + return _lib._objc_msgSend_13(_id, _lib._sel_methodReturnType1); + } + + int get methodReturnLength { + return _lib._objc_msgSend_10(_id, _lib._sel_methodReturnLength1); + } + + @override + NSMethodSignature init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + static NSMethodSignature new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_new1); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static NSMethodSignature allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMethodSignature1, _lib._sel_allocWithZone_1, zone); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static NSMethodSignature alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMethodSignature1, _lib._sel_alloc1); + return NSMethodSignature._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMethodSignature1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMethodSignature1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMethodSignature1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMethodSignature1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMethodSignature1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMethodSignature1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMethodSignature1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMethodSignature1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMethodSignature1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSSet extends NSObject { + NSSet._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSSet] that points to the same underlying object as [other]. + static NSSet castFrom(T other) { + return NSSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSSet] that wraps the given raw object pointer. + static NSSet castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSSet1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject member_(NSObject object) { + final _ret = _lib._objc_msgSend_16(_id, _lib._sel_member_1, object._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + @override + NSSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allObjects { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject anyObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_anyObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool containsObject_(NSObject anObject) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool intersectsSet_(NSSet? otherSet) { + return _lib._objc_msgSend_374( + _id, _lib._sel_intersectsSet_1, otherSet?._id ?? ffi.nullptr); + } + + bool isEqualToSet_(NSSet? otherSet) { + return _lib._objc_msgSend_374( + _id, _lib._sel_isEqualToSet_1, otherSet?._id ?? ffi.nullptr); + } + + bool isSubsetOfSet_(NSSet? otherSet) { + return _lib._objc_msgSend_374( + _id, _lib._sel_isSubsetOfSet_1, otherSet?._id ?? ffi.nullptr); + } + + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + _lib._objc_msgSend_7( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, NSObject argument) { + _lib._objc_msgSend_84( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSSet setByAddingObject_(NSObject anObject) { + final _ret = _lib._objc_msgSend_375( + _id, _lib._sel_setByAddingObject_1, anObject._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet setByAddingObjectsFromSet_(NSSet? other) { + final _ret = _lib._objc_msgSend_376( + _id, _lib._sel_setByAddingObjectsFromSet_1, other?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet setByAddingObjectsFromArray_(NSArray? other) { + final _ret = _lib._objc_msgSend_377(_id, + _lib._sel_setByAddingObjectsFromArray_1, other?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_(ObjCBlock_ffiVoid_ObjCObject_bool block) { + _lib._objc_msgSend_378( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock_( + int opts, ObjCBlock_ffiVoid_ObjCObject_bool block) { + _lib._objc_msgSend_379(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + NSSet objectsPassingTest_(ObjCBlock_bool_ObjCObject_bool predicate) { + final _ret = _lib._objc_msgSend_380( + _id, _lib._sel_objectsPassingTest_1, predicate._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet objectsWithOptions_passingTest_( + int opts, ObjCBlock_bool_ObjCObject_bool predicate) { + final _ret = _lib._objc_msgSend_381( + _id, _lib._sel_objectsWithOptions_passingTest_1, opts, predicate._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet set1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_set1); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObject_(SentryCocoa _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSSet1, _lib._sel_setWithObject_1, object._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObjects_count_( + SentryCocoa _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _lib._class_NSSet1, _lib._sel_setWithObjects_count_1, objects, cnt); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithObjects_(SentryCocoa _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSSet1, _lib._sel_setWithObjects_1, firstObj._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithSet_(SentryCocoa _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_382( + _lib._class_NSSet1, _lib._sel_setWithSet_1, set?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet setWithArray_(SentryCocoa _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSSet1, + _lib._sel_setWithArray_1, array?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_382( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + NSSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_383( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + NSSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + _lib._objc_msgSend_130( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + _lib._objc_msgSend_131(_id, _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr, context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + _lib._objc_msgSend_132(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSSet filteredSetUsingPredicate_(NSPredicate? predicate) { + final _ret = _lib._objc_msgSend_384(_id, + _lib._sel_filteredSetUsingPredicate_1, predicate?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static NSSet new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_new1); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static NSSet allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSSet1, _lib._sel_allocWithZone_1, zone); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static NSSet alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSSet1, _lib._sel_alloc1); + return NSSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSEnumerator extends NSObject { + NSEnumerator._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSEnumerator] that points to the same underlying object as [other]. + static NSEnumerator castFrom(T other) { + return NSEnumerator._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSEnumerator] that wraps the given raw object pointer. + static NSEnumerator castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSEnumerator._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSEnumerator]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSEnumerator1); + } + + NSObject nextObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_nextObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject? get allObjects { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSEnumerator init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + static NSEnumerator new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_new1); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static NSEnumerator allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSEnumerator1, _lib._sel_allocWithZone_1, zone); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static NSEnumerator alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_alloc1); + return NSEnumerator._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSEnumerator1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSEnumerator1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSEnumerator1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSEnumerator1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSEnumerator1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSEnumerator1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSEnumerator1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSEnumerator1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSEnumerator1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSString extends NSObject { + NSString._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSString] that points to the same underlying object as [other]. + static NSString castFrom(T other) { + return NSString._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSString] that wraps the given raw object pointer. + static NSString castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSString1); + } + + factory NSString(SentryCocoa _lib, String str) { + final cstr = str.toNativeUtf16(); + final nsstr = stringWithCharacters_length_(_lib, cstr.cast(), str.length); + pkg_ffi.calloc.free(cstr); + return nsstr; + } + + @override + String toString() { + final data = + dataUsingEncoding_(0x94000100 /* NSUTF16LittleEndianStringEncoding */); + return data.bytes.cast().toDartString(length: length); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + int characterAtIndex_(int index) { + return _lib._objc_msgSend_17(_id, _lib._sel_characterAtIndex_1, index); + } + + @override + NSString init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringFromIndex_(int from) { + final _ret = + _lib._objc_msgSend_308(_id, _lib._sel_substringFromIndex_1, from); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringToIndex_(int to) { + final _ret = _lib._objc_msgSend_308(_id, _lib._sel_substringToIndex_1, to); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString substringWithRange_(_NSRange range) { + final _ret = + _lib._objc_msgSend_309(_id, _lib._sel_substringWithRange_1, range); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void getCharacters_range_( + ffi.Pointer buffer, _NSRange range) { + _lib._objc_msgSend_310(_id, _lib._sel_getCharacters_range_1, buffer, range); + } + + int compare_(NSString? string) { + return _lib._objc_msgSend_311( + _id, _lib._sel_compare_1, string?._id ?? ffi.nullptr); + } + + int compare_options_(NSString? string, int mask) { + return _lib._objc_msgSend_312( + _id, _lib._sel_compare_options_1, string?._id ?? ffi.nullptr, mask); + } + + int compare_options_range_( + NSString? string, int mask, _NSRange rangeOfReceiverToCompare) { + return _lib._objc_msgSend_313(_id, _lib._sel_compare_options_range_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare); + } + + int compare_options_range_locale_(NSString? string, int mask, + _NSRange rangeOfReceiverToCompare, NSObject locale) { + return _lib._objc_msgSend_314(_id, _lib._sel_compare_options_range_locale_1, + string?._id ?? ffi.nullptr, mask, rangeOfReceiverToCompare, locale._id); + } + + int caseInsensitiveCompare_(NSString? string) { + return _lib._objc_msgSend_311( + _id, _lib._sel_caseInsensitiveCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCompare_(NSString? string) { + return _lib._objc_msgSend_311( + _id, _lib._sel_localizedCompare_1, string?._id ?? ffi.nullptr); + } + + int localizedCaseInsensitiveCompare_(NSString? string) { + return _lib._objc_msgSend_311( + _id, + _lib._sel_localizedCaseInsensitiveCompare_1, + string?._id ?? ffi.nullptr); + } + + int localizedStandardCompare_(NSString? string) { + return _lib._objc_msgSend_311( + _id, _lib._sel_localizedStandardCompare_1, string?._id ?? ffi.nullptr); + } + + bool isEqualToString_(NSString? aString) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isEqualToString_1, aString?._id ?? ffi.nullptr); + } + + bool hasPrefix_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasPrefix_1, str?._id ?? ffi.nullptr); + } + + bool hasSuffix_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasSuffix_1, str?._id ?? ffi.nullptr); + } + + NSString commonPrefixWithString_options_(NSString? str, int mask) { + final _ret = _lib._objc_msgSend_315( + _id, + _lib._sel_commonPrefixWithString_options_1, + str?._id ?? ffi.nullptr, + mask); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool containsString_(NSString? str) { + return _lib._objc_msgSend_59( + _id, _lib._sel_containsString_1, str?._id ?? ffi.nullptr); + } + + bool localizedCaseInsensitiveContainsString_(NSString? str) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_localizedCaseInsensitiveContainsString_1, + str?._id ?? ffi.nullptr); + } + + bool localizedStandardContainsString_(NSString? str) { + return _lib._objc_msgSend_59(_id, + _lib._sel_localizedStandardContainsString_1, str?._id ?? ffi.nullptr); + } + + void localizedStandardRangeOfString_( + ffi.Pointer<_NSRange> stret, NSString? str) { + _lib._objc_msgSend_316(stret, _id, + _lib._sel_localizedStandardRangeOfString_1, str?._id ?? ffi.nullptr); + } + + void rangeOfString_(ffi.Pointer<_NSRange> stret, NSString? searchString) { + _lib._objc_msgSend_316(stret, _id, _lib._sel_rangeOfString_1, + searchString?._id ?? ffi.nullptr); + } + + void rangeOfString_options_( + ffi.Pointer<_NSRange> stret, NSString? searchString, int mask) { + _lib._objc_msgSend_317(stret, _id, _lib._sel_rangeOfString_options_1, + searchString?._id ?? ffi.nullptr, mask); + } + + void rangeOfString_options_range_(ffi.Pointer<_NSRange> stret, + NSString? searchString, int mask, _NSRange rangeOfReceiverToSearch) { + _lib._objc_msgSend_318(stret, _id, _lib._sel_rangeOfString_options_range_1, + searchString?._id ?? ffi.nullptr, mask, rangeOfReceiverToSearch); + } + + void rangeOfString_options_range_locale_( + ffi.Pointer<_NSRange> stret, + NSString? searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + NSLocale? locale) { + _lib._objc_msgSend_319( + stret, + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); + } + + void rangeOfCharacterFromSet_( + ffi.Pointer<_NSRange> stret, NSCharacterSet? searchSet) { + _lib._objc_msgSend_320(stret, _id, _lib._sel_rangeOfCharacterFromSet_1, + searchSet?._id ?? ffi.nullptr); + } + + void rangeOfCharacterFromSet_options_( + ffi.Pointer<_NSRange> stret, NSCharacterSet? searchSet, int mask) { + _lib._objc_msgSend_321( + stret, + _id, + _lib._sel_rangeOfCharacterFromSet_options_1, + searchSet?._id ?? ffi.nullptr, + mask); + } + + void rangeOfCharacterFromSet_options_range_(ffi.Pointer<_NSRange> stret, + NSCharacterSet? searchSet, int mask, _NSRange rangeOfReceiverToSearch) { + _lib._objc_msgSend_322( + stret, + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet?._id ?? ffi.nullptr, + mask, + rangeOfReceiverToSearch); + } + + void rangeOfComposedCharacterSequenceAtIndex_( + ffi.Pointer<_NSRange> stret, int index) { + _lib._objc_msgSend_323( + stret, _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + } + + void rangeOfComposedCharacterSequencesForRange_( + ffi.Pointer<_NSRange> stret, _NSRange range) { + _lib._objc_msgSend_324(stret, _id, + _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + } + + NSString stringByAppendingString_(NSString? aString) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_stringByAppendingString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_stringByAppendingFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + double get doubleValue { + return _lib._objc_msgSend_155(_id, _lib._sel_doubleValue1); + } + + double get floatValue { + return _lib._objc_msgSend_221(_id, _lib._sel_floatValue1); + } + + int get intValue { + return _lib._objc_msgSend_219(_id, _lib._sel_intValue1); + } + + int get integerValue { + return _lib._objc_msgSend_78(_id, _lib._sel_integerValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_220(_id, _lib._sel_longLongValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); + } + + NSString? get uppercaseString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_uppercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get lowercaseString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lowercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get capitalizedString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_capitalizedString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedUppercaseString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedUppercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedLowercaseString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedLowercaseString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedCapitalizedString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedCapitalizedString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString uppercaseStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_325( + _id, _lib._sel_uppercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString lowercaseStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_325( + _id, _lib._sel_lowercaseStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString capitalizedStringWithLocale_(NSLocale? locale) { + final _ret = _lib._objc_msgSend_325(_id, + _lib._sel_capitalizedStringWithLocale_1, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void getLineStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + _NSRange range) { + _lib._objc_msgSend_326( + _id, + _lib._sel_getLineStart_end_contentsEnd_forRange_1, + startPtr, + lineEndPtr, + contentsEndPtr, + range); + } + + void lineRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { + _lib._objc_msgSend_324(stret, _id, _lib._sel_lineRangeForRange_1, range); + } + + void getParagraphStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer parEndPtr, + ffi.Pointer contentsEndPtr, + _NSRange range) { + _lib._objc_msgSend_326( + _id, + _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, + startPtr, + parEndPtr, + contentsEndPtr, + range); + } + + void paragraphRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { + _lib._objc_msgSend_324( + stret, _id, _lib._sel_paragraphRangeForRange_1, range); + } + + void enumerateSubstringsInRange_options_usingBlock_(_NSRange range, int opts, + ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool block) { + _lib._objc_msgSend_327( + _id, + _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + void enumerateLinesUsingBlock_(ObjCBlock_ffiVoid_NSString_bool block) { + _lib._objc_msgSend_328( + _id, _lib._sel_enumerateLinesUsingBlock_1, block._id); + } + + ffi.Pointer get UTF8String { + return _lib._objc_msgSend_13(_id, _lib._sel_UTF8String1); + } + + int get fastestEncoding { + return _lib._objc_msgSend_10(_id, _lib._sel_fastestEncoding1); + } + + int get smallestEncoding { + return _lib._objc_msgSend_10(_id, _lib._sel_smallestEncoding1); + } + + NSData dataUsingEncoding_allowLossyConversion_(int encoding, bool lossy) { + final _ret = _lib._objc_msgSend_329(_id, + _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData dataUsingEncoding_(int encoding) { + final _ret = + _lib._objc_msgSend_330(_id, _lib._sel_dataUsingEncoding_1, encoding); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool canBeConvertedToEncoding_(int encoding) { + return _lib._objc_msgSend_91( + _id, _lib._sel_canBeConvertedToEncoding_1, encoding); + } + + ffi.Pointer cStringUsingEncoding_(int encoding) { + return _lib._objc_msgSend_11( + _id, _lib._sel_cStringUsingEncoding_1, encoding); + } + + bool getCString_maxLength_encoding_( + ffi.Pointer buffer, int maxBufferCount, int encoding) { + return _lib._objc_msgSend_331( + _id, + _lib._sel_getCString_maxLength_encoding_1, + buffer, + maxBufferCount, + encoding); + } + + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( + ffi.Pointer buffer, + int maxBufferCount, + ffi.Pointer usedBufferCount, + int encoding, + int options, + _NSRange range, + ffi.Pointer<_NSRange> leftover) { + return _lib._objc_msgSend_332( + _id, + _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options, + range, + leftover); + } + + int maximumLengthOfBytesUsingEncoding_(int enc) { + return _lib._objc_msgSend_88( + _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); + } + + int lengthOfBytesUsingEncoding_(int enc) { + return _lib._objc_msgSend_88( + _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); + } + + static ffi.Pointer getAvailableStringEncodings( + SentryCocoa _lib) { + return _lib._objc_msgSend_333( + _lib._class_NSString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding_( + SentryCocoa _lib, int encoding) { + final _ret = _lib._objc_msgSend_308(_lib._class_NSString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultCStringEncoding(SentryCocoa _lib) { + return _lib._objc_msgSend_10( + _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); + } + + NSString? get decomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_decomposedStringWithCanonicalMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get precomposedStringWithCanonicalMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_precomposedStringWithCanonicalMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get decomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_decomposedStringWithCompatibilityMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get precomposedStringWithCompatibilityMapping { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_precomposedStringWithCompatibilityMapping1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsSeparatedByString_(NSString? separator) { + final _ret = _lib._objc_msgSend_123(_id, + _lib._sel_componentsSeparatedByString_1, separator?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsSeparatedByCharactersInSet_(NSCharacterSet? separator) { + final _ret = _lib._objc_msgSend_334( + _id, + _lib._sel_componentsSeparatedByCharactersInSet_1, + separator?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString stringByTrimmingCharactersInSet_(NSCharacterSet? set) { + final _ret = _lib._objc_msgSend_335(_id, + _lib._sel_stringByTrimmingCharactersInSet_1, set?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByPaddingToLength_withString_startingAtIndex_( + int newLength, NSString? padString, int padIndex) { + final _ret = _lib._objc_msgSend_336( + _id, + _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, + newLength, + padString?._id ?? ffi.nullptr, + padIndex); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByFoldingWithOptions_locale_(int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_337( + _id, + _lib._sel_stringByFoldingWithOptions_locale_1, + options, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingOccurrencesOfString_withString_options_range_( + NSString? target, + NSString? replacement, + int options, + _NSRange searchRange) { + final _ret = _lib._objc_msgSend_338( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingOccurrencesOfString_withString_( + NSString? target, NSString? replacement) { + final _ret = _lib._objc_msgSend_339( + _id, + _lib._sel_stringByReplacingOccurrencesOfString_withString_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingCharactersInRange_withString_( + _NSRange range, NSString? replacement) { + final _ret = _lib._objc_msgSend_340( + _id, + _lib._sel_stringByReplacingCharactersInRange_withString_1, + range, + replacement?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByApplyingTransform_reverse_( + NSString transform, bool reverse) { + final _ret = _lib._objc_msgSend_341(_id, + _lib._sel_stringByApplyingTransform_reverse_1, transform._id, reverse); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_atomically_encoding_error_(NSURL? url, bool useAuxiliaryFile, + int enc, ffi.Pointer> error) { + return _lib._objc_msgSend_342( + _id, + _lib._sel_writeToURL_atomically_encoding_error_1, + url?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + bool writeToFile_atomically_encoding_error_( + NSString? path, + bool useAuxiliaryFile, + int enc, + ffi.Pointer> error) { + return _lib._objc_msgSend_343( + _id, + _lib._sel_writeToFile_atomically_encoding_error_1, + path?._id ?? ffi.nullptr, + useAuxiliaryFile, + enc, + error); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get hash { + return _lib._objc_msgSend_10(_id, _lib._sel_hash1); + } + + NSString initWithCharactersNoCopy_length_freeWhenDone_( + ffi.Pointer characters, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_344( + _id, + _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, + characters, + length, + freeBuffer); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithCharactersNoCopy_length_deallocator_( + ffi.Pointer chars, + int len, + ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong deallocator) { + final _ret = _lib._objc_msgSend_345( + _id, + _lib._sel_initWithCharactersNoCopy_length_deallocator_1, + chars, + len, + deallocator._id); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithCharacters_length_( + ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_346( + _id, _lib._sel_initWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithUTF8String_(ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_347( + _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithString_(NSString? aString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_arguments_( + NSString? format, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_348( + _id, + _lib._sel_initWithFormat_arguments_1, + format?._id ?? ffi.nullptr, + argList); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_locale_(NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_163(_id, _lib._sel_initWithFormat_locale_1, + format?._id ?? ffi.nullptr, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithFormat_locale_arguments_( + NSString? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_349( + _id, + _lib._sel_initWithFormat_locale_arguments_1, + format?._id ?? ffi.nullptr, + locale._id, + argList); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithValidatedFormat_validFormatSpecifiers_error_( + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_350( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithValidatedFormat_validFormatSpecifiers_locale_error_( + NSString? format, + NSString? validFormatSpecifiers, + NSObject locale, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_351( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + locale._id, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithValidatedFormat_validFormatSpecifiers_arguments_error_( + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer<__va_list_tag> argList, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_352( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + argList, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString + initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( + NSString? format, + NSString? validFormatSpecifiers, + NSObject locale, + ffi.Pointer<__va_list_tag> argList, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_353( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + locale._id, + argList, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithData_encoding_(NSData? data, int encoding) { + final _ret = _lib._objc_msgSend_354(_id, _lib._sel_initWithData_encoding_1, + data?._id ?? ffi.nullptr, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithBytes_length_encoding_( + ffi.Pointer bytes, int len, int encoding) { + final _ret = _lib._objc_msgSend_355( + _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithBytesNoCopy_length_encoding_freeWhenDone_( + ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { + final _ret = _lib._objc_msgSend_356( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, + bytes, + len, + encoding, + freeBuffer); + return NSString._(_ret, _lib, retain: false, release: true); + } + + NSString initWithBytesNoCopy_length_encoding_deallocator_( + ffi.Pointer bytes, + int len, + int encoding, + ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong deallocator) { + final _ret = _lib._objc_msgSend_357( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, + bytes, + len, + encoding, + deallocator._id); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString string(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_string1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithCharacters_length_( + SentryCocoa _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_346(_lib._class_NSString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithUTF8String_( + SentryCocoa _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_347(_lib._class_NSString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithFormat_(SentryCocoa _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringWithFormat_( + SentryCocoa _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithValidatedFormat_validFormatSpecifiers_error_( + SentryCocoa _lib, + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_350( + _lib._class_NSString1, + _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString + localizedStringWithValidatedFormat_validFormatSpecifiers_error_( + SentryCocoa _lib, + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_350( + _lib._class_NSString1, + _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithCString_encoding_( + ffi.Pointer nullTerminatedCString, int encoding) { + final _ret = _lib._objc_msgSend_358(_id, + _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithCString_encoding_( + SentryCocoa _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_358(_lib._class_NSString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfURL_encoding_error_( + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_359( + _id, + _lib._sel_initWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfFile_encoding_error_( + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_360( + _id, + _lib._sel_initWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfURL_encoding_error_(SentryCocoa _lib, + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_359( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfFile_encoding_error_(SentryCocoa _lib, + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_360( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfURL_usedEncoding_error_( + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_361( + _id, + _lib._sel_initWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString initWithContentsOfFile_usedEncoding_error_( + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_362( + _id, + _lib._sel_initWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfURL_usedEncoding_error_( + SentryCocoa _lib, + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_361( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString stringWithContentsOfFile_usedEncoding_error_( + SentryCocoa _lib, + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_362( + _lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + SentryCocoa _lib, + NSData? data, + NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_363( + _lib._class_NSString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + NSObject propertyList() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_propertyList1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary propertyListFromStringsFileFormat() { + final _ret = _lib._objc_msgSend_170( + _id, _lib._sel_propertyListFromStringsFileFormat1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer cString() { + return _lib._objc_msgSend_13(_id, _lib._sel_cString1); + } + + ffi.Pointer lossyCString() { + return _lib._objc_msgSend_13(_id, _lib._sel_lossyCString1); + } + + int cStringLength() { + return _lib._objc_msgSend_10(_id, _lib._sel_cStringLength1); + } + + void getCString_(ffi.Pointer bytes) { + _lib._objc_msgSend_266(_id, _lib._sel_getCString_1, bytes); + } + + void getCString_maxLength_(ffi.Pointer bytes, int maxLength) { + _lib._objc_msgSend_364( + _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); + } + + void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, + int maxLength, _NSRange aRange, ffi.Pointer<_NSRange> leftoverRange) { + _lib._objc_msgSend_365( + _id, + _lib._sel_getCString_maxLength_range_remainingRange_1, + bytes, + maxLength, + aRange, + leftoverRange); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_125(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSObject initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfFile_(SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCStringNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_366( + _id, + _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, + bytes, + length, + freeBuffer); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + NSObject initWithCString_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_358( + _id, _lib._sel_initWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCString_(ffi.Pointer bytes) { + final _ret = + _lib._objc_msgSend_347(_id, _lib._sel_initWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_length_( + SentryCocoa _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_358(_lib._class_NSString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_( + SentryCocoa _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_347( + _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getCharacters_(ffi.Pointer buffer) { + _lib._objc_msgSend_367(_id, _lib._sel_getCharacters_1, buffer); + } + + NSString variantFittingPresentationWidth_(int width) { + final _ret = _lib._objc_msgSend_368( + _id, _lib._sel_variantFittingPresentationWidth_1, width); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString pathWithComponents_(SentryCocoa _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_369(_lib._class_NSString1, + _lib._sel_pathWithComponents_1, components?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get pathComponents { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_pathComponents1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool get absolutePath { + return _lib._objc_msgSend_12(_id, _lib._sel_isAbsolutePath1); + } + + NSString? get lastPathComponent { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByDeletingLastPathComponent { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_stringByDeletingLastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingPathComponent_(NSString? str) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_stringByAppendingPathComponent_1, str?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get pathExtension { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByDeletingPathExtension { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByDeletingPathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAppendingPathExtension_(NSString? str) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_stringByAppendingPathExtension_1, str?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByAbbreviatingWithTildeInPath { + final _ret = _lib._objc_msgSend_20( + _id, _lib._sel_stringByAbbreviatingWithTildeInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByExpandingTildeInPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByExpandingTildeInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByStandardizingPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByStandardizingPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByResolvingSymlinksInPath { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByResolvingSymlinksInPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray stringsByAppendingPaths_(NSArray? paths) { + final _ret = _lib._objc_msgSend_63( + _id, _lib._sel_stringsByAppendingPaths_1, paths?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_( + ffi.Pointer> outputName, + bool flag, + ffi.Pointer> outputArray, + NSArray? filterTypes) { + return _lib._objc_msgSend_370( + _id, + _lib._sel_completePathIntoString_caseSensitive_matchesIntoArray_filterTypes_1, + outputName, + flag, + outputArray, + filterTypes?._id ?? ffi.nullptr); + } + + ffi.Pointer get fileSystemRepresentation { + return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); + } + + bool getFileSystemRepresentation_maxLength_( + ffi.Pointer cname, int max) { + return _lib._objc_msgSend_224( + _id, _lib._sel_getFileSystemRepresentation_maxLength_1, cname, max); + } + + NSString stringByAddingPercentEncodingWithAllowedCharacters_( + NSCharacterSet? allowedCharacters) { + final _ret = _lib._objc_msgSend_335( + _id, + _lib._sel_stringByAddingPercentEncodingWithAllowedCharacters_1, + allowedCharacters?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get stringByRemovingPercentEncoding { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_stringByRemovingPercentEncoding1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByAddingPercentEscapesUsingEncoding_(int enc) { + final _ret = _lib._objc_msgSend_308( + _id, _lib._sel_stringByAddingPercentEscapesUsingEncoding_1, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString stringByReplacingPercentEscapesUsingEncoding_(int enc) { + final _ret = _lib._objc_msgSend_308( + _id, _lib._sel_stringByReplacingPercentEscapesUsingEncoding_1, enc); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray linguisticTagsInRange_scheme_options_orthography_tokenRanges_( + _NSRange range, + NSString scheme, + int options, + NSOrthography? orthography, + ffi.Pointer> tokenRanges) { + final _ret = _lib._objc_msgSend_372( + _id, + _lib._sel_linguisticTagsInRange_scheme_options_orthography_tokenRanges_1, + range, + scheme._id, + options, + orthography?._id ?? ffi.nullptr, + tokenRanges); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_( + _NSRange range, + NSString scheme, + int options, + NSOrthography? orthography, + ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool block) { + _lib._objc_msgSend_373( + _id, + _lib._sel_enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock_1, + range, + scheme._id, + options, + orthography?._id ?? ffi.nullptr, + block._id); + } + + static NSString new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_new1); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSString1, _lib._sel_allocWithZone_1, zone); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static NSString alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_alloc1); + return NSString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSString1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSString1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +extension StringToNSString on String { + NSString toNSString(SentryCocoa lib) => NSString(lib, this); +} + +class NSCoder extends NSObject { + NSCoder._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCoder] that points to the same underlying object as [other]. + static NSCoder castFrom(T other) { + return NSCoder._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCoder] that wraps the given raw object pointer. + static NSCoder castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCoder._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCoder]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCoder1); + } + + void encodeValueOfObjCType_at_( + ffi.Pointer type, ffi.Pointer addr) { + _lib._objc_msgSend_18( + _id, _lib._sel_encodeValueOfObjCType_at_1, type, addr); + } + + void encodeDataObject_(NSData? data) { + _lib._objc_msgSend_263( + _id, _lib._sel_encodeDataObject_1, data?._id ?? ffi.nullptr); + } + + NSData decodeDataObject() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_decodeDataObject1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void decodeValueOfObjCType_at_size_( + ffi.Pointer type, ffi.Pointer data, int size) { + _lib._objc_msgSend_264( + _id, _lib._sel_decodeValueOfObjCType_at_size_1, type, data, size); + } + + int versionForClassName_(NSString? className) { + return _lib._objc_msgSend_265( + _id, _lib._sel_versionForClassName_1, className?._id ?? ffi.nullptr); + } + + void encodeObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeObject_1, object._id); + } + + void encodeRootObject_(NSObject rootObject) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeRootObject_1, rootObject._id); + } + + void encodeBycopyObject_(NSObject anObject) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeBycopyObject_1, anObject._id); + } + + void encodeByrefObject_(NSObject anObject) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeByrefObject_1, anObject._id); + } + + void encodeConditionalObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeConditionalObject_1, object._id); + } + + void encodeValuesOfObjCTypes_(ffi.Pointer types) { + _lib._objc_msgSend_266(_id, _lib._sel_encodeValuesOfObjCTypes_1, types); + } + + void encodeArrayOfObjCType_count_at_( + ffi.Pointer type, int count, ffi.Pointer array) { + _lib._objc_msgSend_267( + _id, _lib._sel_encodeArrayOfObjCType_count_at_1, type, count, array); + } + + void encodeBytes_length_(ffi.Pointer byteaddr, int length) { + _lib._objc_msgSend_21( + _id, _lib._sel_encodeBytes_length_1, byteaddr, length); + } + + NSObject decodeObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodeObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectAndReturnError_( + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_268( + _id, _lib._sel_decodeTopLevelObjectAndReturnError_1, error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void decodeValuesOfObjCTypes_(ffi.Pointer types) { + _lib._objc_msgSend_266(_id, _lib._sel_decodeValuesOfObjCTypes_1, types); + } + + void decodeArrayOfObjCType_count_at_( + ffi.Pointer itemType, int count, ffi.Pointer array) { + _lib._objc_msgSend_267(_id, _lib._sel_decodeArrayOfObjCType_count_at_1, + itemType, count, array); + } + + ffi.Pointer decodeBytesWithReturnedLength_( + ffi.Pointer lengthp) { + return _lib._objc_msgSend_269( + _id, _lib._sel_decodeBytesWithReturnedLength_1, lengthp); + } + + void encodePropertyList_(NSObject aPropertyList) { + _lib._objc_msgSend_15( + _id, _lib._sel_encodePropertyList_1, aPropertyList._id); + } + + NSObject decodePropertyList() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodePropertyList1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setObjectZone_(ffi.Pointer<_NSZone> zone) { + _lib._objc_msgSend_270(_id, _lib._sel_setObjectZone_1, zone); + } + + ffi.Pointer<_NSZone> objectZone() { + return _lib._objc_msgSend_271(_id, _lib._sel_objectZone1); + } + + int get systemVersion { + return _lib._objc_msgSend_197(_id, _lib._sel_systemVersion1); + } + + bool get allowsKeyedCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsKeyedCoding1); + } + + void encodeObject_forKey_(NSObject object, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_encodeObject_forKey_1, object._id, + key?._id ?? ffi.nullptr); + } + + void encodeConditionalObject_forKey_(NSObject object, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_encodeConditionalObject_forKey_1, + object._id, key?._id ?? ffi.nullptr); + } + + void encodeBool_forKey_(bool value, NSString? key) { + _lib._objc_msgSend_272( + _id, _lib._sel_encodeBool_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt_forKey_(int value, NSString? key) { + _lib._objc_msgSend_273( + _id, _lib._sel_encodeInt_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt32_forKey_(int value, NSString? key) { + _lib._objc_msgSend_274( + _id, _lib._sel_encodeInt32_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeInt64_forKey_(int value, NSString? key) { + _lib._objc_msgSend_275( + _id, _lib._sel_encodeInt64_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeFloat_forKey_(double value, NSString? key) { + _lib._objc_msgSend_276( + _id, _lib._sel_encodeFloat_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeDouble_forKey_(double value, NSString? key) { + _lib._objc_msgSend_277( + _id, _lib._sel_encodeDouble_forKey_1, value, key?._id ?? ffi.nullptr); + } + + void encodeBytes_length_forKey_( + ffi.Pointer bytes, int length, NSString? key) { + _lib._objc_msgSend_278(_id, _lib._sel_encodeBytes_length_forKey_1, bytes, + length, key?._id ?? ffi.nullptr); + } + + bool containsValueForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_containsValueForKey_1, key?._id ?? ffi.nullptr); + } + + NSObject decodeObjectForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_decodeObjectForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectForKey_error_( + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_279( + _id, + _lib._sel_decodeTopLevelObjectForKey_error_1, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool decodeBoolForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_decodeBoolForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeIntForKey_(NSString? key) { + return _lib._objc_msgSend_280( + _id, _lib._sel_decodeIntForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeInt32ForKey_(NSString? key) { + return _lib._objc_msgSend_281( + _id, _lib._sel_decodeInt32ForKey_1, key?._id ?? ffi.nullptr); + } + + int decodeInt64ForKey_(NSString? key) { + return _lib._objc_msgSend_282( + _id, _lib._sel_decodeInt64ForKey_1, key?._id ?? ffi.nullptr); + } + + double decodeFloatForKey_(NSString? key) { + return _lib._objc_msgSend_283( + _id, _lib._sel_decodeFloatForKey_1, key?._id ?? ffi.nullptr); + } + + double decodeDoubleForKey_(NSString? key) { + return _lib._objc_msgSend_284( + _id, _lib._sel_decodeDoubleForKey_1, key?._id ?? ffi.nullptr); + } + + ffi.Pointer decodeBytesForKey_returnedLength_( + NSString? key, ffi.Pointer lengthp) { + return _lib._objc_msgSend_285( + _id, + _lib._sel_decodeBytesForKey_returnedLength_1, + key?._id ?? ffi.nullptr, + lengthp); + } + + void encodeInteger_forKey_(int value, NSString? key) { + _lib._objc_msgSend_286( + _id, _lib._sel_encodeInteger_forKey_1, value, key?._id ?? ffi.nullptr); + } + + int decodeIntegerForKey_(NSString? key) { + return _lib._objc_msgSend_265( + _id, _lib._sel_decodeIntegerForKey_1, key?._id ?? ffi.nullptr); + } + + bool get requiresSecureCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); + } + + NSObject decodeObjectOfClass_forKey_(NSObject aClass, NSString? key) { + final _ret = _lib._objc_msgSend_287( + _id, + _lib._sel_decodeObjectOfClass_forKey_1, + aClass._id, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectOfClass_forKey_error_(NSObject aClass, + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_288( + _id, + _lib._sel_decodeTopLevelObjectOfClass_forKey_error_1, + aClass._id, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray decodeArrayOfObjectsOfClass_forKey_(NSObject cls, NSString? key) { + final _ret = _lib._objc_msgSend_289( + _id, + _lib._sel_decodeArrayOfObjectsOfClass_forKey_1, + cls._id, + key?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_( + NSObject keyCls, NSObject objectCls, NSString? key) { + final _ret = _lib._objc_msgSend_290( + _id, + _lib._sel_decodeDictionaryWithKeysOfClass_objectsOfClass_forKey_1, + keyCls._id, + objectCls._id, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeObjectOfClasses_forKey_(NSSet? classes, NSString? key) { + final _ret = _lib._objc_msgSend_291( + _id, + _lib._sel_decodeObjectOfClasses_forKey_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject decodeTopLevelObjectOfClasses_forKey_error_(NSSet? classes, + NSString? key, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_292( + _id, + _lib._sel_decodeTopLevelObjectOfClasses_forKey_error_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray decodeArrayOfObjectsOfClasses_forKey_(NSSet? classes, NSString? key) { + final _ret = _lib._objc_msgSend_293( + _id, + _lib._sel_decodeArrayOfObjectsOfClasses_forKey_1, + classes?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_( + NSSet? keyClasses, NSSet? objectClasses, NSString? key) { + final _ret = _lib._objc_msgSend_294( + _id, + _lib._sel_decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey_1, + keyClasses?._id ?? ffi.nullptr, + objectClasses?._id ?? ffi.nullptr, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject decodePropertyListForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_decodePropertyListForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSSet? get allowedClasses { + final _ret = _lib._objc_msgSend_295(_id, _lib._sel_allowedClasses1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + void failWithError_(NSError? error) { + _lib._objc_msgSend_296( + _id, _lib._sel_failWithError_1, error?._id ?? ffi.nullptr); + } + + int get decodingFailurePolicy { + return _lib._objc_msgSend_297(_id, _lib._sel_decodingFailurePolicy1); + } + + NSError? get error { + final _ret = _lib._objc_msgSend_298(_id, _lib._sel_error1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + void encodeNXObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeNXObject_1, object._id); + } + + NSObject decodeNXObject() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_decodeNXObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void decodeValueOfObjCType_at_( + ffi.Pointer type, ffi.Pointer data) { + _lib._objc_msgSend_18( + _id, _lib._sel_decodeValueOfObjCType_at_1, type, data); + } + + void encodePoint_(CGPoint point) { + _lib._objc_msgSend_299(_id, _lib._sel_encodePoint_1, point); + } + + void decodePoint(ffi.Pointer stret) { + _lib._objc_msgSend_54(stret, _id, _lib._sel_decodePoint1); + } + + void encodeSize_(CGSize size) { + _lib._objc_msgSend_300(_id, _lib._sel_encodeSize_1, size); + } + + void decodeSize(ffi.Pointer stret) { + _lib._objc_msgSend_55(stret, _id, _lib._sel_decodeSize1); + } + + void encodeRect_(CGRect rect) { + _lib._objc_msgSend_301(_id, _lib._sel_encodeRect_1, rect); + } + + void decodeRect(ffi.Pointer stret) { + _lib._objc_msgSend_56(stret, _id, _lib._sel_decodeRect1); + } + + void encodePoint_forKey_(CGPoint point, NSString? key) { + _lib._objc_msgSend_302( + _id, _lib._sel_encodePoint_forKey_1, point, key?._id ?? ffi.nullptr); + } + + void encodeSize_forKey_(CGSize size, NSString? key) { + _lib._objc_msgSend_303( + _id, _lib._sel_encodeSize_forKey_1, size, key?._id ?? ffi.nullptr); + } + + void encodeRect_forKey_(CGRect rect, NSString? key) { + _lib._objc_msgSend_304( + _id, _lib._sel_encodeRect_forKey_1, rect, key?._id ?? ffi.nullptr); + } + + void decodePointForKey_(ffi.Pointer stret, NSString? key) { + _lib._objc_msgSend_305( + stret, _id, _lib._sel_decodePointForKey_1, key?._id ?? ffi.nullptr); + } + + void decodeSizeForKey_(ffi.Pointer stret, NSString? key) { + _lib._objc_msgSend_306( + stret, _id, _lib._sel_decodeSizeForKey_1, key?._id ?? ffi.nullptr); + } + + void decodeRectForKey_(ffi.Pointer stret, NSString? key) { + _lib._objc_msgSend_307( + stret, _id, _lib._sel_decodeRectForKey_1, key?._id ?? ffi.nullptr); + } + + @override + NSCoder init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCoder._(_ret, _lib, retain: true, release: true); + } + + static NSCoder new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_new1); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static NSCoder allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSCoder1, _lib._sel_allocWithZone_1, zone); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static NSCoder alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCoder1, _lib._sel_alloc1); + return NSCoder._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCoder1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCoder1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCoder1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCoder1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSCoder1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSCoder1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCoder1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSData extends NSObject { + NSData._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSData] that points to the same underlying object as [other]. + static NSData castFrom(T other) { + return NSData._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSData] that wraps the given raw object pointer. + static NSData castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSData._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSData]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSData1); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + ffi.Pointer get bytes { + return _lib._objc_msgSend_19(_id, _lib._sel_bytes1); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + void getBytes_length_(ffi.Pointer buffer, int length) { + _lib._objc_msgSend_21(_id, _lib._sel_getBytes_length_1, buffer, length); + } + + void getBytes_range_(ffi.Pointer buffer, _NSRange range) { + _lib._objc_msgSend_22(_id, _lib._sel_getBytes_range_1, buffer, range); + } + + bool isEqualToData_(NSData? other) { + return _lib._objc_msgSend_23( + _id, _lib._sel_isEqualToData_1, other?._id ?? ffi.nullptr); + } + + NSData subdataWithRange_(_NSRange range) { + final _ret = + _lib._objc_msgSend_24(_id, _lib._sel_subdataWithRange_1, range); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_125(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + bool writeToFile_options_error_(NSString? path, int writeOptionsMask, + ffi.Pointer> errorPtr) { + return _lib._objc_msgSend_248(_id, _lib._sel_writeToFile_options_error_1, + path?._id ?? ffi.nullptr, writeOptionsMask, errorPtr); + } + + bool writeToURL_options_error_(NSURL? url, int writeOptionsMask, + ffi.Pointer> errorPtr) { + return _lib._objc_msgSend_249(_id, _lib._sel_writeToURL_options_error_1, + url?._id ?? ffi.nullptr, writeOptionsMask, errorPtr); + } + + void rangeOfData_options_range_(ffi.Pointer<_NSRange> stret, + NSData? dataToFind, int mask, _NSRange searchRange) { + _lib._objc_msgSend_250(stret, _id, _lib._sel_rangeOfData_options_range_1, + dataToFind?._id ?? ffi.nullptr, mask, searchRange); + } + + void enumerateByteRangesUsingBlock_( + ObjCBlock_ffiVoid_ffiVoid_NSRange_bool block) { + _lib._objc_msgSend_251( + _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._id); + } + + static NSData data(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_data1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithBytes_length_( + SentryCocoa _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252( + _lib._class_NSData1, _lib._sel_dataWithBytes_length_1, bytes, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithBytesNoCopy_length_( + SentryCocoa _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252(_lib._class_NSData1, + _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData dataWithBytesNoCopy_length_freeWhenDone_( + SentryCocoa _lib, ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_253(_lib._class_NSData1, + _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData dataWithContentsOfFile_options_error_( + SentryCocoa _lib, + NSString? path, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_254( + _lib._class_NSData1, + _lib._sel_dataWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfURL_options_error_( + SentryCocoa _lib, + NSURL? url, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_255( + _lib._class_NSData1, + _lib._sel_dataWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfFile_(SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSData1, + _lib._sel_dataWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithContentsOfURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSData1, + _lib._sel_dataWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBytes_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252( + _id, _lib._sel_initWithBytes_length_1, bytes, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBytesNoCopy_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252( + _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithBytesNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_253(_id, + _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithBytesNoCopy_length_deallocator_(ffi.Pointer bytes, + int length, ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong deallocator) { + final _ret = _lib._objc_msgSend_256( + _id, + _lib._sel_initWithBytesNoCopy_length_deallocator_1, + bytes, + length, + deallocator._id); + return NSData._(_ret, _lib, retain: false, release: true); + } + + NSData initWithContentsOfFile_options_error_(NSString? path, + int readOptionsMask, ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_254( + _id, + _lib._sel_initWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfURL_options_error_(NSURL? url, int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_255( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_257( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData dataWithData_(SentryCocoa _lib, NSData? data) { + final _ret = _lib._objc_msgSend_257(_lib._class_NSData1, + _lib._sel_dataWithData_1, data?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBase64EncodedString_options_( + NSString? base64String, int options) { + final _ret = _lib._objc_msgSend_258( + _id, + _lib._sel_initWithBase64EncodedString_options_1, + base64String?._id ?? ffi.nullptr, + options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSString base64EncodedStringWithOptions_(int options) { + final _ret = _lib._objc_msgSend_259( + _id, _lib._sel_base64EncodedStringWithOptions_1, options); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData initWithBase64EncodedData_options_(NSData? base64Data, int options) { + final _ret = _lib._objc_msgSend_260( + _id, + _lib._sel_initWithBase64EncodedData_options_1, + base64Data?._id ?? ffi.nullptr, + options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData base64EncodedDataWithOptions_(int options) { + final _ret = _lib._objc_msgSend_261( + _id, _lib._sel_base64EncodedDataWithOptions_1, options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData decompressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_262(_id, + _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData compressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_262( + _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void getBytes_(ffi.Pointer buffer) { + _lib._objc_msgSend_47(_id, _lib._sel_getBytes_1, buffer); + } + + static NSObject dataWithContentsOfMappedFile_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSData1, + _lib._sel_dataWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithContentsOfMappedFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_initWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithBase64Encoding_(NSString? base64String) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_initWithBase64Encoding_1, + base64String?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString base64Encoding() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_base64Encoding1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSData init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSData new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_new1); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSData1, _lib._sel_allocWithZone_1, zone); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static NSData alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_alloc1); + return NSData._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSData1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSData1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSData1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSData1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSData1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSData1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSData1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class _NSRange extends ffi.Struct { + @ffi.UnsignedLong() + external int location; + + @ffi.UnsignedLong() + external int length; +} + +class NSURL extends NSObject { + NSURL._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURL] that points to the same underlying object as [other]. + static NSURL castFrom(T other) { + return NSURL._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURL] that wraps the given raw object pointer. + static NSURL castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURL._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURL]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURL1); + } + + NSURL initWithScheme_host_path_( + NSString? scheme, NSString? host, NSString? path) { + final _ret = _lib._objc_msgSend_26( + _id, + _lib._sel_initWithScheme_host_path_1, + scheme?._id ?? ffi.nullptr, + host?._id ?? ffi.nullptr, + path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_isDirectory_relativeToURL_( + NSString? path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_27( + _id, + _lib._sel_initFileURLWithPath_isDirectory_relativeToURL_1, + path?._id ?? ffi.nullptr, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_relativeToURL_(NSString? path, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _id, + _lib._sel_initFileURLWithPath_relativeToURL_1, + path?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_isDirectory_(NSString? path, bool isDir) { + final _ret = _lib._objc_msgSend_29( + _id, + _lib._sel_initFileURLWithPath_isDirectory_1, + path?._id ?? ffi.nullptr, + isDir); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initFileURLWithPath_1, path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_isDirectory_relativeToURL_( + SentryCocoa _lib, NSString? path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_31( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_isDirectory_relativeToURL_1, + path?._id ?? ffi.nullptr, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_relativeToURL_( + SentryCocoa _lib, NSString? path, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_32( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_relativeToURL_1, + path?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_isDirectory_( + SentryCocoa _lib, NSString? path, bool isDir) { + final _ret = _lib._objc_msgSend_33( + _lib._class_NSURL1, + _lib._sel_fileURLWithPath_isDirectory_1, + path?._id ?? ffi.nullptr, + isDir); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithPath_(SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_34(_lib._class_NSURL1, + _lib._sel_fileURLWithPath_1, path?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( + ffi.Pointer path, bool isDir, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_35( + _id, + _lib._sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, + path, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( + SentryCocoa _lib, + ffi.Pointer path, + bool isDir, + NSURL? baseURL) { + final _ret = _lib._objc_msgSend_36( + _lib._class_NSURL1, + _lib._sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, + path, + isDir, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithString_(NSString? URLString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, URLString?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithString_relativeToURL_(NSString? URLString, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _id, + _lib._sel_initWithString_relativeToURL_1, + URLString?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithString_(SentryCocoa _lib, NSString? URLString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSURL1, + _lib._sel_URLWithString_1, URLString?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithString_relativeToURL_( + SentryCocoa _lib, NSString? URLString, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_28( + _lib._class_NSURL1, + _lib._sel_URLWithString_relativeToURL_1, + URLString?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initWithDataRepresentation_relativeToURL_( + NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_37( + _id, + _lib._sel_initWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLWithDataRepresentation_relativeToURL_( + SentryCocoa _lib, NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_38( + _lib._class_NSURL1, + _lib._sel_URLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL initAbsoluteURLWithDataRepresentation_relativeToURL_( + NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_37( + _id, + _lib._sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL absoluteURLWithDataRepresentation_relativeToURL_( + SentryCocoa _lib, NSData? data, NSURL? baseURL) { + final _ret = _lib._objc_msgSend_38( + _lib._class_NSURL1, + _lib._sel_absoluteURLWithDataRepresentation_relativeToURL_1, + data?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData? get dataRepresentation { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_dataRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString? get absoluteString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_absoluteString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get relativeString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_relativeString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL? get baseURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_baseURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get absoluteURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_absoluteURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get scheme { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scheme1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get resourceSpecifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_resourceSpecifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get host { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_host1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSNumber? get port { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_port1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSString? get user { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_user1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get password { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_password1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get path { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_path1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get fragment { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fragment1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get parameterString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_parameterString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get query { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_query1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get relativePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_relativePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasDirectoryPath { + return _lib._objc_msgSend_12(_id, _lib._sel_hasDirectoryPath1); + } + + bool getFileSystemRepresentation_maxLength_( + ffi.Pointer buffer, int maxBufferLength) { + return _lib._objc_msgSend_224( + _id, + _lib._sel_getFileSystemRepresentation_maxLength_1, + buffer, + maxBufferLength); + } + + ffi.Pointer get fileSystemRepresentation { + return _lib._objc_msgSend_13(_id, _lib._sel_fileSystemRepresentation1); + } + + bool get fileURL { + return _lib._objc_msgSend_12(_id, _lib._sel_isFileURL1); + } + + NSURL? get standardizedURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_standardizedURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + bool checkResourceIsReachableAndReturnError_( + ffi.Pointer> error) { + return _lib._objc_msgSend_225( + _id, _lib._sel_checkResourceIsReachableAndReturnError_1, error); + } + + bool isFileReferenceURL() { + return _lib._objc_msgSend_12(_id, _lib._sel_isFileReferenceURL1); + } + + NSURL fileReferenceURL() { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileReferenceURL1); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get filePathURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_filePathURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + bool getResourceValue_forKey_error_( + ffi.Pointer> value, + NSString key, + ffi.Pointer> error) { + return _lib._objc_msgSend_226( + _id, _lib._sel_getResourceValue_forKey_error_1, value, key._id, error); + } + + NSObject resourceValuesForKeys_error_( + NSArray? keys, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_227( + _id, + _lib._sel_resourceValuesForKeys_error_1, + keys?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setResourceValue_forKey_error_(NSObject value, NSString key, + ffi.Pointer> error) { + return _lib._objc_msgSend_228(_id, + _lib._sel_setResourceValue_forKey_error_1, value._id, key._id, error); + } + + bool setResourceValues_error_( + NSObject? keyedValues, ffi.Pointer> error) { + return _lib._objc_msgSend_229(_id, _lib._sel_setResourceValues_error_1, + keyedValues?._id ?? ffi.nullptr, error); + } + + void removeCachedResourceValueForKey_(NSString key) { + _lib._objc_msgSend_192( + _id, _lib._sel_removeCachedResourceValueForKey_1, key._id); + } + + void removeAllCachedResourceValues() { + _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResourceValues1); + } + + void setTemporaryResourceValue_forKey_(NSObject value, NSString key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setTemporaryResourceValue_forKey_1, value._id, key._id); + } + + NSData + bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_( + int options, + NSArray? keys, + NSURL? relativeURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_230( + _id, + _lib._sel_bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_1, + options, + keys?._id ?? ffi.nullptr, + relativeURL?._id ?? ffi.nullptr, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSURL + initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_( + NSData? bookmarkData, + int options, + NSURL? relativeURL, + ffi.Pointer isStale, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_231( + _id, + _lib._sel_initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1, + bookmarkData?._id ?? ffi.nullptr, + options, + relativeURL?._id ?? ffi.nullptr, + isStale, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL + URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_( + SentryCocoa _lib, + NSData? bookmarkData, + int options, + NSURL? relativeURL, + ffi.Pointer isStale, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_231( + _lib._class_NSURL1, + _lib._sel_URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1, + bookmarkData?._id ?? ffi.nullptr, + options, + relativeURL?._id ?? ffi.nullptr, + isStale, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSObject resourceValuesForKeys_fromBookmarkData_( + SentryCocoa _lib, NSArray? keys, NSData? bookmarkData) { + final _ret = _lib._objc_msgSend_232( + _lib._class_NSURL1, + _lib._sel_resourceValuesForKeys_fromBookmarkData_1, + keys?._id ?? ffi.nullptr, + bookmarkData?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static bool writeBookmarkData_toURL_options_error_( + SentryCocoa _lib, + NSData? bookmarkData, + NSURL? bookmarkFileURL, + int options, + ffi.Pointer> error) { + return _lib._objc_msgSend_233( + _lib._class_NSURL1, + _lib._sel_writeBookmarkData_toURL_options_error_1, + bookmarkData?._id ?? ffi.nullptr, + bookmarkFileURL?._id ?? ffi.nullptr, + options, + error); + } + + static NSData bookmarkDataWithContentsOfURL_error_(SentryCocoa _lib, + NSURL? bookmarkFileURL, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_234( + _lib._class_NSURL1, + _lib._sel_bookmarkDataWithContentsOfURL_error_1, + bookmarkFileURL?._id ?? ffi.nullptr, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLByResolvingAliasFileAtURL_options_error_(SentryCocoa _lib, + NSURL? url, int options, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_235( + _lib._class_NSURL1, + _lib._sel_URLByResolvingAliasFileAtURL_options_error_1, + url?._id ?? ffi.nullptr, + options, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + bool startAccessingSecurityScopedResource() { + return _lib._objc_msgSend_12( + _id, _lib._sel_startAccessingSecurityScopedResource1); + } + + void stopAccessingSecurityScopedResource() { + _lib._objc_msgSend_1(_id, _lib._sel_stopAccessingSecurityScopedResource1); + } + + bool getPromisedItemResourceValue_forKey_error_( + ffi.Pointer> value, + NSString key, + ffi.Pointer> error) { + return _lib._objc_msgSend_226( + _id, + _lib._sel_getPromisedItemResourceValue_forKey_error_1, + value, + key._id, + error); + } + + NSDictionary promisedItemResourceValuesForKeys_error_( + NSArray? keys, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_236( + _id, + _lib._sel_promisedItemResourceValuesForKeys_error_1, + keys?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool checkPromisedItemIsReachableAndReturnError_( + ffi.Pointer> error) { + return _lib._objc_msgSend_225( + _id, _lib._sel_checkPromisedItemIsReachableAndReturnError_1, error); + } + + static NSURL fileURLWithPathComponents_( + SentryCocoa _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_237(_lib._class_NSURL1, + _lib._sel_fileURLWithPathComponents_1, components?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray? get pathComponents { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_pathComponents1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get lastPathComponent { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_lastPathComponent1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get pathExtension { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pathExtension1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathComponent_(NSString? pathComponent) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLByAppendingPathComponent_1, + pathComponent?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathComponent_isDirectory_( + NSString? pathComponent, bool isDirectory) { + final _ret = _lib._objc_msgSend_33( + _id, + _lib._sel_URLByAppendingPathComponent_isDirectory_1, + pathComponent?._id ?? ffi.nullptr, + isDirectory); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByDeletingLastPathComponent { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByDeletingLastPathComponent1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLByAppendingPathExtension_(NSString? pathExtension) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLByAppendingPathExtension_1, + pathExtension?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByDeletingPathExtension { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByDeletingPathExtension1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByStandardizingPath { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URLByStandardizingPath1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URLByResolvingSymlinksInPath { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_URLByResolvingSymlinksInPath1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSData resourceDataUsingCache_(bool shouldUseCache) { + final _ret = _lib._objc_msgSend_238( + _id, _lib._sel_resourceDataUsingCache_1, shouldUseCache); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void loadResourceDataNotifyingClient_usingCache_( + NSObject client, bool shouldUseCache) { + _lib._objc_msgSend_239( + _id, + _lib._sel_loadResourceDataNotifyingClient_usingCache_1, + client._id, + shouldUseCache); + } + + NSObject propertyForKey_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_propertyForKey_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setResourceData_(NSData? data) { + return _lib._objc_msgSend_23( + _id, _lib._sel_setResourceData_1, data?._id ?? ffi.nullptr); + } + + bool setProperty_forKey_(NSObject property, NSString? propertyKey) { + return _lib._objc_msgSend_240(_id, _lib._sel_setProperty_forKey_1, + property._id, propertyKey?._id ?? ffi.nullptr); + } + + NSURLHandle URLHandleUsingCache_(bool shouldUseCache) { + final _ret = _lib._objc_msgSend_247( + _id, _lib._sel_URLHandleUsingCache_1, shouldUseCache); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + @override + NSURL init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSURL new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_new1); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static NSURL allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURL1, _lib._sel_allocWithZone_1, zone); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static NSURL alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_alloc1); + return NSURL._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURL1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURL1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURL1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURL1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURL1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURL1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURL1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURL1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURL1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSNumber extends NSValue { + NSNumber._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNumber] that points to the same underlying object as [other]. + static NSNumber castFrom(T other) { + return NSNumber._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNumber] that wraps the given raw object pointer. + static NSNumber castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNumber._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNumber]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNumber1); + } + + @override + NSNumber initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithChar_(int value) { + final _ret = _lib._objc_msgSend_202(_id, _lib._sel_initWithChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedChar_(int value) { + final _ret = + _lib._objc_msgSend_203(_id, _lib._sel_initWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithShort_(int value) { + final _ret = _lib._objc_msgSend_204(_id, _lib._sel_initWithShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedShort_(int value) { + final _ret = + _lib._objc_msgSend_205(_id, _lib._sel_initWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithInt_(int value) { + final _ret = _lib._objc_msgSend_206(_id, _lib._sel_initWithInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedInt_(int value) { + final _ret = + _lib._objc_msgSend_207(_id, _lib._sel_initWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithLong_(int value) { + final _ret = _lib._objc_msgSend_208(_id, _lib._sel_initWithLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedLong_(int value) { + final _ret = + _lib._objc_msgSend_209(_id, _lib._sel_initWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithLongLong_(int value) { + final _ret = + _lib._objc_msgSend_210(_id, _lib._sel_initWithLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedLongLong_(int value) { + final _ret = _lib._objc_msgSend_211( + _id, _lib._sel_initWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithFloat_(double value) { + final _ret = _lib._objc_msgSend_212(_id, _lib._sel_initWithFloat_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithDouble_(double value) { + final _ret = _lib._objc_msgSend_213(_id, _lib._sel_initWithDouble_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithBool_(bool value) { + final _ret = _lib._objc_msgSend_214(_id, _lib._sel_initWithBool_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithInteger_(int value) { + final _ret = + _lib._objc_msgSend_208(_id, _lib._sel_initWithInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber initWithUnsignedInteger_(int value) { + final _ret = + _lib._objc_msgSend_209(_id, _lib._sel_initWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + int get charValue { + return _lib._objc_msgSend_215(_id, _lib._sel_charValue1); + } + + int get unsignedCharValue { + return _lib._objc_msgSend_216(_id, _lib._sel_unsignedCharValue1); + } + + int get shortValue { + return _lib._objc_msgSend_217(_id, _lib._sel_shortValue1); + } + + int get unsignedShortValue { + return _lib._objc_msgSend_218(_id, _lib._sel_unsignedShortValue1); + } + + int get intValue { + return _lib._objc_msgSend_219(_id, _lib._sel_intValue1); + } + + int get unsignedIntValue { + return _lib._objc_msgSend_197(_id, _lib._sel_unsignedIntValue1); + } + + int get longValue { + return _lib._objc_msgSend_78(_id, _lib._sel_longValue1); + } + + int get unsignedLongValue { + return _lib._objc_msgSend_10(_id, _lib._sel_unsignedLongValue1); + } + + int get longLongValue { + return _lib._objc_msgSend_220(_id, _lib._sel_longLongValue1); + } + + int get unsignedLongLongValue { + return _lib._objc_msgSend_154(_id, _lib._sel_unsignedLongLongValue1); + } + + double get floatValue { + return _lib._objc_msgSend_221(_id, _lib._sel_floatValue1); + } + + double get doubleValue { + return _lib._objc_msgSend_155(_id, _lib._sel_doubleValue1); + } + + bool get boolValue { + return _lib._objc_msgSend_12(_id, _lib._sel_boolValue1); + } + + int get integerValue { + return _lib._objc_msgSend_78(_id, _lib._sel_integerValue1); + } + + int get unsignedIntegerValue { + return _lib._objc_msgSend_10(_id, _lib._sel_unsignedIntegerValue1); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int compare_(NSNumber? otherNumber) { + return _lib._objc_msgSend_222( + _id, _lib._sel_compare_1, otherNumber?._id ?? ffi.nullptr); + } + + bool isEqualToNumber_(NSNumber? number) { + return _lib._objc_msgSend_223( + _id, _lib._sel_isEqualToNumber_1, number?._id ?? ffi.nullptr); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithChar_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_202( + _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedChar_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_203( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithShort_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_204( + _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedShort_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_205( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithInt_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_206( + _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedInt_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_207( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithLong_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_208( + _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedLong_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_209( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithLongLong_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_210( + _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedLongLong_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_211( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithFloat_(SentryCocoa _lib, double value) { + final _ret = _lib._objc_msgSend_212( + _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithDouble_(SentryCocoa _lib, double value) { + final _ret = _lib._objc_msgSend_213( + _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithBool_(SentryCocoa _lib, bool value) { + final _ret = _lib._objc_msgSend_214( + _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithInteger_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_208( + _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber numberWithUnsignedInteger_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_209( + _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + @override + NSNumber initWithBytes_objCType_( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_41( + _id, _lib._sel_initWithBytes_objCType_1, value, type); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithBytes_objCType_(SentryCocoa _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43(_lib._class_NSNumber1, + _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue value_withObjCType_(SentryCocoa _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithNonretainedObject_( + SentryCocoa _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_44(_lib._class_NSNumber1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPointer_( + SentryCocoa _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_45( + _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRange_(SentryCocoa _lib, _NSRange range) { + final _ret = _lib._objc_msgSend_48( + _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPoint_(SentryCocoa _lib, CGPoint point) { + final _ret = _lib._objc_msgSend_50( + _lib._class_NSNumber1, _lib._sel_valueWithPoint_1, point); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithSize_(SentryCocoa _lib, CGSize size) { + final _ret = _lib._objc_msgSend_51( + _lib._class_NSNumber1, _lib._sel_valueWithSize_1, size); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRect_(SentryCocoa _lib, CGRect rect) { + final _ret = _lib._objc_msgSend_52( + _lib._class_NSNumber1, _lib._sel_valueWithRect_1, rect); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithEdgeInsets_(SentryCocoa _lib, NSEdgeInsets insets) { + final _ret = _lib._objc_msgSend_53( + _lib._class_NSNumber1, _lib._sel_valueWithEdgeInsets_1, insets); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + @override + NSNumber init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSNumber new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_new1); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static NSNumber allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSNumber1, _lib._sel_allocWithZone_1, zone); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static NSNumber alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_alloc1); + return NSNumber._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSNumber1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSNumber1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumber1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumber1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNumber1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNumber1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSNumber1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSNumber1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNumber1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSValue extends NSObject { + NSValue._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSValue] that points to the same underlying object as [other]. + static NSValue castFrom(T other) { + return NSValue._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSValue] that wraps the given raw object pointer. + static NSValue castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSValue._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSValue]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSValue1); + } + + void getValue_size_(ffi.Pointer value, int size) { + _lib._objc_msgSend_21(_id, _lib._sel_getValue_size_1, value, size); + } + + ffi.Pointer get objCType { + return _lib._objc_msgSend_13(_id, _lib._sel_objCType1); + } + + NSValue initWithBytes_objCType_( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_41( + _id, _lib._sel_initWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSValue initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithBytes_objCType_(SentryCocoa _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue value_withObjCType_(SentryCocoa _lib, + ffi.Pointer value, ffi.Pointer type) { + final _ret = _lib._objc_msgSend_43( + _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithNonretainedObject_( + SentryCocoa _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_44(_lib._class_NSValue1, + _lib._sel_valueWithNonretainedObject_1, anObject._id); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + NSObject get nonretainedObjectValue { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_nonretainedObjectValue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithPointer_( + SentryCocoa _lib, ffi.Pointer pointer) { + final _ret = _lib._objc_msgSend_45( + _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer get pointerValue { + return _lib._objc_msgSend_19(_id, _lib._sel_pointerValue1); + } + + bool isEqualToValue_(NSValue? value) { + return _lib._objc_msgSend_46( + _id, _lib._sel_isEqualToValue_1, value?._id ?? ffi.nullptr); + } + + void getValue_(ffi.Pointer value) { + _lib._objc_msgSend_47(_id, _lib._sel_getValue_1, value); + } + + static NSValue valueWithRange_(SentryCocoa _lib, _NSRange range) { + final _ret = _lib._objc_msgSend_48( + _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + void getRangeValue(ffi.Pointer<_NSRange> stret) { + _lib._objc_msgSend_49(stret, _id, _lib._sel_rangeValue1); + } + + static NSValue valueWithPoint_(SentryCocoa _lib, CGPoint point) { + final _ret = _lib._objc_msgSend_50( + _lib._class_NSValue1, _lib._sel_valueWithPoint_1, point); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithSize_(SentryCocoa _lib, CGSize size) { + final _ret = _lib._objc_msgSend_51( + _lib._class_NSValue1, _lib._sel_valueWithSize_1, size); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithRect_(SentryCocoa _lib, CGRect rect) { + final _ret = _lib._objc_msgSend_52( + _lib._class_NSValue1, _lib._sel_valueWithRect_1, rect); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue valueWithEdgeInsets_(SentryCocoa _lib, NSEdgeInsets insets) { + final _ret = _lib._objc_msgSend_53( + _lib._class_NSValue1, _lib._sel_valueWithEdgeInsets_1, insets); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + void getPointValue(ffi.Pointer stret) { + _lib._objc_msgSend_54(stret, _id, _lib._sel_pointValue1); + } + + void getSizeValue(ffi.Pointer stret) { + _lib._objc_msgSend_55(stret, _id, _lib._sel_sizeValue1); + } + + void getRectValue(ffi.Pointer stret) { + _lib._objc_msgSend_56(stret, _id, _lib._sel_rectValue1); + } + + void getEdgeInsetsValue(ffi.Pointer stret) { + _lib._objc_msgSend_57(stret, _id, _lib._sel_edgeInsetsValue1); + } + + @override + NSValue init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSValue._(_ret, _lib, retain: true, release: true); + } + + static NSValue new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_new1); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static NSValue allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSValue1, _lib._sel_allocWithZone_1, zone); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static NSValue alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_alloc1); + return NSValue._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSValue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSValue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSValue1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSValue1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSValue1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSValue1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSValue1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSValue1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSValue1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class CGPoint extends ffi.Struct { + @ffi.Double() + external double x; + + @ffi.Double() + external double y; +} + +class CGSize extends ffi.Struct { + @ffi.Double() + external double width; + + @ffi.Double() + external double height; +} + +class CGRect extends ffi.Struct { + external CGPoint origin; + + external CGSize size; +} + +class NSEdgeInsets extends ffi.Struct { + @ffi.Double() + external double top; + + @ffi.Double() + external double left; + + @ffi.Double() + external double bottom; + + @ffi.Double() + external double right; +} + +class NSArray extends NSObject { + NSArray._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSArray] that points to the same underlying object as [other]. + static NSArray castFrom(T other) { + return NSArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSArray] that wraps the given raw object pointer. + static NSArray castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArray1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectAtIndex_(int index) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndex_1, index); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByAddingObject_(NSObject anObject) { + final _ret = _lib._objc_msgSend_62( + _id, _lib._sel_arrayByAddingObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByAddingObjectsFromArray_(NSArray? otherArray) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_arrayByAddingObjectsFromArray_1, + otherArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString componentsJoinedByString_(NSString? separator) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_componentsJoinedByString_1, separator?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool containsObject_(NSObject anObject) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, anObject._id); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject firstObjectCommonWithArray_(NSArray? otherArray) { + final _ret = _lib._objc_msgSend_67(_id, + _lib._sel_firstObjectCommonWithArray_1, otherArray?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getObjects_range_( + ffi.Pointer> objects, _NSRange range) { + _lib._objc_msgSend_68(_id, _lib._sel_getObjects_range_1, objects, range); + } + + int indexOfObject_(NSObject anObject) { + return _lib._objc_msgSend_69(_id, _lib._sel_indexOfObject_1, anObject._id); + } + + int indexOfObject_inRange_(NSObject anObject, _NSRange range) { + return _lib._objc_msgSend_70( + _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); + } + + int indexOfObjectIdenticalTo_(NSObject anObject) { + return _lib._objc_msgSend_69( + _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); + } + + int indexOfObjectIdenticalTo_inRange_(NSObject anObject, _NSRange range) { + return _lib._objc_msgSend_70( + _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); + } + + bool isEqualToArray_(NSArray? otherArray) { + return _lib._objc_msgSend_71( + _id, _lib._sel_isEqualToArray_1, otherArray?._id ?? ffi.nullptr); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator reverseObjectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_reverseObjectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSData? get sortedArrayHint { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_sortedArrayHint1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context) { + final _ret = _lib._objc_msgSend_73( + _id, _lib._sel_sortedArrayUsingFunction_context_1, comparator, context); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingFunction_context_hint_( + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + NSData? hint) { + final _ret = _lib._objc_msgSend_74( + _id, + _lib._sel_sortedArrayUsingFunction_context_hint_1, + comparator, + context, + hint?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingSelector_(ffi.Pointer comparator) { + final _ret = _lib._objc_msgSend_75( + _id, _lib._sel_sortedArrayUsingSelector_1, comparator); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray subarrayWithRange_(_NSRange range) { + final _ret = + _lib._objc_msgSend_76(_id, _lib._sel_subarrayWithRange_1, range); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_83( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + _lib._objc_msgSend_7( + _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); + } + + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, NSObject argument) { + _lib._objc_msgSend_84( + _id, + _lib._sel_makeObjectsPerformSelector_withObject_1, + aSelector, + argument._id); + } + + NSArray objectsAtIndexes_(NSIndexSet? indexes) { + final _ret = _lib._objc_msgSend_105( + _id, _lib._sel_objectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject objectAtIndexedSubscript_(int idx) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_( + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_106( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock_( + int opts, ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_107(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateObjectsAtIndexes_options_usingBlock_(NSIndexSet? s, int opts, + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_108( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._id); + } + + int indexOfObjectPassingTest_( + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_109( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + } + + int indexOfObjectWithOptions_passingTest_( + int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_110(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + } + + int indexOfObjectAtIndexes_options_passingTest_(NSIndexSet? s, int opts, + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_111( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + } + + NSIndexSet indexesOfObjectsPassingTest_( + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_112( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest_( + int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_113( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_(NSIndexSet? s, + int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_114( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayUsingComparator_( + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + final _ret = _lib._objc_msgSend_115( + _id, _lib._sel_sortedArrayUsingComparator_1, cmptr._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayWithOptions_usingComparator_( + int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + final _ret = _lib._objc_msgSend_116(_id, + _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_inSortedRange_options_usingComparator_( + NSObject obj, + _NSRange r, + int opts, + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmp) { + return _lib._objc_msgSend_117( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + obj._id, + r, + opts, + cmp._id); + } + + static NSArray array(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_array1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObject_(SentryCocoa _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObjects_count_( + SentryCocoa _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithObjects_(SentryCocoa _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithArray_(SentryCocoa _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithArray_copyItems_(NSArray? array, bool flag) { + final _ret = _lib._objc_msgSend_118(_id, + _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + NSArray initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_119( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_error_(SentryCocoa _lib, NSURL? url, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_119( + _lib._class_NSArray1, + _lib._sel_arrayWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject differenceFromArray_withOptions_usingEquivalenceTest_( + NSArray? other, int options, ObjCBlock_bool_ObjCObject_ObjCObject block) { + final _ret = _lib._objc_msgSend_120( + _id, + _lib._sel_differenceFromArray_withOptions_usingEquivalenceTest_1, + other?._id ?? ffi.nullptr, + options, + block._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject differenceFromArray_withOptions_(NSArray? other, int options) { + final _ret = _lib._objc_msgSend_121( + _id, + _lib._sel_differenceFromArray_withOptions_1, + other?._id ?? ffi.nullptr, + options); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject differenceFromArray_(NSArray? other) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_differenceFromArray_1, other?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray arrayByApplyingDifference_(NSObject? difference) { + final _ret = _lib._objc_msgSend_62(_id, + _lib._sel_arrayByApplyingDifference_1, difference?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_(ffi.Pointer> objects) { + _lib._objc_msgSend_122(_id, _lib._sel_getObjects_1, objects); + } + + static NSArray arrayWithContentsOfFile_(SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_123(_lib._class_NSArray1, + _lib._sel_arrayWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray arrayWithContentsOfURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_124(_lib._class_NSArray1, + _lib._sel_arrayWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_124( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_125(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + NSArray pathsMatchingExtensions_(NSArray? filterTypes) { + final _ret = _lib._objc_msgSend_63(_id, _lib._sel_pathsMatchingExtensions_1, + filterTypes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + void addObserver_toObjectsAtIndexes_forKeyPath_options_context_( + NSObject? observer, + NSIndexSet? indexes, + NSString? keyPath, + int options, + ffi.Pointer context) { + _lib._objc_msgSend_127( + _id, + _lib._sel_addObserver_toObjectsAtIndexes_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + void removeObserver_fromObjectsAtIndexes_forKeyPath_context_( + NSObject? observer, + NSIndexSet? indexes, + NSString? keyPath, + ffi.Pointer context) { + _lib._objc_msgSend_128( + _id, + _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + context); + } + + void removeObserver_fromObjectsAtIndexes_forKeyPath_( + NSObject? observer, NSIndexSet? indexes, NSString? keyPath) { + _lib._objc_msgSend_129( + _id, + _lib._sel_removeObserver_fromObjectsAtIndexes_forKeyPath_1, + observer?._id ?? ffi.nullptr, + indexes?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + _lib._objc_msgSend_130( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + _lib._objc_msgSend_131(_id, _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr, context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + _lib._objc_msgSend_132(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray filteredArrayUsingPredicate_(NSPredicate? predicate) { + final _ret = _lib._objc_msgSend_201(_id, + _lib._sel_filteredArrayUsingPredicate_1, predicate?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_new1); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static NSArray allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSArray1, _lib._sel_allocWithZone_1, zone); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static NSArray alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_alloc1); + return NSArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArray1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSError extends NSObject { + NSError._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSError] that points to the same underlying object as [other]. + static NSError castFrom(T other) { + return NSError._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSError] that wraps the given raw object pointer. + static NSError castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSError._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSError]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSError1); + } + + NSError initWithDomain_code_userInfo_( + NSString domain, int code, NSObject? dict) { + final _ret = _lib._objc_msgSend_77( + _id, + _lib._sel_initWithDomain_code_userInfo_1, + domain._id, + code, + dict?._id ?? ffi.nullptr); + return NSError._(_ret, _lib, retain: true, release: true); + } + + static NSError errorWithDomain_code_userInfo_( + SentryCocoa _lib, NSString domain, int code, NSObject? dict) { + final _ret = _lib._objc_msgSend_77( + _lib._class_NSError1, + _lib._sel_errorWithDomain_code_userInfo_1, + domain._id, + code, + dict?._id ?? ffi.nullptr); + return NSError._(_ret, _lib, retain: true, release: true); + } + + NSString get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int get code { + return _lib._objc_msgSend_78(_id, _lib._sel_code1); + } + + NSObject? get userInfo { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedFailureReason { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedFailureReason1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedRecoverySuggestion { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedRecoverySuggestion1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localizedRecoveryOptions { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_localizedRecoveryOptions1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject get recoveryAttempter { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_recoveryAttempter1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString? get helpAnchor { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_helpAnchor1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get underlyingErrors { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_underlyingErrors1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static void setUserInfoValueProviderForDomain_provider_(SentryCocoa _lib, + NSString errorDomain, ObjCBlock_ObjCObject_NSError_NSString provider) { + _lib._objc_msgSend_80( + _lib._class_NSError1, + _lib._sel_setUserInfoValueProviderForDomain_provider_1, + errorDomain._id, + provider._id); + } + + static ObjCBlock_ObjCObject_NSError_NSString userInfoValueProviderForDomain_( + SentryCocoa _lib, + NSError? err, + NSString userInfoKey, + NSString errorDomain) { + final _ret = _lib._objc_msgSend_81( + _lib._class_NSError1, + _lib._sel_userInfoValueProviderForDomain_1, + err?._id ?? ffi.nullptr, + userInfoKey._id, + errorDomain._id); + return ObjCBlock_ObjCObject_NSError_NSString._(_ret, _lib); + } + + @override + NSError init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSError._(_ret, _lib, retain: true, release: true); + } + + static NSError new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_new1); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static NSError allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSError1, _lib._sel_allocWithZone_1, zone); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static NSError alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_alloc1); + return NSError._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSError1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSError1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSError1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSError1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSError1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSError1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSError1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSError1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSError1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class _ObjCBlockBase implements ffi.Finalizable { + final ffi.Pointer<_ObjCBlock> _id; + final SentryCocoa _lib; + bool _pendingRelease; + + _ObjCBlockBase._(this._id, this._lib, + {bool retain = false, bool release = false}) + : _pendingRelease = release { + if (retain) { + _lib._Block_copy(_id.cast()); + } + if (release) { + _lib._objc_releaseFinalizer11.attach(this, _id.cast(), detach: this); + } + } + + /// Releases the reference to the underlying ObjC block held by this wrapper. + /// Throws a StateError if this wrapper doesn't currently hold a reference. + void release() { + if (_pendingRelease) { + _pendingRelease = false; + _lib._Block_release(_id.cast()); + _lib._objc_releaseFinalizer11.detach(this); + } else { + throw StateError( + 'Released an ObjC block that was unowned or already released.'); + } + } + + @override + bool operator ==(Object other) { + return other is _ObjCBlockBase && _id == other._id; + } + + @override + int get hashCode => _id.hashCode; + + /// Return a pointer to this object. + ffi.Pointer<_ObjCBlock> get pointer => _id; +} + +ffi.Pointer _ObjCBlock_ObjCObject_NSError_NSString_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ObjCObject_NSError_NSString_closureRegistry = + {}; +int _ObjCBlock_ObjCObject_NSError_NSString_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ObjCObject_NSError_NSString_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ObjCObject_NSError_NSString_closureRegistryIndex; + _ObjCBlock_ObjCObject_NSError_NSString_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer + _ObjCBlock_ObjCObject_NSError_NSString_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ObjCObject_NSError_NSString_closureRegistry[ + block.ref.target.address] + as ffi.Pointer Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ObjCObject_NSError_NSString extends _ObjCBlockBase { + ObjCBlock_ObjCObject_NSError_NSString._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ObjCObject_NSError_NSString.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ObjCObject_NSError_NSString_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ObjCObject_NSError_NSString.fromFunction( + SentryCocoa lib, + ffi.Pointer Function( + ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ObjCObject_NSError_NSString_closureTrampoline) + .cast(), + _ObjCBlock_ObjCObject_NSError_NSString_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + ffi.Pointer call( + ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +class _ObjCBlockDesc extends ffi.Struct { + @ffi.UnsignedLong() + external int reserved; + + @ffi.UnsignedLong() + external int size; + + external ffi.Pointer copy_helper; + + external ffi.Pointer dispose_helper; + + external ffi.Pointer signature; +} + +class _ObjCBlock extends ffi.Struct { + external ffi.Pointer isa; + + @ffi.Int() + external int flags; + + @ffi.Int() + external int reserved; + + external ffi.Pointer invoke; + + external ffi.Pointer<_ObjCBlockDesc> descriptor; + + external ffi.Pointer target; +} + +class NSIndexSet extends NSObject { + NSIndexSet._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSIndexSet] that points to the same underlying object as [other]. + static NSIndexSet castFrom(T other) { + return NSIndexSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSIndexSet] that wraps the given raw object pointer. + static NSIndexSet castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSIndexSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSIndexSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexSet1); + } + + static NSIndexSet indexSet(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_indexSet1); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet indexSetWithIndex_(SentryCocoa _lib, int value) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet indexSetWithIndexesInRange_( + SentryCocoa _lib, _NSRange range) { + final _ret = _lib._objc_msgSend_85( + _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndexesInRange_(_NSRange range) { + final _ret = + _lib._objc_msgSend_85(_id, _lib._sel_initWithIndexesInRange_1, range); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndexSet_(NSIndexSet? indexSet) { + final _ret = _lib._objc_msgSend_86( + _id, _lib._sel_initWithIndexSet_1, indexSet?._id ?? ffi.nullptr); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet initWithIndex_(int value) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, value); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToIndexSet_(NSIndexSet? indexSet) { + return _lib._objc_msgSend_87( + _id, _lib._sel_isEqualToIndexSet_1, indexSet?._id ?? ffi.nullptr); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + int get firstIndex { + return _lib._objc_msgSend_10(_id, _lib._sel_firstIndex1); + } + + int get lastIndex { + return _lib._objc_msgSend_10(_id, _lib._sel_lastIndex1); + } + + int indexGreaterThanIndex_(int value) { + return _lib._objc_msgSend_88(_id, _lib._sel_indexGreaterThanIndex_1, value); + } + + int indexLessThanIndex_(int value) { + return _lib._objc_msgSend_88(_id, _lib._sel_indexLessThanIndex_1, value); + } + + int indexGreaterThanOrEqualToIndex_(int value) { + return _lib._objc_msgSend_88( + _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); + } + + int indexLessThanOrEqualToIndex_(int value) { + return _lib._objc_msgSend_88( + _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); + } + + int getIndexes_maxCount_inIndexRange_( + ffi.Pointer indexBuffer, + int bufferSize, + ffi.Pointer<_NSRange> range) { + return _lib._objc_msgSend_89( + _id, + _lib._sel_getIndexes_maxCount_inIndexRange_1, + indexBuffer, + bufferSize, + range); + } + + int countOfIndexesInRange_(_NSRange range) { + return _lib._objc_msgSend_90(_id, _lib._sel_countOfIndexesInRange_1, range); + } + + bool containsIndex_(int value) { + return _lib._objc_msgSend_91(_id, _lib._sel_containsIndex_1, value); + } + + bool containsIndexesInRange_(_NSRange range) { + return _lib._objc_msgSend_92( + _id, _lib._sel_containsIndexesInRange_1, range); + } + + bool containsIndexes_(NSIndexSet? indexSet) { + return _lib._objc_msgSend_87( + _id, _lib._sel_containsIndexes_1, indexSet?._id ?? ffi.nullptr); + } + + bool intersectsIndexesInRange_(_NSRange range) { + return _lib._objc_msgSend_92( + _id, _lib._sel_intersectsIndexesInRange_1, range); + } + + void enumerateIndexesUsingBlock_( + ObjCBlock_ffiVoid_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_93( + _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); + } + + void enumerateIndexesWithOptions_usingBlock_( + int opts, ObjCBlock_ffiVoid_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_94(_id, + _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateIndexesInRange_options_usingBlock_( + _NSRange range, int opts, ObjCBlock_ffiVoid_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_95( + _id, + _lib._sel_enumerateIndexesInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + int indexPassingTest_(ObjCBlock_bool_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_96( + _id, _lib._sel_indexPassingTest_1, predicate._id); + } + + int indexWithOptions_passingTest_( + int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_97( + _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); + } + + int indexInRange_options_passingTest_( + _NSRange range, int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_98( + _id, + _lib._sel_indexInRange_options_passingTest_1, + range, + opts, + predicate._id); + } + + NSIndexSet indexesPassingTest_( + ObjCBlock_bool_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_99( + _id, _lib._sel_indexesPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesWithOptions_passingTest_( + int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_100( + _id, _lib._sel_indexesWithOptions_passingTest_1, opts, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesInRange_options_passingTest_( + _NSRange range, int opts, ObjCBlock_bool_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_101( + _id, + _lib._sel_indexesInRange_options_passingTest_1, + range, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateRangesUsingBlock_(ObjCBlock_ffiVoid_NSRange_bool block) { + _lib._objc_msgSend_102( + _id, _lib._sel_enumerateRangesUsingBlock_1, block._id); + } + + void enumerateRangesWithOptions_usingBlock_( + int opts, ObjCBlock_ffiVoid_NSRange_bool block) { + _lib._objc_msgSend_103(_id, + _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateRangesInRange_options_usingBlock_( + _NSRange range, int opts, ObjCBlock_ffiVoid_NSRange_bool block) { + _lib._objc_msgSend_104( + _id, + _lib._sel_enumerateRangesInRange_options_usingBlock_1, + range, + opts, + block._id); + } + + @override + NSIndexSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + static NSIndexSet new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_new1); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static NSIndexSet allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSIndexSet1, _lib._sel_allocWithZone_1, zone); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static NSIndexSet alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_alloc1); + return NSIndexSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSIndexSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSIndexSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSIndexSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSIndexSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSIndexSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSIndexSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSIndexSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() + .asFunction arg1)>()( + arg0, arg1); +} + +final _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureRegistry[block + .ref + .target + .address] as void Function(int, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_ffiUnsignedLong_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ffiUnsignedLong_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ffiUnsignedLong_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.UnsignedLong arg0, ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.UnsignedLong arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ffiUnsignedLong_bool.fromFunction( + SentryCocoa lib, void Function(int arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.UnsignedLong arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ffiUnsignedLong_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(int arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, int arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSEnumerationOptions { + static const int NSEnumerationConcurrent = 1; + static const int NSEnumerationReverse = 2; +} + +bool _ObjCBlock_bool_ffiUnsignedLong_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() + .asFunction arg1)>()( + arg0, arg1); +} + +final _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistry = {}; +int _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_bool_ffiUnsignedLong_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistryIndex; + _ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_ffiUnsignedLong_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) { + return (_ObjCBlock_bool_ffiUnsignedLong_bool_closureRegistry[block.ref.target + .address] as bool Function(int, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_bool_ffiUnsignedLong_bool extends _ObjCBlockBase { + ObjCBlock_bool_ffiUnsignedLong_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_ffiUnsignedLong_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.UnsignedLong arg0, ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.UnsignedLong arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ffiUnsignedLong_bool_fnPtrTrampoline, + false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_ffiUnsignedLong_bool.fromFunction( + SentryCocoa lib, bool Function(int arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.UnsignedLong arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ffiUnsignedLong_bool_closureTrampoline, + false) + .cast(), + _ObjCBlock_bool_ffiUnsignedLong_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call(int arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, + ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer<_ObjCBlock> block, int arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +void _ObjCBlock_ffiVoid_NSRange_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, _NSRange arg0, ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(_NSRange arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function( + _NSRange arg0, ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSRange_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSRange_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, _NSRange arg0, ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_NSRange_bool_closureRegistry[block.ref.target + .address] as void Function(_NSRange, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_NSRange_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSRange_bool._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSRange_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(_NSRange arg0, ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + _NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSRange_bool.fromFunction(SentryCocoa lib, + void Function(_NSRange arg0, ffi.Pointer arg1) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + _NSRange arg0, ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSRange_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(_NSRange arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, _NSRange arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, _NSRange arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +void _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, int, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1, ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +bool _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1, ffi.Pointer arg2)>>() + .asFunction< + bool Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistry = + {}; +int _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistryIndex; + _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureRegistry[ + block.ref.target.address] + as bool Function(ffi.Pointer, int, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool extends _ObjCBlockBase { + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1, ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>( + _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_fnPtrTrampoline, + false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool.fromFunction( + SentryCocoa lib, + bool Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>( + _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_closureTrampoline, + false) + .cast(), + _ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry = + {}; +int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistryIndex = + 0; +ffi.Pointer + _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistryIndex; + _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry[ + block.ref.target.address] + as int Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject + extends _ObjCBlockBase { + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_fnPtrTrampoline, + 0) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject.fromFunction( + SentryCocoa lib, + int Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureTrampoline, + 0) + .cast(), + _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + int call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSComparisonResult { + static const int NSOrderedAscending = -1; + static const int NSOrderedSame = 0; + static const int NSOrderedDescending = 1; +} + +abstract class NSSortOptions { + static const int NSSortConcurrent = 1; + static const int NSSortStable = 16; +} + +abstract class NSBinarySearchingOptions { + static const int NSBinarySearchingFirstEqual = 256; + static const int NSBinarySearchingLastEqual = 512; + static const int NSBinarySearchingInsertionIndex = 1024; +} + +abstract class NSOrderedCollectionDifferenceCalculationOptions { + static const int NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = + 1; + static const int NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = + 2; + static const int NSOrderedCollectionDifferenceCalculationInferMoves = 4; +} + +bool _ObjCBlock_bool_ObjCObject_ObjCObject_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry = {}; +int _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_bool_ObjCObject_ObjCObject_registerClosure( + Function fn) { + final id = ++_ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistryIndex; + _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_ObjCObject_ObjCObject_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry[ + block.ref.target.address] + as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_bool_ObjCObject_ObjCObject extends _ObjCBlockBase { + ObjCBlock_bool_ObjCObject_ObjCObject._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_ObjCObject_ObjCObject.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ObjCObject_ObjCObject_fnPtrTrampoline, + false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_ObjCObject_ObjCObject.fromFunction( + SentryCocoa lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ObjCObject_ObjCObject_closureTrampoline, + false) + .cast(), + _ObjCBlock_bool_ObjCObject_ObjCObject_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSKeyValueObservingOptions { + static const int NSKeyValueObservingOptionNew = 1; + static const int NSKeyValueObservingOptionOld = 2; + static const int NSKeyValueObservingOptionInitial = 4; + static const int NSKeyValueObservingOptionPrior = 8; +} + +class NSPredicate extends NSObject { + NSPredicate._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPredicate] that points to the same underlying object as [other]. + static NSPredicate castFrom(T other) { + return NSPredicate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPredicate] that wraps the given raw object pointer. + static NSPredicate castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPredicate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPredicate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPredicate1); + } + + static NSPredicate predicateWithFormat_argumentArray_( + SentryCocoa _lib, NSString? predicateFormat, NSArray? arguments) { + final _ret = _lib._objc_msgSend_133( + _lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_argumentArray_1, + predicateFormat?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithFormat_( + SentryCocoa _lib, NSString? predicateFormat) { + final _ret = _lib._objc_msgSend_134(_lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_1, predicateFormat?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithFormat_arguments_(SentryCocoa _lib, + NSString? predicateFormat, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_135( + _lib._class_NSPredicate1, + _lib._sel_predicateWithFormat_arguments_1, + predicateFormat?._id ?? ffi.nullptr, + argList); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateFromMetadataQueryString_( + SentryCocoa _lib, NSString? queryString) { + final _ret = _lib._objc_msgSend_134( + _lib._class_NSPredicate1, + _lib._sel_predicateFromMetadataQueryString_1, + queryString?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithValue_(SentryCocoa _lib, bool value) { + final _ret = _lib._objc_msgSend_136( + _lib._class_NSPredicate1, _lib._sel_predicateWithValue_1, value); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate predicateWithBlock_( + SentryCocoa _lib, ObjCBlock_bool_ObjCObject_NSDictionary block) { + final _ret = _lib._objc_msgSend_199( + _lib._class_NSPredicate1, _lib._sel_predicateWithBlock_1, block._id); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + NSString? get predicateFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_predicateFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSPredicate predicateWithSubstitutionVariables_(NSDictionary? variables) { + final _ret = _lib._objc_msgSend_149( + _id, + _lib._sel_predicateWithSubstitutionVariables_1, + variables?._id ?? ffi.nullptr); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + bool evaluateWithObject_(NSObject object) { + return _lib._objc_msgSend_0( + _id, _lib._sel_evaluateWithObject_1, object._id); + } + + bool evaluateWithObject_substitutionVariables_( + NSObject object, NSDictionary? bindings) { + return _lib._objc_msgSend_200( + _id, + _lib._sel_evaluateWithObject_substitutionVariables_1, + object._id, + bindings?._id ?? ffi.nullptr); + } + + void allowEvaluation() { + _lib._objc_msgSend_1(_id, _lib._sel_allowEvaluation1); + } + + @override + NSPredicate init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSPredicate._(_ret, _lib, retain: true, release: true); + } + + static NSPredicate new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_new1); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static NSPredicate allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSPredicate1, _lib._sel_allocWithZone_1, zone); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static NSPredicate alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPredicate1, _lib._sel_alloc1); + return NSPredicate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSPredicate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSPredicate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPredicate1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPredicate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPredicate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPredicate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSPredicate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSPredicate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPredicate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class __va_list_tag extends ffi.Struct { + @ffi.UnsignedInt() + external int gp_offset; + + @ffi.UnsignedInt() + external int fp_offset; + + external ffi.Pointer overflow_arg_area; + + external ffi.Pointer reg_save_area; +} + +bool _ObjCBlock_bool_ObjCObject_NSDictionary_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistry = + {}; +int _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_bool_ObjCObject_NSDictionary_registerClosure( + Function fn) { + final id = ++_ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistryIndex; + _ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_ObjCObject_NSDictionary_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_bool_ObjCObject_NSDictionary_closureRegistry[ + block.ref.target.address] + as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_bool_ObjCObject_NSDictionary extends _ObjCBlockBase { + ObjCBlock_bool_ObjCObject_NSDictionary._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_ObjCObject_NSDictionary.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ObjCObject_NSDictionary_fnPtrTrampoline, + false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_ObjCObject_NSDictionary.fromFunction( + SentryCocoa lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ObjCObject_NSDictionary_closureTrampoline, + false) + .cast(), + _ObjCBlock_bool_ObjCObject_NSDictionary_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +class NSDictionary extends NSObject { + NSDictionary._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDictionary] that points to the same underlying object as [other]. + static NSDictionary castFrom(T other) { + return NSDictionary._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSDictionary] that wraps the given raw object pointer. + static NSDictionary castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDictionary._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDictionary]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDictionary1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectForKey_(NSObject aKey) { + final _ret = _lib._objc_msgSend_16(_id, _lib._sel_objectForKey_1, aKey._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator keyEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_keyEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + @override + NSDictionary init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithObjects_forKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_137( + _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_allKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray allKeysForObject_(NSObject anObject) { + final _ret = + _lib._objc_msgSend_62(_id, _lib._sel_allKeysForObject_1, anObject._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allValues { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_allValues1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get descriptionInStringsFileFormat { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_descriptionInStringsFileFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToDictionary_(NSDictionary? otherDictionary) { + return _lib._objc_msgSend_138(_id, _lib._sel_isEqualToDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForKeys_notFoundMarker_(NSArray? keys, NSObject marker) { + final _ret = _lib._objc_msgSend_139( + _id, + _lib._sel_objectsForKeys_notFoundMarker_1, + keys?._id ?? ffi.nullptr, + marker._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool writeToURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_83( + _id, _lib._sel_writeToURL_error_1, url?._id ?? ffi.nullptr, error); + } + + NSArray keysSortedByValueUsingSelector_(ffi.Pointer comparator) { + final _ret = _lib._objc_msgSend_75( + _id, _lib._sel_keysSortedByValueUsingSelector_1, comparator); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void getObjects_andKeys_count_(ffi.Pointer> objects, + ffi.Pointer> keys, int count) { + _lib._objc_msgSend_140( + _id, _lib._sel_getObjects_andKeys_count_1, objects, keys, count); + } + + NSObject objectForKeyedSubscript_(NSObject key) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_objectForKeyedSubscript_1, key._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void enumerateKeysAndObjectsUsingBlock_( + ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool block) { + _lib._objc_msgSend_141( + _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._id); + } + + void enumerateKeysAndObjectsWithOptions_usingBlock_( + int opts, ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool block) { + _lib._objc_msgSend_142( + _id, + _lib._sel_enumerateKeysAndObjectsWithOptions_usingBlock_1, + opts, + block._id); + } + + NSArray keysSortedByValueUsingComparator_( + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + final _ret = _lib._objc_msgSend_115( + _id, _lib._sel_keysSortedByValueUsingComparator_1, cmptr._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray keysSortedByValueWithOptions_usingComparator_( + int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + final _ret = _lib._objc_msgSend_116( + _id, + _lib._sel_keysSortedByValueWithOptions_usingComparator_1, + opts, + cmptr._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject keysOfEntriesPassingTest_( + ObjCBlock_bool_ObjCObject_ObjCObject_bool predicate) { + final _ret = _lib._objc_msgSend_143( + _id, _lib._sel_keysOfEntriesPassingTest_1, predicate._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject keysOfEntriesWithOptions_passingTest_( + int opts, ObjCBlock_bool_ObjCObject_ObjCObject_bool predicate) { + final _ret = _lib._objc_msgSend_144(_id, + _lib._sel_keysOfEntriesWithOptions_passingTest_1, opts, predicate._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void getObjects_andKeys_(ffi.Pointer> objects, + ffi.Pointer> keys) { + _lib._objc_msgSend_145(_id, _lib._sel_getObjects_andKeys_1, objects, keys); + } + + static NSDictionary dictionaryWithContentsOfFile_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_146(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_( + SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_147(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_146( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_147( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool writeToFile_atomically_(NSString? path, bool useAuxiliaryFile) { + return _lib._objc_msgSend_25(_id, _lib._sel_writeToFile_atomically_1, + path?._id ?? ffi.nullptr, useAuxiliaryFile); + } + + bool writeToURL_atomically_(NSURL? url, bool atomically) { + return _lib._objc_msgSend_125(_id, _lib._sel_writeToURL_atomically_1, + url?._id ?? ffi.nullptr, atomically); + } + + static NSDictionary dictionary(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_dictionary1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObject_forKey_( + SentryCocoa _lib, NSObject object, NSObject? key) { + final _ret = _lib._objc_msgSend_148( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithObject_forKey_1, + object._id, + key?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjects_forKeys_count_( + SentryCocoa _lib, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_137(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjectsAndKeys_( + SentryCocoa _lib, NSObject firstObject) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithDictionary_( + SentryCocoa _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_149(_lib._class_NSDictionary1, + _lib._sel_dictionaryWithDictionary_1, dict?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithObjects_forKeys_( + SentryCocoa _lib, NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_150( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithObjectsAndKeys_(NSObject firstObject) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithDictionary_(NSDictionary? otherDictionary) { + final _ret = _lib._objc_msgSend_149(_id, _lib._sel_initWithDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithDictionary_copyItems_( + NSDictionary? otherDictionary, bool flag) { + final _ret = _lib._objc_msgSend_151( + _id, + _lib._sel_initWithDictionary_copyItems_1, + otherDictionary?._id ?? ffi.nullptr, + flag); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + NSDictionary initWithObjects_forKeys_(NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_150( + _id, + _lib._sel_initWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary initWithContentsOfURL_error_( + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_152( + _id, + _lib._sel_initWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_error_(SentryCocoa _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_152( + _lib._class_NSDictionary1, + _lib._sel_dictionaryWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSObject sharedKeySetForKeys_(SentryCocoa _lib, NSArray? keys) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSDictionary1, + _lib._sel_sharedKeySetForKeys_1, keys?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int countByEnumeratingWithState_objects_count_( + ffi.Pointer state, + ffi.Pointer> buffer, + int len) { + return _lib._objc_msgSend_153( + _id, + _lib._sel_countByEnumeratingWithState_objects_count_1, + state, + buffer, + len); + } + + int fileSize() { + return _lib._objc_msgSend_154(_id, _lib._sel_fileSize1); + } + + NSDate fileModificationDate() { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_fileModificationDate1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSString fileType() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileType1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int filePosixPermissions() { + return _lib._objc_msgSend_10(_id, _lib._sel_filePosixPermissions1); + } + + NSString fileOwnerAccountName() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileOwnerAccountName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString fileGroupOwnerAccountName() { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_fileGroupOwnerAccountName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int fileSystemNumber() { + return _lib._objc_msgSend_78(_id, _lib._sel_fileSystemNumber1); + } + + int fileSystemFileNumber() { + return _lib._objc_msgSend_10(_id, _lib._sel_fileSystemFileNumber1); + } + + bool fileExtensionHidden() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileExtensionHidden1); + } + + int fileHFSCreatorCode() { + return _lib._objc_msgSend_197(_id, _lib._sel_fileHFSCreatorCode1); + } + + int fileHFSTypeCode() { + return _lib._objc_msgSend_197(_id, _lib._sel_fileHFSTypeCode1); + } + + bool fileIsImmutable() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileIsImmutable1); + } + + bool fileIsAppendOnly() { + return _lib._objc_msgSend_12(_id, _lib._sel_fileIsAppendOnly1); + } + + NSDate fileCreationDate() { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_fileCreationDate1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSNumber fileOwnerAccountID() { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_fileOwnerAccountID1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + NSNumber fileGroupOwnerAccountID() { + final _ret = + _lib._objc_msgSend_198(_id, _lib._sel_fileGroupOwnerAccountID1); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_new1); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSDictionary allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSDictionary1, _lib._sel_allocWithZone_1, zone); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSDictionary alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_alloc1); + return NSDictionary._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDictionary1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDictionary1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDictionary1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDictionary1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSDictionary1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSDictionary1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDictionary1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure(Function fn) { + final id = + ++_ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +bool _ObjCBlock_bool_ObjCObject_ObjCObject_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1, ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry = + {}; +int _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_bool_ObjCObject_ObjCObject_bool_registerClosure(Function fn) { + final id = ++_ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistryIndex; + _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry[ + block.ref.target.address] + as bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_bool_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { + ObjCBlock_bool_ObjCObject_ObjCObject_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_ObjCObject_ObjCObject_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_bool_ObjCObject_ObjCObject_bool_fnPtrTrampoline, + false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_ObjCObject_ObjCObject_bool.fromFunction( + SentryCocoa lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureTrampoline, + false) + .cast(), + _ObjCBlock_bool_ObjCObject_ObjCObject_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSFastEnumerationState extends ffi.Struct { + @ffi.UnsignedLong() + external int state; + + external ffi.Pointer> itemsPtr; + + external ffi.Pointer mutationsPtr; + + @ffi.Array.multi([5]) + external ffi.Array extra; +} + +class NSDate extends NSObject { + NSDate._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDate] that points to the same underlying object as [other]. + static NSDate castFrom(T other) { + return NSDate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSDate] that wraps the given raw object pointer. + static NSDate castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSDate1); + } + + double get timeIntervalSinceReferenceDate { + return _lib._objc_msgSend_155( + _id, _lib._sel_timeIntervalSinceReferenceDate1); + } + + @override + NSDate init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSinceReferenceDate_(double ti) { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + double timeIntervalSinceDate_(NSDate? anotherDate) { + return _lib._objc_msgSend_157(_id, _lib._sel_timeIntervalSinceDate_1, + anotherDate?._id ?? ffi.nullptr); + } + + double get timeIntervalSinceNow { + return _lib._objc_msgSend_155(_id, _lib._sel_timeIntervalSinceNow1); + } + + double get timeIntervalSince1970 { + return _lib._objc_msgSend_155(_id, _lib._sel_timeIntervalSince19701); + } + + NSObject addTimeInterval_(double seconds) { + final _ret = + _lib._objc_msgSend_156(_id, _lib._sel_addTimeInterval_1, seconds); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingTimeInterval_(double ti) { + final _ret = + _lib._objc_msgSend_156(_id, _lib._sel_dateByAddingTimeInterval_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate earlierDate_(NSDate? anotherDate) { + final _ret = _lib._objc_msgSend_158( + _id, _lib._sel_earlierDate_1, anotherDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate laterDate_(NSDate? anotherDate) { + final _ret = _lib._objc_msgSend_158( + _id, _lib._sel_laterDate_1, anotherDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + int compare_(NSDate? other) { + return _lib._objc_msgSend_159( + _id, _lib._sel_compare_1, other?._id ?? ffi.nullptr); + } + + bool isEqualToDate_(NSDate? otherDate) { + return _lib._objc_msgSend_160( + _id, _lib._sel_isEqualToDate_1, otherDate?._id ?? ffi.nullptr); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSDate date(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_date1); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSinceNow_(SentryCocoa _lib, double secs) { + final _ret = _lib._objc_msgSend_156( + _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSinceNow_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSinceReferenceDate_( + SentryCocoa _lib, double ti) { + final _ret = _lib._objc_msgSend_156(_lib._class_NSDate1, + _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeIntervalSince1970_(SentryCocoa _lib, double secs) { + final _ret = _lib._objc_msgSend_156( + _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSince1970_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate dateWithTimeInterval_sinceDate_( + SentryCocoa _lib, double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_161( + _lib._class_NSDate1, + _lib._sel_dateWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantFuture(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_162(_lib._class_NSDate1, _lib._sel_distantFuture1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantPast(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_162(_lib._class_NSDate1, _lib._sel_distantPast1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getNow(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_162(_lib._class_NSDate1, _lib._sel_now1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSinceNow_(double secs) { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeIntervalSince1970_(double secs) { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate initWithTimeInterval_sinceDate_(double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_161( + _id, + _lib._sel_initWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_locale_( + SentryCocoa _lib, NSString? string, NSObject locale) { + final _ret = _lib._objc_msgSend_163( + _lib._class_NSDate1, + _lib._sel_dateWithNaturalLanguageString_locale_1, + string?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSDate1, + _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_(SentryCocoa _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSDate1, + _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarDate dateWithCalendarFormat_timeZone_( + NSString? format, NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_195( + _id, + _lib._sel_dateWithCalendarFormat_timeZone_1, + format?._id ?? ffi.nullptr, + aTimeZone?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_timeZone_locale_( + NSString? format, NSTimeZone? aTimeZone, NSObject locale) { + final _ret = _lib._objc_msgSend_196( + _id, + _lib._sel_descriptionWithCalendarFormat_timeZone_locale_1, + format?._id ?? ffi.nullptr, + aTimeZone?._id ?? ffi.nullptr, + locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_(NSString? description) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, description?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSDate new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_new1); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static NSDate allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSDate1, _lib._sel_allocWithZone_1, zone); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static NSDate alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_alloc1); + return NSDate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDate1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSDate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSDate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSCalendarDate extends NSDate { + NSCalendarDate._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCalendarDate] that points to the same underlying object as [other]. + static NSCalendarDate castFrom(T other) { + return NSCalendarDate._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCalendarDate] that wraps the given raw object pointer. + static NSCalendarDate castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCalendarDate._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCalendarDate]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCalendarDate1); + } + + static NSObject calendarDate(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendarDate1, _lib._sel_calendarDate1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_calendarFormat_locale_(SentryCocoa _lib, + NSString? description, NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_164( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithString_calendarFormat_locale_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_calendarFormat_( + SentryCocoa _lib, NSString? description, NSString? format) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithString_calendarFormat_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithYear_month_day_hour_minute_second_timeZone_( + SentryCocoa _lib, + int year, + int month, + int day, + int hour, + int minute, + int second, + NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_190( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithYear_month_day_hour_minute_second_timeZone_1, + year, + month, + day, + hour, + minute, + second, + aTimeZone?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSCalendarDate dateByAddingYears_months_days_hours_minutes_seconds_( + int year, int month, int day, int hour, int minute, int second) { + final _ret = _lib._objc_msgSend_191( + _id, + _lib._sel_dateByAddingYears_months_days_hours_minutes_seconds_1, + year, + month, + day, + hour, + minute, + second); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + int dayOfCommonEra() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfCommonEra1); + } + + int dayOfMonth() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfMonth1); + } + + int dayOfWeek() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfWeek1); + } + + int dayOfYear() { + return _lib._objc_msgSend_78(_id, _lib._sel_dayOfYear1); + } + + int hourOfDay() { + return _lib._objc_msgSend_78(_id, _lib._sel_hourOfDay1); + } + + int minuteOfHour() { + return _lib._objc_msgSend_78(_id, _lib._sel_minuteOfHour1); + } + + int monthOfYear() { + return _lib._objc_msgSend_78(_id, _lib._sel_monthOfYear1); + } + + int secondOfMinute() { + return _lib._objc_msgSend_78(_id, _lib._sel_secondOfMinute1); + } + + int yearOfCommonEra() { + return _lib._objc_msgSend_78(_id, _lib._sel_yearOfCommonEra1); + } + + NSString calendarFormat() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarFormat1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_locale_( + NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_173( + _id, + _lib._sel_descriptionWithCalendarFormat_locale_1, + format?._id ?? ffi.nullptr, + locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithCalendarFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_descriptionWithCalendarFormat_1, format?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone timeZone() { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_timeZone1); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_calendarFormat_locale_( + NSString? description, NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_164( + _id, + _lib._sel_initWithString_calendarFormat_locale_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithString_calendarFormat_( + NSString? description, NSString? format) { + final _ret = _lib._objc_msgSend_165( + _id, + _lib._sel_initWithString_calendarFormat_1, + description?._id ?? ffi.nullptr, + format?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject initWithString_(NSString? description) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, description?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithYear_month_day_hour_minute_second_timeZone_( + int year, + int month, + int day, + int hour, + int minute, + int second, + NSTimeZone? aTimeZone) { + final _ret = _lib._objc_msgSend_190( + _id, + _lib._sel_initWithYear_month_day_hour_minute_second_timeZone_1, + year, + month, + day, + hour, + minute, + second, + aTimeZone?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void setCalendarFormat_(NSString? format) { + _lib._objc_msgSend_192( + _id, _lib._sel_setCalendarFormat_1, format?._id ?? ffi.nullptr); + } + + void setTimeZone_(NSTimeZone? aTimeZone) { + _lib._objc_msgSend_193( + _id, _lib._sel_setTimeZone_1, aTimeZone?._id ?? ffi.nullptr); + } + + void years_months_days_hours_minutes_seconds_sinceDate_( + ffi.Pointer yp, + ffi.Pointer mop, + ffi.Pointer dp, + ffi.Pointer hp, + ffi.Pointer mip, + ffi.Pointer sp, + NSCalendarDate? date) { + _lib._objc_msgSend_194( + _id, + _lib._sel_years_months_days_hours_minutes_seconds_sinceDate_1, + yp, + mop, + dp, + hp, + mip, + sp, + date?._id ?? ffi.nullptr); + } + + static NSDate? getDistantFuture(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSCalendarDate1, _lib._sel_distantFuture1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getDistantPast(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_162( + _lib._class_NSCalendarDate1, _lib._sel_distantPast1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate initWithTimeIntervalSinceReferenceDate_(double ti) { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate dateByAddingTimeInterval_(double ti) { + final _ret = + _lib._objc_msgSend_156(_id, _lib._sel_dateByAddingTimeInterval_1, ti); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate date(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_date1); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSinceNow_( + SentryCocoa _lib, double secs) { + final _ret = _lib._objc_msgSend_156(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSinceNow_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSinceReferenceDate_( + SentryCocoa _lib, double ti) { + final _ret = _lib._objc_msgSend_156(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeIntervalSince1970_( + SentryCocoa _lib, double secs) { + final _ret = _lib._objc_msgSend_156(_lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeIntervalSince1970_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate dateWithTimeInterval_sinceDate_( + SentryCocoa _lib, double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_161( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSDate? getNow(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_162(_lib._class_NSCalendarDate1, _lib._sel_now1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate initWithTimeIntervalSinceNow_(double secs) { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate initWithTimeIntervalSince1970_(double secs) { + final _ret = _lib._objc_msgSend_156( + _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendarDate initWithTimeInterval_sinceDate_( + double secsToBeAdded, NSDate? date) { + final _ret = _lib._objc_msgSend_161( + _id, + _lib._sel_initWithTimeInterval_sinceDate_1, + secsToBeAdded, + date?._id ?? ffi.nullptr); + return NSCalendarDate._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_locale_( + SentryCocoa _lib, NSString? string, NSObject locale) { + final _ret = _lib._objc_msgSend_163( + _lib._class_NSCalendarDate1, + _lib._sel_dateWithNaturalLanguageString_locale_1, + string?._id ?? ffi.nullptr, + locale._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithNaturalLanguageString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1, + _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject dateWithString_(SentryCocoa _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1, + _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSCalendarDate new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_new1); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static NSCalendarDate allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSCalendarDate1, _lib._sel_allocWithZone_1, zone); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static NSCalendarDate alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_alloc1); + return NSCalendarDate._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSCalendarDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSCalendarDate1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCalendarDate1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendarDate1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCalendarDate1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCalendarDate1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSCalendarDate1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSCalendarDate1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendarDate1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSTimeZone extends NSObject { + NSTimeZone._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTimeZone] that points to the same underlying object as [other]. + static NSTimeZone castFrom(T other) { + return NSTimeZone._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTimeZone] that wraps the given raw object pointer. + static NSTimeZone castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTimeZone._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTimeZone]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimeZone1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + int secondsFromGMTForDate_(NSDate? aDate) { + return _lib._objc_msgSend_166( + _id, _lib._sel_secondsFromGMTForDate_1, aDate?._id ?? ffi.nullptr); + } + + NSString abbreviationForDate_(NSDate? aDate) { + final _ret = _lib._objc_msgSend_167( + _id, _lib._sel_abbreviationForDate_1, aDate?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool isDaylightSavingTimeForDate_(NSDate? aDate) { + return _lib._objc_msgSend_160(_id, _lib._sel_isDaylightSavingTimeForDate_1, + aDate?._id ?? ffi.nullptr); + } + + double daylightSavingTimeOffsetForDate_(NSDate? aDate) { + return _lib._objc_msgSend_157(_id, + _lib._sel_daylightSavingTimeOffsetForDate_1, aDate?._id ?? ffi.nullptr); + } + + NSDate nextDaylightSavingTimeTransitionAfterDate_(NSDate? aDate) { + final _ret = _lib._objc_msgSend_158( + _id, + _lib._sel_nextDaylightSavingTimeTransitionAfterDate_1, + aDate?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone? getSystemTimeZone(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSTimeZone1, _lib._sel_systemTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static void resetSystemTimeZone(SentryCocoa _lib) { + _lib._objc_msgSend_1( + _lib._class_NSTimeZone1, _lib._sel_resetSystemTimeZone1); + } + + static NSTimeZone? getDefaultTimeZone(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSTimeZone1, _lib._sel_defaultTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static void setDefaultTimeZone(SentryCocoa _lib, NSTimeZone? value) { + return _lib._objc_msgSend_169(_lib._class_NSTimeZone1, + _lib._sel_setDefaultTimeZone_1, value?._id ?? ffi.nullptr); + } + + static NSTimeZone? getLocalTimeZone(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_168( + _lib._class_NSTimeZone1, _lib._sel_localTimeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getKnownTimeZoneNames(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSTimeZone1, _lib._sel_knownTimeZoneNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary? getAbbreviationDictionary(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_170( + _lib._class_NSTimeZone1, _lib._sel_abbreviationDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static void setAbbreviationDictionary(SentryCocoa _lib, NSDictionary? value) { + return _lib._objc_msgSend_171(_lib._class_NSTimeZone1, + _lib._sel_setAbbreviationDictionary_1, value?._id ?? ffi.nullptr); + } + + static NSString? getTimeZoneDataVersion(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_NSTimeZone1, _lib._sel_timeZoneDataVersion1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get secondsFromGMT { + return _lib._objc_msgSend_78(_id, _lib._sel_secondsFromGMT1); + } + + NSString? get abbreviation { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_abbreviation1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get daylightSavingTime { + return _lib._objc_msgSend_12(_id, _lib._sel_isDaylightSavingTime1); + } + + double get daylightSavingTimeOffset { + return _lib._objc_msgSend_155(_id, _lib._sel_daylightSavingTimeOffset1); + } + + NSDate? get nextDaylightSavingTimeTransition { + final _ret = _lib._objc_msgSend_162( + _id, _lib._sel_nextDaylightSavingTimeTransition1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToTimeZone_(NSTimeZone? aTimeZone) { + return _lib._objc_msgSend_172( + _id, _lib._sel_isEqualToTimeZone_1, aTimeZone?._id ?? ffi.nullptr); + } + + NSString localizedName_locale_(int style, NSLocale? locale) { + final _ret = _lib._objc_msgSend_187(_id, _lib._sel_localizedName_locale_1, + style, locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithName_(SentryCocoa _lib, NSString? tzName) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSTimeZone1, + _lib._sel_timeZoneWithName_1, tzName?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithName_data_( + SentryCocoa _lib, NSString? tzName, NSData? aData) { + final _ret = _lib._objc_msgSend_188( + _lib._class_NSTimeZone1, + _lib._sel_timeZoneWithName_data_1, + tzName?._id ?? ffi.nullptr, + aData?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone initWithName_(NSString? tzName) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithName_1, tzName?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone initWithName_data_(NSString? tzName, NSData? aData) { + final _ret = _lib._objc_msgSend_188(_id, _lib._sel_initWithName_data_1, + tzName?._id ?? ffi.nullptr, aData?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneForSecondsFromGMT_(SentryCocoa _lib, int seconds) { + final _ret = _lib._objc_msgSend_189(_lib._class_NSTimeZone1, + _lib._sel_timeZoneForSecondsFromGMT_1, seconds); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone timeZoneWithAbbreviation_( + SentryCocoa _lib, NSString? abbreviation) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSTimeZone1, + _lib._sel_timeZoneWithAbbreviation_1, abbreviation?._id ?? ffi.nullptr); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + @override + NSTimeZone init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + static NSTimeZone new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_new1); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static NSTimeZone allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSTimeZone1, _lib._sel_allocWithZone_1, zone); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static NSTimeZone alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSTimeZone1, _lib._sel_alloc1); + return NSTimeZone._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSTimeZone1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSTimeZone1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimeZone1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimeZone1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTimeZone1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTimeZone1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSTimeZone1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSTimeZone1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTimeZone1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTimeZoneNameStyle { + static const int NSTimeZoneNameStyleStandard = 0; + static const int NSTimeZoneNameStyleShortStandard = 1; + static const int NSTimeZoneNameStyleDaylightSaving = 2; + static const int NSTimeZoneNameStyleShortDaylightSaving = 3; + static const int NSTimeZoneNameStyleGeneric = 4; + static const int NSTimeZoneNameStyleShortGeneric = 5; +} + +class NSLocale extends NSObject { + NSLocale._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSLocale] that points to the same underlying object as [other]. + static NSLocale castFrom(T other) { + return NSLocale._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSLocale] that wraps the given raw object pointer. + static NSLocale castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSLocale._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSLocale]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSLocale1); + } + + NSObject objectForKey_(NSString key) { + final _ret = _lib._objc_msgSend_30(_id, _lib._sel_objectForKey_1, key._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString displayNameForKey_value_(NSString key, NSObject value) { + final _ret = _lib._objc_msgSend_173( + _id, _lib._sel_displayNameForKey_value_1, key._id, value._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSLocale initWithLocaleIdentifier_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithLocaleIdentifier_1, string?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + NSLocale initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + NSString? get localeIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localeIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForLocaleIdentifier_(NSString? localeIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForLocaleIdentifier_1, + localeIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get languageCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_languageCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForLanguageCode_(NSString? languageCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForLanguageCode_1, + languageCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get countryCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_countryCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCountryCode_(NSString? countryCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCountryCode_1, + countryCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get scriptCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scriptCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForScriptCode_(NSString? scriptCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForScriptCode_1, + scriptCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get variantCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_variantCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForVariantCode_(NSString? variantCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForVariantCode_1, + variantCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet? get exemplarCharacterSet { + final _ret = _lib._objc_msgSend_174(_id, _lib._sel_exemplarCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + NSString? get calendarIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCalendarIdentifier_(NSString? calendarIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCalendarIdentifier_1, + calendarIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get collationIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_collationIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCollationIdentifier_( + NSString? collationIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCollationIdentifier_1, + collationIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool get usesMetricSystem { + return _lib._objc_msgSend_12(_id, _lib._sel_usesMetricSystem1); + } + + NSString? get decimalSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_decimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get groupingSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_groupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get currencySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get currencyCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencyCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCurrencyCode_(NSString? currencyCode) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCurrencyCode_1, + currencyCode?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get collatorIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_collatorIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForCollatorIdentifier_(NSString? collatorIdentifier) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_localizedStringForCollatorIdentifier_1, + collatorIdentifier?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get quotationBeginDelimiter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_quotationBeginDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get quotationEndDelimiter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_quotationEndDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get alternateQuotationBeginDelimiter { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_alternateQuotationBeginDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get alternateQuotationEndDelimiter { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_alternateQuotationEndDelimiter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getAutoupdatingCurrentLocale(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_182( + _lib._class_NSLocale1, _lib._sel_autoupdatingCurrentLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getCurrentLocale(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_182(_lib._class_NSLocale1, _lib._sel_currentLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale? getSystemLocale(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_182(_lib._class_NSLocale1, _lib._sel_systemLocale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSLocale localeWithLocaleIdentifier_( + SentryCocoa _lib, NSString? ident) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSLocale1, + _lib._sel_localeWithLocaleIdentifier_1, ident?._id ?? ffi.nullptr); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + @override + NSLocale init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSLocale._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAvailableLocaleIdentifiers(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_availableLocaleIdentifiers1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOLanguageCodes(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_ISOLanguageCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOCountryCodes(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_ISOCountryCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getISOCurrencyCodes(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_ISOCurrencyCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getCommonISOCurrencyCodes(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_commonISOCurrencyCodes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getPreferredLanguages(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_preferredLanguages1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary componentsFromLocaleIdentifier_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_146(_lib._class_NSLocale1, + _lib._sel_componentsFromLocaleIdentifier_1, string?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSString localeIdentifierFromComponents_( + SentryCocoa _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_183(_lib._class_NSLocale1, + _lib._sel_localeIdentifierFromComponents_1, dict?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString canonicalLocaleIdentifierFromString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSLocale1, + _lib._sel_canonicalLocaleIdentifierFromString_1, + string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString canonicalLanguageIdentifierFromString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64( + _lib._class_NSLocale1, + _lib._sel_canonicalLanguageIdentifierFromString_1, + string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString localeIdentifierFromWindowsLocaleCode_( + SentryCocoa _lib, int lcid) { + final _ret = _lib._objc_msgSend_184(_lib._class_NSLocale1, + _lib._sel_localeIdentifierFromWindowsLocaleCode_1, lcid); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int windowsLocaleCodeFromLocaleIdentifier_( + SentryCocoa _lib, NSString? localeIdentifier) { + return _lib._objc_msgSend_185( + _lib._class_NSLocale1, + _lib._sel_windowsLocaleCodeFromLocaleIdentifier_1, + localeIdentifier?._id ?? ffi.nullptr); + } + + static int characterDirectionForLanguage_( + SentryCocoa _lib, NSString? isoLangCode) { + return _lib._objc_msgSend_186( + _lib._class_NSLocale1, + _lib._sel_characterDirectionForLanguage_1, + isoLangCode?._id ?? ffi.nullptr); + } + + static int lineDirectionForLanguage_( + SentryCocoa _lib, NSString? isoLangCode) { + return _lib._objc_msgSend_186(_lib._class_NSLocale1, + _lib._sel_lineDirectionForLanguage_1, isoLangCode?._id ?? ffi.nullptr); + } + + static NSLocale new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_new1); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static NSLocale allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSLocale1, _lib._sel_allocWithZone_1, zone); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static NSLocale alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSLocale1, _lib._sel_alloc1); + return NSLocale._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSLocale1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSLocale1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSLocale1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSLocale1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSLocale1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSLocale1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSLocale1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSLocale1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSLocale1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSCharacterSet extends NSObject { + NSCharacterSet._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCharacterSet] that points to the same underlying object as [other]. + static NSCharacterSet castFrom(T other) { + return NSCharacterSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCharacterSet] that wraps the given raw object pointer. + static NSCharacterSet castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCharacterSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCharacterSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCharacterSet1); + } + + static NSCharacterSet? getControlCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_controlCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getWhitespaceCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_whitespaceCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getWhitespaceAndNewlineCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174(_lib._class_NSCharacterSet1, + _lib._sel_whitespaceAndNewlineCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getDecimalDigitCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_decimalDigitCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getLetterCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_letterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getLowercaseLetterCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_lowercaseLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getUppercaseLetterCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_uppercaseLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getNonBaseCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_nonBaseCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getAlphanumericCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_alphanumericCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getDecomposableCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_decomposableCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getIllegalCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_illegalCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getPunctuationCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_punctuationCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getCapitalizedLetterCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_capitalizedLetterCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getSymbolCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_symbolCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getNewlineCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_newlineCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet characterSetWithRange_( + SentryCocoa _lib, _NSRange aRange) { + final _ret = _lib._objc_msgSend_175( + _lib._class_NSCharacterSet1, _lib._sel_characterSetWithRange_1, aRange); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithCharactersInString_( + SentryCocoa _lib, NSString? aString) { + final _ret = _lib._objc_msgSend_176( + _lib._class_NSCharacterSet1, + _lib._sel_characterSetWithCharactersInString_1, + aString?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithBitmapRepresentation_( + SentryCocoa _lib, NSData? data) { + final _ret = _lib._objc_msgSend_177( + _lib._class_NSCharacterSet1, + _lib._sel_characterSetWithBitmapRepresentation_1, + data?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet characterSetWithContentsOfFile_( + SentryCocoa _lib, NSString? fName) { + final _ret = _lib._objc_msgSend_176(_lib._class_NSCharacterSet1, + _lib._sel_characterSetWithContentsOfFile_1, fName?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + bool characterIsMember_(int aCharacter) { + return _lib._objc_msgSend_178( + _id, _lib._sel_characterIsMember_1, aCharacter); + } + + NSData? get bitmapRepresentation { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_bitmapRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSCharacterSet? get invertedSet { + final _ret = _lib._objc_msgSend_174(_id, _lib._sel_invertedSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + bool longCharacterIsMember_(int theLongChar) { + return _lib._objc_msgSend_179( + _id, _lib._sel_longCharacterIsMember_1, theLongChar); + } + + bool isSupersetOfSet_(NSCharacterSet? theOtherSet) { + return _lib._objc_msgSend_180( + _id, _lib._sel_isSupersetOfSet_1, theOtherSet?._id ?? ffi.nullptr); + } + + bool hasMemberInPlane_(int thePlane) { + return _lib._objc_msgSend_181(_id, _lib._sel_hasMemberInPlane_1, thePlane); + } + + static NSCharacterSet? getURLUserAllowedCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_URLUserAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLPasswordAllowedCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_URLPasswordAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLHostAllowedCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_URLHostAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLPathAllowedCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_URLPathAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLQueryAllowedCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_URLQueryAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet? getURLFragmentAllowedCharacterSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_174( + _lib._class_NSCharacterSet1, _lib._sel_URLFragmentAllowedCharacterSet1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSCharacterSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + static NSCharacterSet new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_new1); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSCharacterSet1, _lib._sel_allocWithZone_1, zone); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static NSCharacterSet alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_alloc1); + return NSCharacterSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSCharacterSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSCharacterSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCharacterSet1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCharacterSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCharacterSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCharacterSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSCharacterSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSCharacterSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCharacterSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSLocaleLanguageDirection { + static const int NSLocaleLanguageDirectionUnknown = 0; + static const int NSLocaleLanguageDirectionLeftToRight = 1; + static const int NSLocaleLanguageDirectionRightToLeft = 2; + static const int NSLocaleLanguageDirectionTopToBottom = 3; + static const int NSLocaleLanguageDirectionBottomToTop = 4; +} + +abstract class NSURLBookmarkCreationOptions { + static const int NSURLBookmarkCreationPreferFileIDResolution = 256; + static const int NSURLBookmarkCreationMinimalBookmark = 512; + static const int NSURLBookmarkCreationSuitableForBookmarkFile = 1024; + static const int NSURLBookmarkCreationWithSecurityScope = 2048; + static const int NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 4096; + static const int NSURLBookmarkCreationWithoutImplicitSecurityScope = + 536870912; +} + +abstract class NSURLBookmarkResolutionOptions { + static const int NSURLBookmarkResolutionWithoutUI = 256; + static const int NSURLBookmarkResolutionWithoutMounting = 512; + static const int NSURLBookmarkResolutionWithSecurityScope = 1024; + static const int NSURLBookmarkResolutionWithoutImplicitStartAccessing = 32768; +} + +class NSURLHandle extends NSObject { + NSURLHandle._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLHandle] that points to the same underlying object as [other]. + static NSURLHandle castFrom(T other) { + return NSURLHandle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLHandle] that wraps the given raw object pointer. + static NSURLHandle castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLHandle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLHandle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLHandle1); + } + + static void registerURLHandleClass_( + SentryCocoa _lib, NSObject anURLHandleSubclass) { + _lib._objc_msgSend_15(_lib._class_NSURLHandle1, + _lib._sel_registerURLHandleClass_1, anURLHandleSubclass._id); + } + + static NSObject URLHandleClassForURL_(SentryCocoa _lib, NSURL? anURL) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSURLHandle1, + _lib._sel_URLHandleClassForURL_1, anURL?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int status() { + return _lib._objc_msgSend_242(_id, _lib._sel_status1); + } + + NSString failureReason() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_failureReason1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void addClient_(NSObject? client) { + _lib._objc_msgSend_15( + _id, _lib._sel_addClient_1, client?._id ?? ffi.nullptr); + } + + void removeClient_(NSObject? client) { + _lib._objc_msgSend_15( + _id, _lib._sel_removeClient_1, client?._id ?? ffi.nullptr); + } + + void loadInBackground() { + _lib._objc_msgSend_1(_id, _lib._sel_loadInBackground1); + } + + void cancelLoadInBackground() { + _lib._objc_msgSend_1(_id, _lib._sel_cancelLoadInBackground1); + } + + NSData resourceData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_resourceData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData availableResourceData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_availableResourceData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + int expectedResourceDataSize() { + return _lib._objc_msgSend_220(_id, _lib._sel_expectedResourceDataSize1); + } + + void flushCachedData() { + _lib._objc_msgSend_1(_id, _lib._sel_flushCachedData1); + } + + void backgroundLoadDidFailWithReason_(NSString? reason) { + _lib._objc_msgSend_192(_id, _lib._sel_backgroundLoadDidFailWithReason_1, + reason?._id ?? ffi.nullptr); + } + + void didLoadBytes_loadComplete_(NSData? newBytes, bool yorn) { + _lib._objc_msgSend_243(_id, _lib._sel_didLoadBytes_loadComplete_1, + newBytes?._id ?? ffi.nullptr, yorn); + } + + static bool canInitWithURL_(SentryCocoa _lib, NSURL? anURL) { + return _lib._objc_msgSend_244(_lib._class_NSURLHandle1, + _lib._sel_canInitWithURL_1, anURL?._id ?? ffi.nullptr); + } + + static NSURLHandle cachedHandleForURL_(SentryCocoa _lib, NSURL? anURL) { + final _ret = _lib._objc_msgSend_245(_lib._class_NSURLHandle1, + _lib._sel_cachedHandleForURL_1, anURL?._id ?? ffi.nullptr); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithURL_cached_(NSURL? anURL, bool willCache) { + final _ret = _lib._objc_msgSend_246(_id, _lib._sel_initWithURL_cached_1, + anURL?._id ?? ffi.nullptr, willCache); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject propertyForKey_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_propertyForKey_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject propertyForKeyIfAvailable_(NSString? propertyKey) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_propertyForKeyIfAvailable_1, propertyKey?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool writeProperty_forKey_(NSObject propertyValue, NSString? propertyKey) { + return _lib._objc_msgSend_240(_id, _lib._sel_writeProperty_forKey_1, + propertyValue._id, propertyKey?._id ?? ffi.nullptr); + } + + bool writeData_(NSData? data) { + return _lib._objc_msgSend_23( + _id, _lib._sel_writeData_1, data?._id ?? ffi.nullptr); + } + + NSData loadInForeground() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_loadInForeground1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void beginLoadInBackground() { + _lib._objc_msgSend_1(_id, _lib._sel_beginLoadInBackground1); + } + + void endLoadInBackground() { + _lib._objc_msgSend_1(_id, _lib._sel_endLoadInBackground1); + } + + @override + NSURLHandle init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLHandle._(_ret, _lib, retain: true, release: true); + } + + static NSURLHandle new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_new1); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static NSURLHandle allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLHandle1, _lib._sel_allocWithZone_1, zone); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static NSURLHandle alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_alloc1); + return NSURLHandle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLHandle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLHandle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLHandle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLHandle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLHandle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLHandle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLHandle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLHandleStatus { + static const int NSURLHandleNotLoaded = 0; + static const int NSURLHandleLoadSucceeded = 1; + static const int NSURLHandleLoadInProgress = 2; + static const int NSURLHandleLoadFailed = 3; +} + +abstract class NSDataWritingOptions { + static const int NSDataWritingAtomic = 1; + static const int NSDataWritingWithoutOverwriting = 2; + static const int NSDataWritingFileProtectionNone = 268435456; + static const int NSDataWritingFileProtectionComplete = 536870912; + static const int NSDataWritingFileProtectionCompleteUnlessOpen = 805306368; + static const int + NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication = + 1073741824; + static const int NSDataWritingFileProtectionMask = 4026531840; + static const int NSAtomicWrite = 1; +} + +abstract class NSDataSearchOptions { + static const int NSDataSearchBackwards = 1; + static const int NSDataSearchAnchored = 2; +} + +void _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, _NSRange, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_ffiVoid_NSRange_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ffiVoid_NSRange_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, _NSRange arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +abstract class NSDataReadingOptions { + static const int NSDataReadingMappedIfSafe = 1; + static const int NSDataReadingUncached = 2; + static const int NSDataReadingMappedAlways = 8; + static const int NSDataReadingMapped = 1; + static const int NSMappedRead = 1; + static const int NSUncachedRead = 2; +} + +void _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.UnsignedLong arg1)>>() + .asFunction arg0, int arg1)>()( + arg0, arg1); +} + +final _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistryIndex; + _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) { + return (_ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureRegistry[block + .ref + .target + .address] as void Function(ffi.Pointer, int))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.UnsignedLong arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1)>( + _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0, int arg1) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1)>( + _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, int arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, ffi.UnsignedLong arg1)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, int arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSDataBase64DecodingOptions { + static const int NSDataBase64DecodingIgnoreUnknownCharacters = 1; +} + +abstract class NSDataBase64EncodingOptions { + static const int NSDataBase64Encoding64CharacterLineLength = 1; + static const int NSDataBase64Encoding76CharacterLineLength = 2; + static const int NSDataBase64EncodingEndLineWithCarriageReturn = 16; + static const int NSDataBase64EncodingEndLineWithLineFeed = 32; +} + +abstract class NSDataCompressionAlgorithm { + static const int NSDataCompressionAlgorithmLZFSE = 0; + static const int NSDataCompressionAlgorithmLZ4 = 1; + static const int NSDataCompressionAlgorithmLZMA = 2; + static const int NSDataCompressionAlgorithmZlib = 3; +} + +abstract class NSDecodingFailurePolicy { + static const int NSDecodingFailurePolicyRaiseException = 0; + static const int NSDecodingFailurePolicySetErrorAndReturn = 1; +} + +abstract class NSStringCompareOptions { + static const int NSCaseInsensitiveSearch = 1; + static const int NSLiteralSearch = 2; + static const int NSBackwardsSearch = 4; + static const int NSAnchoredSearch = 8; + static const int NSNumericSearch = 64; + static const int NSDiacriticInsensitiveSearch = 128; + static const int NSWidthInsensitiveSearch = 256; + static const int NSForcedOrderingSearch = 512; + static const int NSRegularExpressionSearch = 1024; +} + +abstract class NSStringEnumerationOptions { + static const int NSStringEnumerationByLines = 0; + static const int NSStringEnumerationByParagraphs = 1; + static const int NSStringEnumerationByComposedCharacterSequences = 2; + static const int NSStringEnumerationByWords = 3; + static const int NSStringEnumerationBySentences = 4; + static const int NSStringEnumerationByCaretPositions = 5; + static const int NSStringEnumerationByDeletionClusters = 6; + static const int NSStringEnumerationReverse = 256; + static const int NSStringEnumerationSubstringNotRequired = 512; + static const int NSStringEnumerationLocalized = 1024; +} + +void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + _NSRange arg2, ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3)>()(arg0, arg1, arg2, arg3); +} + +final _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3) { + return (_ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, _NSRange, _NSRange, + ffi.Pointer))(arg0, arg1, arg2, arg3); +} + +class ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + _NSRange arg2, ffi.Pointer arg3)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, _NSRange arg1, _NSRange arg2, + ffi.Pointer arg3) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3)>( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, _NSRange arg1, _NSRange arg2, + ffi.Pointer arg3) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + _NSRange arg2, + ffi.Pointer arg3)>()(_id, arg0, arg1, arg2, arg3); + } +} + +void _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_NSString_bool_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSString_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSString_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSString_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_NSString_bool_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_NSString_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSString_bool._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSString_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSString_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSString_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSStringEncodingConversionOptions { + static const int NSStringEncodingConversionAllowLossy = 1; + static const int NSStringEncodingConversionExternalRepresentation = 2; +} + +void _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1)>>() + .asFunction< + void Function( + ffi.Pointer arg0, int arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistryIndex = + 0; +ffi.Pointer + _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistryIndex; + _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1) { + return (_ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, int))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong + extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.UnsignedLong arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1)>( + _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, int arg1) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1)>( + _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, int arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.UnsignedLong arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSLinguisticTaggerOptions { + static const int NSLinguisticTaggerOmitWords = 1; + static const int NSLinguisticTaggerOmitPunctuation = 2; + static const int NSLinguisticTaggerOmitWhitespace = 4; + static const int NSLinguisticTaggerOmitOther = 8; + static const int NSLinguisticTaggerJoinNames = 16; +} + +class NSOrthography extends NSObject { + NSOrthography._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOrthography] that points to the same underlying object as [other]. + static NSOrthography castFrom(T other) { + return NSOrthography._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOrthography] that wraps the given raw object pointer. + static NSOrthography castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOrthography._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOrthography]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrthography1); + } + + NSString? get dominantScript { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dominantScript1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get languageMap { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_languageMap1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSOrthography initWithDominantScript_languageMap_( + NSString? script, NSDictionary? map) { + final _ret = _lib._objc_msgSend_371( + _id, + _lib._sel_initWithDominantScript_languageMap_1, + script?._id ?? ffi.nullptr, + map?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSOrthography initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSArray languagesForScript_(NSString? script) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_languagesForScript_1, script?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString dominantLanguageForScript_(NSString? script) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_dominantLanguageForScript_1, script?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get dominantLanguage { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dominantLanguage1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allScripts { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_allScripts1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allLanguages { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_allLanguages1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography defaultOrthographyForLanguage_( + SentryCocoa _lib, NSString? language) { + final _ret = _lib._objc_msgSend_30( + _lib._class_NSOrthography1, + _lib._sel_defaultOrthographyForLanguage_1, + language?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography orthographyWithDominantScript_languageMap_( + SentryCocoa _lib, NSString? script, NSDictionary? map) { + final _ret = _lib._objc_msgSend_371( + _lib._class_NSOrthography1, + _lib._sel_orthographyWithDominantScript_languageMap_1, + script?._id ?? ffi.nullptr, + map?._id ?? ffi.nullptr); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + @override + NSOrthography init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOrthography._(_ret, _lib, retain: true, release: true); + } + + static NSOrthography new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_new1); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static NSOrthography allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSOrthography1, _lib._sel_allocWithZone_1, zone); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static NSOrthography alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrthography1, _lib._sel_alloc1); + return NSOrthography._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSOrthography1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSOrthography1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrthography1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrthography1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOrthography1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOrthography1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSOrthography1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSOrthography1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOrthography1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_ObjCObject_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistry = {}; +int _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ObjCObject_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_ObjCObject_bool_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_ObjCObject_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ObjCObject_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ObjCObject_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_ObjCObject_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ObjCObject_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_ObjCObject_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ObjCObject_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +bool _ObjCBlock_bool_ObjCObject_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_bool_ObjCObject_bool_closureRegistry = {}; +int _ObjCBlock_bool_ObjCObject_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_bool_ObjCObject_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_bool_ObjCObject_bool_closureRegistryIndex; + _ObjCBlock_bool_ObjCObject_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_ObjCObject_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_bool_ObjCObject_bool_closureRegistry[ + block.ref.target.address] + as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_bool_ObjCObject_bool extends _ObjCBlockBase { + ObjCBlock_bool_ObjCObject_bool._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_ObjCObject_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ObjCObject_bool_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_ObjCObject_bool.fromFunction( + SentryCocoa lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_ObjCObject_bool_closureTrampoline, + false) + .cast(), + _ObjCBlock_bool_ObjCObject_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +class NSFileManager extends NSObject { + NSFileManager._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileManager] that points to the same underlying object as [other]. + static NSFileManager castFrom(T other) { + return NSFileManager._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileManager] that wraps the given raw object pointer. + static NSFileManager castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileManager._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileManager]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileManager1); + } + + static NSFileManager? getDefaultManager(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_402( + _lib._class_NSFileManager1, _lib._sel_defaultManager1); + return _ret.address == 0 + ? null + : NSFileManager._(_ret, _lib, retain: true, release: true); + } + + NSArray mountedVolumeURLsIncludingResourceValuesForKeys_options_( + NSArray? propertyKeys, int options) { + final _ret = _lib._objc_msgSend_403( + _id, + _lib._sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_1, + propertyKeys?._id ?? ffi.nullptr, + options); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void unmountVolumeAtURL_options_completionHandler_( + NSURL? url, int mask, ObjCBlock_ffiVoid_NSError completionHandler) { + _lib._objc_msgSend_404( + _id, + _lib._sel_unmountVolumeAtURL_options_completionHandler_1, + url?._id ?? ffi.nullptr, + mask, + completionHandler._id); + } + + NSArray contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( + NSURL? url, + NSArray? keys, + int mask, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_405( + _id, + _lib._sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_1, + url?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr, + mask, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForDirectory_inDomains_(int directory, int domainMask) { + final _ret = _lib._objc_msgSend_406( + _id, _lib._sel_URLsForDirectory_inDomains_1, directory, domainMask); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForDirectory_inDomain_appropriateForURL_create_error_( + int directory, + int domain, + NSURL? url, + bool shouldCreate, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_407( + _id, + _lib._sel_URLForDirectory_inDomain_appropriateForURL_create_error_1, + directory, + domain, + url?._id ?? ffi.nullptr, + shouldCreate, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( + ffi.Pointer outRelationship, + NSURL? directoryURL, + NSURL? otherURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_408( + _id, + _lib._sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_1, + outRelationship, + directoryURL?._id ?? ffi.nullptr, + otherURL?._id ?? ffi.nullptr, + error); + } + + bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( + ffi.Pointer outRelationship, + int directory, + int domainMask, + NSURL? url, + ffi.Pointer> error) { + return _lib._objc_msgSend_409( + _id, + _lib._sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_1, + outRelationship, + directory, + domainMask, + url?._id ?? ffi.nullptr, + error); + } + + bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( + NSURL? url, + bool createIntermediates, + NSDictionary? attributes, + ffi.Pointer> error) { + return _lib._objc_msgSend_410( + _id, + _lib._sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_1, + url?._id ?? ffi.nullptr, + createIntermediates, + attributes?._id ?? ffi.nullptr, + error); + } + + bool createSymbolicLinkAtURL_withDestinationURL_error_( + NSURL? url, NSURL? destURL, ffi.Pointer> error) { + return _lib._objc_msgSend_411( + _id, + _lib._sel_createSymbolicLinkAtURL_withDestinationURL_error_1, + url?._id ?? ffi.nullptr, + destURL?._id ?? ffi.nullptr, + error); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool setAttributes_ofItemAtPath_error_(NSDictionary? attributes, + NSString? path, ffi.Pointer> error) { + return _lib._objc_msgSend_412( + _id, + _lib._sel_setAttributes_ofItemAtPath_error_1, + attributes?._id ?? ffi.nullptr, + path?._id ?? ffi.nullptr, + error); + } + + bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( + NSString? path, + bool createIntermediates, + NSDictionary? attributes, + ffi.Pointer> error) { + return _lib._objc_msgSend_413( + _id, + _lib._sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_1, + path?._id ?? ffi.nullptr, + createIntermediates, + attributes?._id ?? ffi.nullptr, + error); + } + + NSArray contentsOfDirectoryAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_414( + _id, + _lib._sel_contentsOfDirectoryAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray subpathsOfDirectoryAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_414( + _id, + _lib._sel_subpathsOfDirectoryAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesOfItemAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_415( + _id, + _lib._sel_attributesOfItemAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesOfFileSystemForPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_415( + _id, + _lib._sel_attributesOfFileSystemForPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool createSymbolicLinkAtPath_withDestinationPath_error_(NSString? path, + NSString? destPath, ffi.Pointer> error) { + return _lib._objc_msgSend_416( + _id, + _lib._sel_createSymbolicLinkAtPath_withDestinationPath_error_1, + path?._id ?? ffi.nullptr, + destPath?._id ?? ffi.nullptr, + error); + } + + NSString destinationOfSymbolicLinkAtPath_error_( + NSString? path, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_417( + _id, + _lib._sel_destinationOfSymbolicLinkAtPath_error_1, + path?._id ?? ffi.nullptr, + error); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool copyItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_416(_id, _lib._sel_copyItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool moveItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_416(_id, _lib._sel_moveItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool linkItemAtPath_toPath_error_(NSString? srcPath, NSString? dstPath, + ffi.Pointer> error) { + return _lib._objc_msgSend_416(_id, _lib._sel_linkItemAtPath_toPath_error_1, + srcPath?._id ?? ffi.nullptr, dstPath?._id ?? ffi.nullptr, error); + } + + bool removeItemAtPath_error_( + NSString? path, ffi.Pointer> error) { + return _lib._objc_msgSend_418(_id, _lib._sel_removeItemAtPath_error_1, + path?._id ?? ffi.nullptr, error); + } + + bool copyItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_411(_id, _lib._sel_copyItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool moveItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_411(_id, _lib._sel_moveItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool linkItemAtURL_toURL_error_(NSURL? srcURL, NSURL? dstURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_411(_id, _lib._sel_linkItemAtURL_toURL_error_1, + srcURL?._id ?? ffi.nullptr, dstURL?._id ?? ffi.nullptr, error); + } + + bool removeItemAtURL_error_( + NSURL? URL, ffi.Pointer> error) { + return _lib._objc_msgSend_83( + _id, _lib._sel_removeItemAtURL_error_1, URL?._id ?? ffi.nullptr, error); + } + + bool trashItemAtURL_resultingItemURL_error_( + NSURL? url, + ffi.Pointer> outResultingURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_419( + _id, + _lib._sel_trashItemAtURL_resultingItemURL_error_1, + url?._id ?? ffi.nullptr, + outResultingURL, + error); + } + + NSDictionary fileAttributesAtPath_traverseLink_(NSString? path, bool yorn) { + final _ret = _lib._objc_msgSend_420( + _id, + _lib._sel_fileAttributesAtPath_traverseLink_1, + path?._id ?? ffi.nullptr, + yorn); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool changeFileAttributes_atPath_(NSDictionary? attributes, NSString? path) { + return _lib._objc_msgSend_421(_id, _lib._sel_changeFileAttributes_atPath_1, + attributes?._id ?? ffi.nullptr, path?._id ?? ffi.nullptr); + } + + NSArray directoryContentsAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_directoryContentsAtPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary fileSystemAttributesAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_146( + _id, _lib._sel_fileSystemAttributesAtPath_1, path?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString pathContentOfSymbolicLinkAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64(_id, + _lib._sel_pathContentOfSymbolicLinkAtPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool createSymbolicLinkAtPath_pathContent_( + NSString? path, NSString? otherpath) { + return _lib._objc_msgSend_422( + _id, + _lib._sel_createSymbolicLinkAtPath_pathContent_1, + path?._id ?? ffi.nullptr, + otherpath?._id ?? ffi.nullptr); + } + + bool createDirectoryAtPath_attributes_( + NSString? path, NSDictionary? attributes) { + return _lib._objc_msgSend_423( + _id, + _lib._sel_createDirectoryAtPath_attributes_1, + path?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + } + + bool linkPath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_424(_id, _lib._sel_linkPath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool copyPath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_424(_id, _lib._sel_copyPath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool movePath_toPath_handler_( + NSString? src, NSString? dest, NSObject handler) { + return _lib._objc_msgSend_424(_id, _lib._sel_movePath_toPath_handler_1, + src?._id ?? ffi.nullptr, dest?._id ?? ffi.nullptr, handler._id); + } + + bool removeFileAtPath_handler_(NSString? path, NSObject handler) { + return _lib._objc_msgSend_425(_id, _lib._sel_removeFileAtPath_handler_1, + path?._id ?? ffi.nullptr, handler._id); + } + + NSString? get currentDirectoryPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDirectoryPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool changeCurrentDirectoryPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_changeCurrentDirectoryPath_1, path?._id ?? ffi.nullptr); + } + + bool fileExistsAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_fileExistsAtPath_1, path?._id ?? ffi.nullptr); + } + + bool fileExistsAtPath_isDirectory_( + NSString? path, ffi.Pointer isDirectory) { + return _lib._objc_msgSend_426(_id, _lib._sel_fileExistsAtPath_isDirectory_1, + path?._id ?? ffi.nullptr, isDirectory); + } + + bool isReadableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isReadableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isWritableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isWritableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isExecutableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isExecutableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool isDeletableFileAtPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isDeletableFileAtPath_1, path?._id ?? ffi.nullptr); + } + + bool contentsEqualAtPath_andPath_(NSString? path1, NSString? path2) { + return _lib._objc_msgSend_422(_id, _lib._sel_contentsEqualAtPath_andPath_1, + path1?._id ?? ffi.nullptr, path2?._id ?? ffi.nullptr); + } + + NSString displayNameAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_displayNameAtPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray componentsToDisplayForPath_(NSString? path) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_componentsToDisplayForPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject enumeratorAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_enumeratorAtPath_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_( + NSURL? url, + NSArray? keys, + int mask, + ObjCBlock_bool_NSURL_NSError handler) { + final _ret = _lib._objc_msgSend_427( + _id, + _lib._sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_1, + url?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr, + mask, + handler._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray subpathsAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_subpathsAtPath_1, path?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSData contentsAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_428( + _id, _lib._sel_contentsAtPath_1, path?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool createFileAtPath_contents_attributes_( + NSString? path, NSData? data, NSDictionary? attr) { + return _lib._objc_msgSend_429( + _id, + _lib._sel_createFileAtPath_contents_attributes_1, + path?._id ?? ffi.nullptr, + data?._id ?? ffi.nullptr, + attr?._id ?? ffi.nullptr); + } + + ffi.Pointer fileSystemRepresentationWithPath_(NSString? path) { + return _lib._objc_msgSend_430(_id, + _lib._sel_fileSystemRepresentationWithPath_1, path?._id ?? ffi.nullptr); + } + + NSString stringWithFileSystemRepresentation_length_( + ffi.Pointer str, int len) { + final _ret = _lib._objc_msgSend_431( + _id, _lib._sel_stringWithFileSystemRepresentation_length_1, str, len); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool + replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_( + NSURL? originalItemURL, + NSURL? newItemURL, + NSString? backupItemName, + int options, + ffi.Pointer> resultingURL, + ffi.Pointer> error) { + return _lib._objc_msgSend_432( + _id, + _lib._sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_1, + originalItemURL?._id ?? ffi.nullptr, + newItemURL?._id ?? ffi.nullptr, + backupItemName?._id ?? ffi.nullptr, + options, + resultingURL, + error); + } + + bool setUbiquitous_itemAtURL_destinationURL_error_(bool flag, NSURL? url, + NSURL? destinationURL, ffi.Pointer> error) { + return _lib._objc_msgSend_433( + _id, + _lib._sel_setUbiquitous_itemAtURL_destinationURL_error_1, + flag, + url?._id ?? ffi.nullptr, + destinationURL?._id ?? ffi.nullptr, + error); + } + + bool isUbiquitousItemAtURL_(NSURL? url) { + return _lib._objc_msgSend_244( + _id, _lib._sel_isUbiquitousItemAtURL_1, url?._id ?? ffi.nullptr); + } + + bool startDownloadingUbiquitousItemAtURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_83( + _id, + _lib._sel_startDownloadingUbiquitousItemAtURL_error_1, + url?._id ?? ffi.nullptr, + error); + } + + bool evictUbiquitousItemAtURL_error_( + NSURL? url, ffi.Pointer> error) { + return _lib._objc_msgSend_83( + _id, + _lib._sel_evictUbiquitousItemAtURL_error_1, + url?._id ?? ffi.nullptr, + error); + } + + NSURL URLForUbiquityContainerIdentifier_(NSString? containerIdentifier) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLForUbiquityContainerIdentifier_1, + containerIdentifier?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForPublishingUbiquitousItemAtURL_expirationDate_error_( + NSURL? url, + ffi.Pointer> outDate, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_434( + _id, + _lib._sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_1, + url?._id ?? ffi.nullptr, + outDate, + error); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSObject? get ubiquityIdentityToken { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_ubiquityIdentityToken1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + void getFileProviderServicesForItemAtURL_completionHandler_( + NSURL? url, ObjCBlock_ffiVoid_NSDictionary_NSError completionHandler) { + _lib._objc_msgSend_435( + _id, + _lib._sel_getFileProviderServicesForItemAtURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._id); + } + + NSURL containerURLForSecurityApplicationGroupIdentifier_( + NSString? groupIdentifier) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_containerURLForSecurityApplicationGroupIdentifier_1, + groupIdentifier?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get homeDirectoryForCurrentUser { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_homeDirectoryForCurrentUser1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get temporaryDirectory { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_temporaryDirectory1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL homeDirectoryForUser_(NSString? userName) { + final _ret = _lib._objc_msgSend_34( + _id, _lib._sel_homeDirectoryForUser_1, userName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + @override + NSFileManager init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSFileManager._(_ret, _lib, retain: true, release: true); + } + + static NSFileManager new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_new1); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static NSFileManager allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSFileManager1, _lib._sel_allocWithZone_1, zone); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static NSFileManager alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileManager1, _lib._sel_alloc1); + return NSFileManager._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSFileManager1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSFileManager1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileManager1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileManager1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileManager1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileManager1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSFileManager1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSFileManager1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileManager1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSVolumeEnumerationOptions { + static const int NSVolumeEnumerationSkipHiddenVolumes = 2; + static const int NSVolumeEnumerationProduceFileReferenceURLs = 4; +} + +abstract class NSFileManagerUnmountOptions { + static const int NSFileManagerUnmountAllPartitionsAndEjectDisk = 1; + static const int NSFileManagerUnmountWithoutUI = 2; +} + +void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSError_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSError_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSError_closureRegistry[block.ref.target.address] + as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSError._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSError.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +abstract class NSDirectoryEnumerationOptions { + static const int NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1; + static const int NSDirectoryEnumerationSkipsPackageDescendants = 2; + static const int NSDirectoryEnumerationSkipsHiddenFiles = 4; + static const int NSDirectoryEnumerationIncludesDirectoriesPostOrder = 8; + static const int NSDirectoryEnumerationProducesRelativePathURLs = 16; +} + +abstract class NSSearchPathDirectory { + static const int NSApplicationDirectory = 1; + static const int NSDemoApplicationDirectory = 2; + static const int NSDeveloperApplicationDirectory = 3; + static const int NSAdminApplicationDirectory = 4; + static const int NSLibraryDirectory = 5; + static const int NSDeveloperDirectory = 6; + static const int NSUserDirectory = 7; + static const int NSDocumentationDirectory = 8; + static const int NSDocumentDirectory = 9; + static const int NSCoreServiceDirectory = 10; + static const int NSAutosavedInformationDirectory = 11; + static const int NSDesktopDirectory = 12; + static const int NSCachesDirectory = 13; + static const int NSApplicationSupportDirectory = 14; + static const int NSDownloadsDirectory = 15; + static const int NSInputMethodsDirectory = 16; + static const int NSMoviesDirectory = 17; + static const int NSMusicDirectory = 18; + static const int NSPicturesDirectory = 19; + static const int NSPrinterDescriptionDirectory = 20; + static const int NSSharedPublicDirectory = 21; + static const int NSPreferencePanesDirectory = 22; + static const int NSApplicationScriptsDirectory = 23; + static const int NSItemReplacementDirectory = 99; + static const int NSAllApplicationsDirectory = 100; + static const int NSAllLibrariesDirectory = 101; + static const int NSTrashDirectory = 102; +} + +abstract class NSSearchPathDomainMask { + static const int NSUserDomainMask = 1; + static const int NSLocalDomainMask = 2; + static const int NSNetworkDomainMask = 4; + static const int NSSystemDomainMask = 8; + static const int NSAllDomainsMask = 65535; +} + +abstract class NSURLRelationship { + static const int NSURLRelationshipContains = 0; + static const int NSURLRelationshipSame = 1; + static const int NSURLRelationshipOther = 2; +} + +bool _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_bool_NSURL_NSError_closureRegistry = {}; +int _ObjCBlock_bool_NSURL_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_bool_NSURL_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_bool_NSURL_NSError_closureRegistryIndex; + _ObjCBlock_bool_NSURL_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +bool _ObjCBlock_bool_NSURL_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_bool_NSURL_NSError_closureRegistry[ + block.ref.target.address] + as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_bool_NSURL_NSError extends _ObjCBlockBase { + ObjCBlock_bool_NSURL_NSError._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_bool_NSURL_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline, false) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_bool_NSURL_NSError.fromFunction( + SentryCocoa lib, + bool Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_bool_NSURL_NSError_closureTrampoline, false) + .cast(), + _ObjCBlock_bool_NSURL_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + bool call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSFileManagerItemReplacementOptions { + static const int NSFileManagerItemReplacementUsingNewMetadataOnly = 1; + static const int NSFileManagerItemReplacementWithoutDeletingBackupItem = 2; +} + +void _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_NSDictionary_NSError_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_NSDictionary_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSDictionary_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSDictionary_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSDictionary_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSDictionary_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +class NSMutableArray extends NSArray { + NSMutableArray._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableArray] that points to the same underlying object as [other]. + static NSMutableArray castFrom(T other) { + return NSMutableArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableArray] that wraps the given raw object pointer. + static NSMutableArray castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableArray1); + } + + void addObject_(NSObject anObject) { + _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, anObject._id); + } + + void insertObject_atIndex_(NSObject anObject, int index) { + _lib._objc_msgSend_438( + _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); + } + + void removeLastObject() { + _lib._objc_msgSend_1(_id, _lib._sel_removeLastObject1); + } + + void removeObjectAtIndex_(int index) { + _lib._objc_msgSend_439(_id, _lib._sel_removeObjectAtIndex_1, index); + } + + void replaceObjectAtIndex_withObject_(int index, NSObject anObject) { + _lib._objc_msgSend_440( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, index, anObject._id); + } + + @override + NSMutableArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableArray initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + void addObjectsFromArray_(NSArray? otherArray) { + _lib._objc_msgSend_441( + _id, _lib._sel_addObjectsFromArray_1, otherArray?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { + _lib._objc_msgSend_442( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void removeAllObjects() { + _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_inRange_(NSObject anObject, _NSRange range) { + _lib._objc_msgSend_443( + _id, _lib._sel_removeObject_inRange_1, anObject._id, range); + } + + void removeObject_(NSObject anObject) { + _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, anObject._id); + } + + void removeObjectIdenticalTo_inRange_(NSObject anObject, _NSRange range) { + _lib._objc_msgSend_443( + _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); + } + + void removeObjectIdenticalTo_(NSObject anObject) { + _lib._objc_msgSend_15( + _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); + } + + void removeObjectsFromIndices_numIndices_( + ffi.Pointer indices, int cnt) { + _lib._objc_msgSend_444( + _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); + } + + void removeObjectsInArray_(NSArray? otherArray) { + _lib._objc_msgSend_441( + _id, _lib._sel_removeObjectsInArray_1, otherArray?._id ?? ffi.nullptr); + } + + void removeObjectsInRange_(_NSRange range) { + _lib._objc_msgSend_445(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void replaceObjectsInRange_withObjectsFromArray_range_( + _NSRange range, NSArray? otherArray, _NSRange otherRange) { + _lib._objc_msgSend_446( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, + range, + otherArray?._id ?? ffi.nullptr, + otherRange); + } + + void replaceObjectsInRange_withObjectsFromArray_( + _NSRange range, NSArray? otherArray) { + _lib._objc_msgSend_447( + _id, + _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, + range, + otherArray?._id ?? ffi.nullptr); + } + + void setArray_(NSArray? otherArray) { + _lib._objc_msgSend_441( + _id, _lib._sel_setArray_1, otherArray?._id ?? ffi.nullptr); + } + + void sortUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + _lib._objc_msgSend_448( + _id, _lib._sel_sortUsingFunction_context_1, compare, context); + } + + void sortUsingSelector_(ffi.Pointer comparator) { + _lib._objc_msgSend_7(_id, _lib._sel_sortUsingSelector_1, comparator); + } + + void insertObjects_atIndexes_(NSArray? objects, NSIndexSet? indexes) { + _lib._objc_msgSend_449(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void removeObjectsAtIndexes_(NSIndexSet? indexes) { + _lib._objc_msgSend_450( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void replaceObjectsAtIndexes_withObjects_( + NSIndexSet? indexes, NSArray? objects) { + _lib._objc_msgSend_451(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); + } + + void setObject_atIndexedSubscript_(NSObject obj, int idx) { + _lib._objc_msgSend_438( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void sortUsingComparator_( + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + _lib._objc_msgSend_452(_id, _lib._sel_sortUsingComparator_1, cmptr._id); + } + + void sortWithOptions_usingComparator_( + int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + _lib._objc_msgSend_453( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr._id); + } + + static NSMutableArray arrayWithCapacity_(SentryCocoa _lib, int numItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithContentsOfFile_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_454(_lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithContentsOfURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_455(_lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_454( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + NSMutableArray initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_455( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + void applyDifference_(NSObject? difference) { + _lib._objc_msgSend_15( + _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); + } + + void sortUsingDescriptors_(NSArray? sortDescriptors) { + _lib._objc_msgSend_441(_id, _lib._sel_sortUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + } + + void filterUsingPredicate_(NSPredicate? predicate) { + _lib._objc_msgSend_456( + _id, _lib._sel_filterUsingPredicate_1, predicate?._id ?? ffi.nullptr); + } + + @override + NSMutableArray initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray array(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_array1); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObject_(SentryCocoa _lib, NSObject anObject) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObjects_count_( + SentryCocoa _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_count_1, objects, cnt); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithObjects_(SentryCocoa _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableArray1, + _lib._sel_arrayWithObjects_1, firstObj._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray arrayWithArray_(SentryCocoa _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableArray1, + _lib._sel_arrayWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableArray initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableArray initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableArray initWithArray_copyItems_(NSArray? array, bool flag) { + final _ret = _lib._objc_msgSend_118(_id, + _lib._sel_initWithArray_copyItems_1, array?._id ?? ffi.nullptr, flag); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static NSArray arrayWithContentsOfURL_error_(SentryCocoa _lib, NSURL? url, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_119( + _lib._class_NSMutableArray1, + _lib._sel_arrayWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSMutableArray new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_new1); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static NSMutableArray allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableArray1, _lib._sel_allocWithZone_1, zone); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static NSMutableArray alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_alloc1); + return NSMutableArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableArray1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSMutableArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableOrderedSet extends NSOrderedSet { + NSMutableOrderedSet._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableOrderedSet] that points to the same underlying object as [other]. + static NSMutableOrderedSet castFrom(T other) { + return NSMutableOrderedSet._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableOrderedSet] that wraps the given raw object pointer. + static NSMutableOrderedSet castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableOrderedSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableOrderedSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableOrderedSet1); + } + + void insertObject_atIndex_(NSObject object, int idx) { + _lib._objc_msgSend_438( + _id, _lib._sel_insertObject_atIndex_1, object._id, idx); + } + + void removeObjectAtIndex_(int idx) { + _lib._objc_msgSend_439(_id, _lib._sel_removeObjectAtIndex_1, idx); + } + + void replaceObjectAtIndex_withObject_(int idx, NSObject object) { + _lib._objc_msgSend_440( + _id, _lib._sel_replaceObjectAtIndex_withObject_1, idx, object._id); + } + + @override + NSMutableOrderedSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableOrderedSet initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void addObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); + } + + void addObjects_count_( + ffi.Pointer> objects, int count) { + _lib._objc_msgSend_467(_id, _lib._sel_addObjects_count_1, objects, count); + } + + void addObjectsFromArray_(NSArray? array) { + _lib._objc_msgSend_441( + _id, _lib._sel_addObjectsFromArray_1, array?._id ?? ffi.nullptr); + } + + void exchangeObjectAtIndex_withObjectAtIndex_(int idx1, int idx2) { + _lib._objc_msgSend_442( + _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); + } + + void moveObjectsAtIndexes_toIndex_(NSIndexSet? indexes, int idx) { + _lib._objc_msgSend_468(_id, _lib._sel_moveObjectsAtIndexes_toIndex_1, + indexes?._id ?? ffi.nullptr, idx); + } + + void insertObjects_atIndexes_(NSArray? objects, NSIndexSet? indexes) { + _lib._objc_msgSend_449(_id, _lib._sel_insertObjects_atIndexes_1, + objects?._id ?? ffi.nullptr, indexes?._id ?? ffi.nullptr); + } + + void setObject_atIndex_(NSObject obj, int idx) { + _lib._objc_msgSend_438(_id, _lib._sel_setObject_atIndex_1, obj._id, idx); + } + + void setObject_atIndexedSubscript_(NSObject obj, int idx) { + _lib._objc_msgSend_438( + _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); + } + + void replaceObjectsInRange_withObjects_count_( + _NSRange range, ffi.Pointer> objects, int count) { + _lib._objc_msgSend_469( + _id, + _lib._sel_replaceObjectsInRange_withObjects_count_1, + range, + objects, + count); + } + + void replaceObjectsAtIndexes_withObjects_( + NSIndexSet? indexes, NSArray? objects) { + _lib._objc_msgSend_451(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, + indexes?._id ?? ffi.nullptr, objects?._id ?? ffi.nullptr); + } + + void removeObjectsInRange_(_NSRange range) { + _lib._objc_msgSend_445(_id, _lib._sel_removeObjectsInRange_1, range); + } + + void removeObjectsAtIndexes_(NSIndexSet? indexes) { + _lib._objc_msgSend_450( + _id, _lib._sel_removeObjectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); + } + + void removeObjectsInArray_(NSArray? array) { + _lib._objc_msgSend_441( + _id, _lib._sel_removeObjectsInArray_1, array?._id ?? ffi.nullptr); + } + + void intersectOrderedSet_(NSOrderedSet? other) { + _lib._objc_msgSend_470( + _id, _lib._sel_intersectOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void minusOrderedSet_(NSOrderedSet? other) { + _lib._objc_msgSend_470( + _id, _lib._sel_minusOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void unionOrderedSet_(NSOrderedSet? other) { + _lib._objc_msgSend_470( + _id, _lib._sel_unionOrderedSet_1, other?._id ?? ffi.nullptr); + } + + void intersectSet_(NSSet? other) { + _lib._objc_msgSend_471( + _id, _lib._sel_intersectSet_1, other?._id ?? ffi.nullptr); + } + + void minusSet_(NSSet? other) { + _lib._objc_msgSend_471( + _id, _lib._sel_minusSet_1, other?._id ?? ffi.nullptr); + } + + void unionSet_(NSSet? other) { + _lib._objc_msgSend_471( + _id, _lib._sel_unionSet_1, other?._id ?? ffi.nullptr); + } + + void sortUsingComparator_( + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + _lib._objc_msgSend_452(_id, _lib._sel_sortUsingComparator_1, cmptr._id); + } + + void sortWithOptions_usingComparator_( + int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + _lib._objc_msgSend_453( + _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr._id); + } + + void sortRange_options_usingComparator_(_NSRange range, int opts, + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + _lib._objc_msgSend_472(_id, _lib._sel_sortRange_options_usingComparator_1, + range, opts, cmptr._id); + } + + static NSMutableOrderedSet orderedSetWithCapacity_( + SentryCocoa _lib, int numItems) { + final _ret = _lib._objc_msgSend_60(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithCapacity_1, numItems); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void applyDifference_(NSObject? difference) { + _lib._objc_msgSend_15( + _id, _lib._sel_applyDifference_1, difference?._id ?? ffi.nullptr); + } + + void sortUsingDescriptors_(NSArray? sortDescriptors) { + _lib._objc_msgSend_441(_id, _lib._sel_sortUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + } + + void filterUsingPredicate_(NSPredicate? p) { + _lib._objc_msgSend_456( + _id, _lib._sel_filterUsingPredicate_1, p?._id ?? ffi.nullptr); + } + + @override + NSMutableOrderedSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSet(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_orderedSet1); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObject_( + SentryCocoa _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObject_1, object._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObjects_count_( + SentryCocoa _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObjects_count_1, objects, cnt); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithObjects_( + SentryCocoa _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithObjects_1, firstObj._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithOrderedSet_( + SentryCocoa _lib, NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_459(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithOrderedSet_range_copyItems_( + SentryCocoa _lib, NSOrderedSet? set, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_460( + _lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet orderedSetWithArray_( + SentryCocoa _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithArray_range_copyItems_( + SentryCocoa _lib, NSArray? array, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_461( + _lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithArray_range_copyItems_1, + array?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet orderedSetWithSet_(SentryCocoa _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_382(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableOrderedSet orderedSetWithSet_copyItems_( + SentryCocoa _lib, NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_383(_lib._class_NSMutableOrderedSet1, + _lib._sel_orderedSetWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableOrderedSet initWithObject_(NSObject object) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObject_1, object._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet initWithOrderedSet_(NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_459( + _id, _lib._sel_initWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet initWithOrderedSet_copyItems_( + NSOrderedSet? set, bool flag) { + final _ret = _lib._objc_msgSend_462( + _id, + _lib._sel_initWithOrderedSet_copyItems_1, + set?._id ?? ffi.nullptr, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableOrderedSet initWithOrderedSet_range_copyItems_( + NSOrderedSet? set, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_460( + _id, + _lib._sel_initWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableOrderedSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet initWithArray_copyItems_(NSArray? set, bool flag) { + final _ret = _lib._objc_msgSend_118(_id, + _lib._sel_initWithArray_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableOrderedSet initWithArray_range_copyItems_( + NSArray? set, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_461( + _id, + _lib._sel_initWithArray_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableOrderedSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_382( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableOrderedSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_383( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableOrderedSet1, _lib._sel_new1); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableOrderedSet1, _lib._sel_allocWithZone_1, zone); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableOrderedSet alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_alloc1); + return NSMutableOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableOrderedSet1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableOrderedSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableOrderedSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableOrderedSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableOrderedSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMutableOrderedSet1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableOrderedSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOrderedSet extends NSObject { + NSOrderedSet._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOrderedSet] that points to the same underlying object as [other]. + static NSOrderedSet castFrom(T other) { + return NSOrderedSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOrderedSet] that wraps the given raw object pointer. + static NSOrderedSet castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOrderedSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOrderedSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOrderedSet1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + NSObject objectAtIndex_(int idx) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndex_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_(NSObject object) { + return _lib._objc_msgSend_69(_id, _lib._sel_indexOfObject_1, object._id); + } + + @override + NSOrderedSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + void getObjects_range_( + ffi.Pointer> objects, _NSRange range) { + _lib._objc_msgSend_68(_id, _lib._sel_getObjects_range_1, objects, range); + } + + NSArray objectsAtIndexes_(NSIndexSet? indexes) { + final _ret = _lib._objc_msgSend_105( + _id, _lib._sel_objectsAtIndexes_1, indexes?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSObject get firstObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_firstObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get lastObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_lastObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_457( + _id, _lib._sel_isEqualToOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool containsObject_(NSObject object) { + return _lib._objc_msgSend_0(_id, _lib._sel_containsObject_1, object._id); + } + + bool intersectsOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_457( + _id, _lib._sel_intersectsOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool intersectsSet_(NSSet? set) { + return _lib._objc_msgSend_374( + _id, _lib._sel_intersectsSet_1, set?._id ?? ffi.nullptr); + } + + bool isSubsetOfOrderedSet_(NSOrderedSet? other) { + return _lib._objc_msgSend_457( + _id, _lib._sel_isSubsetOfOrderedSet_1, other?._id ?? ffi.nullptr); + } + + bool isSubsetOfSet_(NSSet? set) { + return _lib._objc_msgSend_374( + _id, _lib._sel_isSubsetOfSet_1, set?._id ?? ffi.nullptr); + } + + NSObject objectAtIndexedSubscript_(int idx) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_objectAtIndexedSubscript_1, idx); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator objectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_objectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSEnumerator reverseObjectEnumerator() { + final _ret = _lib._objc_msgSend_72(_id, _lib._sel_reverseObjectEnumerator1); + return NSEnumerator._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet? get reversedOrderedSet { + final _ret = _lib._objc_msgSend_458(_id, _lib._sel_reversedOrderedSet1); + return _ret.address == 0 + ? null + : NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSArray? get array { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_array1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSSet? get set1 { + final _ret = _lib._objc_msgSend_295(_id, _lib._sel_set1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + void enumerateObjectsUsingBlock_( + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_106( + _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); + } + + void enumerateObjectsWithOptions_usingBlock_( + int opts, ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_107(_id, + _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); + } + + void enumerateObjectsAtIndexes_options_usingBlock_(NSIndexSet? s, int opts, + ObjCBlock_ffiVoid_ObjCObject_ffiUnsignedLong_bool block) { + _lib._objc_msgSend_108( + _id, + _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, + s?._id ?? ffi.nullptr, + opts, + block._id); + } + + int indexOfObjectPassingTest_( + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_109( + _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); + } + + int indexOfObjectWithOptions_passingTest_( + int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_110(_id, + _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); + } + + int indexOfObjectAtIndexes_options_passingTest_(NSIndexSet? s, int opts, + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + return _lib._objc_msgSend_111( + _id, + _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + } + + NSIndexSet indexesOfObjectsPassingTest_( + ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_112( + _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsWithOptions_passingTest_( + int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_113( + _id, + _lib._sel_indexesOfObjectsWithOptions_passingTest_1, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_(NSIndexSet? s, + int opts, ObjCBlock_bool_ObjCObject_ffiUnsignedLong_bool predicate) { + final _ret = _lib._objc_msgSend_114( + _id, + _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, + s?._id ?? ffi.nullptr, + opts, + predicate._id); + return NSIndexSet._(_ret, _lib, retain: true, release: true); + } + + int indexOfObject_inSortedRange_options_usingComparator_( + NSObject object, + _NSRange range, + int opts, + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmp) { + return _lib._objc_msgSend_117( + _id, + _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, + object._id, + range, + opts, + cmp._id); + } + + NSArray sortedArrayUsingComparator_( + ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + final _ret = _lib._objc_msgSend_115( + _id, _lib._sel_sortedArrayUsingComparator_1, cmptr._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray sortedArrayWithOptions_usingComparator_( + int opts, ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject cmptr) { + final _ret = _lib._objc_msgSend_116(_id, + _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr._id); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_(NSObject locale) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_descriptionWithLocale_1, locale._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString descriptionWithLocale_indent_(NSObject locale, int level) { + final _ret = _lib._objc_msgSend_66( + _id, _lib._sel_descriptionWithLocale_indent_1, locale._id, level); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSet(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_orderedSet1); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObject_(SentryCocoa _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObject_1, object._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObjects_count_( + SentryCocoa _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObjects_count_1, objects, cnt); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithObjects_( + SentryCocoa _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithObjects_1, firstObj._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithOrderedSet_( + SentryCocoa _lib, NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_459(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithOrderedSet_range_copyItems_( + SentryCocoa _lib, NSOrderedSet? set, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_460( + _lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet orderedSetWithArray_(SentryCocoa _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithArray_1, array?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithArray_range_copyItems_( + SentryCocoa _lib, NSArray? array, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_461( + _lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithArray_range_copyItems_1, + array?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet orderedSetWithSet_(SentryCocoa _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_382(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet orderedSetWithSet_copyItems_( + SentryCocoa _lib, NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_383(_lib._class_NSOrderedSet1, + _lib._sel_orderedSetWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithObject_(NSObject object) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObject_1, object._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithOrderedSet_(NSOrderedSet? set) { + final _ret = _lib._objc_msgSend_459( + _id, _lib._sel_initWithOrderedSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithOrderedSet_copyItems_(NSOrderedSet? set, bool flag) { + final _ret = _lib._objc_msgSend_462( + _id, + _lib._sel_initWithOrderedSet_copyItems_1, + set?._id ?? ffi.nullptr, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithOrderedSet_range_copyItems_( + NSOrderedSet? set, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_460( + _id, + _lib._sel_initWithOrderedSet_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithArray_copyItems_(NSArray? set, bool flag) { + final _ret = _lib._objc_msgSend_118(_id, + _lib._sel_initWithArray_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithArray_range_copyItems_( + NSArray? set, _NSRange range, bool flag) { + final _ret = _lib._objc_msgSend_461( + _id, + _lib._sel_initWithArray_range_copyItems_1, + set?._id ?? ffi.nullptr, + range, + flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSOrderedSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_382( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_383( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + NSObject differenceFromOrderedSet_withOptions_usingEquivalenceTest_( + NSOrderedSet? other, + int options, + ObjCBlock_bool_ObjCObject_ObjCObject block) { + final _ret = _lib._objc_msgSend_463( + _id, + _lib._sel_differenceFromOrderedSet_withOptions_usingEquivalenceTest_1, + other?._id ?? ffi.nullptr, + options, + block._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject differenceFromOrderedSet_withOptions_( + NSOrderedSet? other, int options) { + final _ret = _lib._objc_msgSend_464( + _id, + _lib._sel_differenceFromOrderedSet_withOptions_1, + other?._id ?? ffi.nullptr, + options); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject differenceFromOrderedSet_(NSOrderedSet? other) { + final _ret = _lib._objc_msgSend_459( + _id, _lib._sel_differenceFromOrderedSet_1, other?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet orderedSetByApplyingDifference_(NSObject? difference) { + final _ret = _lib._objc_msgSend_465( + _id, + _lib._sel_orderedSetByApplyingDifference_1, + difference?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSObject valueForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_valueForKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + void setValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + void addObserver_forKeyPath_options_context_(NSObject? observer, + NSString? keyPath, int options, ffi.Pointer context) { + _lib._objc_msgSend_130( + _id, + _lib._sel_addObserver_forKeyPath_options_context_1, + observer?._id ?? ffi.nullptr, + keyPath?._id ?? ffi.nullptr, + options, + context); + } + + @override + void removeObserver_forKeyPath_context_( + NSObject? observer, NSString? keyPath, ffi.Pointer context) { + _lib._objc_msgSend_131(_id, _lib._sel_removeObserver_forKeyPath_context_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr, context); + } + + @override + void removeObserver_forKeyPath_(NSObject? observer, NSString? keyPath) { + _lib._objc_msgSend_132(_id, _lib._sel_removeObserver_forKeyPath_1, + observer?._id ?? ffi.nullptr, keyPath?._id ?? ffi.nullptr); + } + + NSArray sortedArrayUsingDescriptors_(NSArray? sortDescriptors) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedArrayUsingDescriptors_1, + sortDescriptors?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSOrderedSet filteredOrderedSetUsingPredicate_(NSPredicate? p) { + final _ret = _lib._objc_msgSend_466(_id, + _lib._sel_filteredOrderedSetUsingPredicate_1, p?._id ?? ffi.nullptr); + return NSOrderedSet._(_ret, _lib, retain: true, release: true); + } + + static NSOrderedSet new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_new1); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSOrderedSet1, _lib._sel_allocWithZone_1, zone); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static NSOrderedSet alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOrderedSet1, _lib._sel_alloc1); + return NSOrderedSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSOrderedSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrderedSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOrderedSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOrderedSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOrderedSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSOrderedSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSOrderedSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOrderedSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableSet extends NSSet { + NSMutableSet._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableSet] that points to the same underlying object as [other]. + static NSMutableSet castFrom(T other) { + return NSMutableSet._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableSet] that wraps the given raw object pointer. + static NSMutableSet castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableSet._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableSet]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableSet1); + } + + void addObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_addObject_1, object._id); + } + + void removeObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_removeObject_1, object._id); + } + + @override + NSMutableSet initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableSet init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + NSMutableSet initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + void addObjectsFromArray_(NSArray? array) { + _lib._objc_msgSend_441( + _id, _lib._sel_addObjectsFromArray_1, array?._id ?? ffi.nullptr); + } + + void intersectSet_(NSSet? otherSet) { + _lib._objc_msgSend_471( + _id, _lib._sel_intersectSet_1, otherSet?._id ?? ffi.nullptr); + } + + void minusSet_(NSSet? otherSet) { + _lib._objc_msgSend_471( + _id, _lib._sel_minusSet_1, otherSet?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void unionSet_(NSSet? otherSet) { + _lib._objc_msgSend_471( + _id, _lib._sel_unionSet_1, otherSet?._id ?? ffi.nullptr); + } + + void setSet_(NSSet? otherSet) { + _lib._objc_msgSend_471( + _id, _lib._sel_setSet_1, otherSet?._id ?? ffi.nullptr); + } + + static NSMutableSet setWithCapacity_(SentryCocoa _lib, int numItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableSet1, _lib._sel_setWithCapacity_1, numItems); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + void filterUsingPredicate_(NSPredicate? predicate) { + _lib._objc_msgSend_456( + _id, _lib._sel_filterUsingPredicate_1, predicate?._id ?? ffi.nullptr); + } + + @override + NSMutableSet initWithObjects_count_( + ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61( + _id, _lib._sel_initWithObjects_count_1, objects, cnt); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet set1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_set1); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObject_(SentryCocoa _lib, NSObject object) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableSet1, _lib._sel_setWithObject_1, object._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObjects_count_( + SentryCocoa _lib, ffi.Pointer> objects, int cnt) { + final _ret = _lib._objc_msgSend_61(_lib._class_NSMutableSet1, + _lib._sel_setWithObjects_count_1, objects, cnt); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithObjects_(SentryCocoa _lib, NSObject firstObj) { + final _ret = _lib._objc_msgSend_16( + _lib._class_NSMutableSet1, _lib._sel_setWithObjects_1, firstObj._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithSet_(SentryCocoa _lib, NSSet? set) { + final _ret = _lib._objc_msgSend_382(_lib._class_NSMutableSet1, + _lib._sel_setWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet setWithArray_(SentryCocoa _lib, NSArray? array) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableSet1, + _lib._sel_setWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableSet initWithObjects_(NSObject firstObj) { + final _ret = + _lib._objc_msgSend_16(_id, _lib._sel_initWithObjects_1, firstObj._id); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableSet initWithSet_(NSSet? set) { + final _ret = _lib._objc_msgSend_382( + _id, _lib._sel_initWithSet_1, set?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableSet initWithSet_copyItems_(NSSet? set, bool flag) { + final _ret = _lib._objc_msgSend_383( + _id, _lib._sel_initWithSet_copyItems_1, set?._id ?? ffi.nullptr, flag); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableSet initWithArray_(NSArray? array) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithArray_1, array?._id ?? ffi.nullptr); + return NSMutableSet._(_ret, _lib, retain: true, release: true); + } + + static NSMutableSet new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_new1); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableSet allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableSet1, _lib._sel_allocWithZone_1, zone); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static NSMutableSet alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableSet1, _lib._sel_alloc1); + return NSMutableSet._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableSet1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableSet1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableSet1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableSet1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableSet1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableSet1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSMutableSet1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableSet1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSKeyValueChange { + static const int NSKeyValueChangeSetting = 1; + static const int NSKeyValueChangeInsertion = 2; + static const int NSKeyValueChangeRemoval = 3; + static const int NSKeyValueChangeReplacement = 4; +} + +abstract class NSKeyValueSetMutationKind { + static const int NSKeyValueUnionSetMutation = 1; + static const int NSKeyValueMinusSetMutation = 2; + static const int NSKeyValueIntersectSetMutation = 3; + static const int NSKeyValueSetSetMutation = 4; +} + +class NSKeyedArchiver extends NSCoder { + NSKeyedArchiver._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSKeyedArchiver] that points to the same underlying object as [other]. + static NSKeyedArchiver castFrom(T other) { + return NSKeyedArchiver._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSKeyedArchiver] that wraps the given raw object pointer. + static NSKeyedArchiver castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSKeyedArchiver._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSKeyedArchiver]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSKeyedArchiver1); + } + + NSKeyedArchiver initRequiringSecureCoding_(bool requiresSecureCoding) { + final _ret = _lib._objc_msgSend_481( + _id, _lib._sel_initRequiringSecureCoding_1, requiresSecureCoding); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSData archivedDataWithRootObject_requiringSecureCoding_error_( + SentryCocoa _lib, + NSObject object, + bool requiresSecureCoding, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_482( + _lib._class_NSKeyedArchiver1, + _lib._sel_archivedDataWithRootObject_requiringSecureCoding_error_1, + object._id, + requiresSecureCoding, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + @override + NSKeyedArchiver init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + NSKeyedArchiver initForWritingWithMutableData_(NSMutableData? data) { + final _ret = _lib._objc_msgSend_487(_id, + _lib._sel_initForWritingWithMutableData_1, data?._id ?? ffi.nullptr); + return NSKeyedArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSData archivedDataWithRootObject_( + SentryCocoa _lib, NSObject rootObject) { + final _ret = _lib._objc_msgSend_488(_lib._class_NSKeyedArchiver1, + _lib._sel_archivedDataWithRootObject_1, rootObject._id); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static bool archiveRootObject_toFile_( + SentryCocoa _lib, NSObject rootObject, NSString? path) { + return _lib._objc_msgSend_240( + _lib._class_NSKeyedArchiver1, + _lib._sel_archiveRootObject_toFile_1, + rootObject._id, + path?._id ?? ffi.nullptr); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + int get outputFormat { + return _lib._objc_msgSend_489(_id, _lib._sel_outputFormat1); + } + + set outputFormat(int value) { + return _lib._objc_msgSend_490(_id, _lib._sel_setOutputFormat_1, value); + } + + NSData? get encodedData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_encodedData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + void finishEncoding() { + _lib._objc_msgSend_1(_id, _lib._sel_finishEncoding1); + } + + static void setClassName_forClass_( + SentryCocoa _lib, NSString? codedName, NSObject cls) { + _lib._objc_msgSend_491( + _lib._class_NSKeyedArchiver1, + _lib._sel_setClassName_forClass_1, + codedName?._id ?? ffi.nullptr, + cls._id); + } + + static NSString classNameForClass_(SentryCocoa _lib, NSObject cls) { + final _ret = _lib._objc_msgSend_65( + _lib._class_NSKeyedArchiver1, _lib._sel_classNameForClass_1, cls._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + void encodeObject_forKey_(NSObject object, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_encodeObject_forKey_1, object._id, + key?._id ?? ffi.nullptr); + } + + @override + void encodeConditionalObject_forKey_(NSObject object, NSString? key) { + _lib._objc_msgSend_126(_id, _lib._sel_encodeConditionalObject_forKey_1, + object._id, key?._id ?? ffi.nullptr); + } + + @override + void encodeBool_forKey_(bool value, NSString? key) { + _lib._objc_msgSend_272( + _id, _lib._sel_encodeBool_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt_forKey_(int value, NSString? key) { + _lib._objc_msgSend_273( + _id, _lib._sel_encodeInt_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt32_forKey_(int value, NSString? key) { + _lib._objc_msgSend_274( + _id, _lib._sel_encodeInt32_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeInt64_forKey_(int value, NSString? key) { + _lib._objc_msgSend_275( + _id, _lib._sel_encodeInt64_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeFloat_forKey_(double value, NSString? key) { + _lib._objc_msgSend_276( + _id, _lib._sel_encodeFloat_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeDouble_forKey_(double value, NSString? key) { + _lib._objc_msgSend_277( + _id, _lib._sel_encodeDouble_forKey_1, value, key?._id ?? ffi.nullptr); + } + + @override + void encodeBytes_length_forKey_( + ffi.Pointer bytes, int length, NSString? key) { + _lib._objc_msgSend_278(_id, _lib._sel_encodeBytes_length_forKey_1, bytes, + length, key?._id ?? ffi.nullptr); + } + + @override + bool get requiresSecureCoding { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresSecureCoding1); + } + + set requiresSecureCoding(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setRequiresSecureCoding_1, value); + } + + static NSKeyedArchiver new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_new1); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSKeyedArchiver allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSKeyedArchiver1, _lib._sel_allocWithZone_1, zone); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSKeyedArchiver alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSKeyedArchiver1, _lib._sel_alloc1); + return NSKeyedArchiver._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSKeyedArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSKeyedArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSKeyedArchiver1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSKeyedArchiver1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSKeyedArchiver1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSKeyedArchiver1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSKeyedArchiver1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSKeyedArchiver1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSKeyedArchiver1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableData extends NSData { + NSMutableData._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableData] that points to the same underlying object as [other]. + static NSMutableData castFrom(T other) { + return NSMutableData._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMutableData] that wraps the given raw object pointer. + static NSMutableData castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableData._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableData]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMutableData1); + } + + ffi.Pointer get mutableBytes { + return _lib._objc_msgSend_19(_id, _lib._sel_mutableBytes1); + } + + @override + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + set length(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setLength_1, value); + } + + void appendBytes_length_(ffi.Pointer bytes, int length) { + _lib._objc_msgSend_21(_id, _lib._sel_appendBytes_length_1, bytes, length); + } + + void appendData_(NSData? other) { + _lib._objc_msgSend_263( + _id, _lib._sel_appendData_1, other?._id ?? ffi.nullptr); + } + + void increaseLengthBy_(int extraLength) { + _lib._objc_msgSend_439(_id, _lib._sel_increaseLengthBy_1, extraLength); + } + + void replaceBytesInRange_withBytes_( + _NSRange range, ffi.Pointer bytes) { + _lib._objc_msgSend_484( + _id, _lib._sel_replaceBytesInRange_withBytes_1, range, bytes); + } + + void resetBytesInRange_(_NSRange range) { + _lib._objc_msgSend_445(_id, _lib._sel_resetBytesInRange_1, range); + } + + void setData_(NSData? data) { + _lib._objc_msgSend_263(_id, _lib._sel_setData_1, data?._id ?? ffi.nullptr); + } + + void replaceBytesInRange_withBytes_length_(_NSRange range, + ffi.Pointer replacementBytes, int replacementLength) { + _lib._objc_msgSend_485( + _id, + _lib._sel_replaceBytesInRange_withBytes_length_1, + range, + replacementBytes, + replacementLength); + } + + static NSMutableData dataWithCapacity_(SentryCocoa _lib, int aNumItems) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableData1, _lib._sel_dataWithCapacity_1, aNumItems); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithLength_(SentryCocoa _lib, int length) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSMutableData1, _lib._sel_dataWithLength_1, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + NSMutableData initWithCapacity_(int capacity) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + NSMutableData initWithLength_(int length) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithLength_1, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + bool decompressUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + return _lib._objc_msgSend_486( + _id, _lib._sel_decompressUsingAlgorithm_error_1, algorithm, error); + } + + bool compressUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + return _lib._objc_msgSend_486( + _id, _lib._sel_compressUsingAlgorithm_error_1, algorithm, error); + } + + static NSMutableData data(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_data1); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithBytes_length_( + SentryCocoa _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252(_lib._class_NSMutableData1, + _lib._sel_dataWithBytes_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithBytesNoCopy_length_( + SentryCocoa _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252(_lib._class_NSMutableData1, + _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData dataWithBytesNoCopy_length_freeWhenDone_( + SentryCocoa _lib, ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_253(_lib._class_NSMutableData1, + _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData dataWithContentsOfFile_options_error_( + SentryCocoa _lib, + NSString? path, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_254( + _lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfURL_options_error_( + SentryCocoa _lib, + NSURL? url, + int readOptionsMask, + ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_255( + _lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfFile_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithContentsOfURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithBytes_length_(ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252( + _id, _lib._sel_initWithBytes_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithBytesNoCopy_length_( + ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_252( + _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableData initWithBytesNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, int length, bool b) { + final _ret = _lib._objc_msgSend_253(_id, + _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableData initWithBytesNoCopy_length_deallocator_( + ffi.Pointer bytes, + int length, + ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong deallocator) { + final _ret = _lib._objc_msgSend_256( + _id, + _lib._sel_initWithBytesNoCopy_length_deallocator_1, + bytes, + length, + deallocator._id); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableData initWithContentsOfFile_options_error_(NSString? path, + int readOptionsMask, ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_254( + _id, + _lib._sel_initWithContentsOfFile_options_error_1, + path?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithContentsOfURL_options_error_(NSURL? url, + int readOptionsMask, ffi.Pointer> errorPtr) { + final _ret = _lib._objc_msgSend_255( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + readOptionsMask, + errorPtr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_257( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData dataWithData_(SentryCocoa _lib, NSData? data) { + final _ret = _lib._objc_msgSend_257(_lib._class_NSMutableData1, + _lib._sel_dataWithData_1, data?._id ?? ffi.nullptr); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithBase64EncodedString_options_( + NSString? base64String, int options) { + final _ret = _lib._objc_msgSend_258( + _id, + _lib._sel_initWithBase64EncodedString_options_1, + base64String?._id ?? ffi.nullptr, + options); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData initWithBase64EncodedData_options_( + NSData? base64Data, int options) { + final _ret = _lib._objc_msgSend_260( + _id, + _lib._sel_initWithBase64EncodedData_options_1, + base64Data?._id ?? ffi.nullptr, + options); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData decompressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_262(_id, + _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData compressedDataUsingAlgorithm_error_( + int algorithm, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_262( + _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSObject dataWithContentsOfMappedFile_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableData1, + _lib._sel_dataWithContentsOfMappedFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableData init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableData._(_ret, _lib, retain: true, release: true); + } + + static NSMutableData new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_new1); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableData1, _lib._sel_allocWithZone_1, zone); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static NSMutableData alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_alloc1); + return NSMutableData._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableData1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableData1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableData1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableData1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableData1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableData1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSMutableData1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableData1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSPropertyListFormat { + static const int NSPropertyListOpenStepFormat = 1; + static const int NSPropertyListXMLFormat_v1_0 = 100; + static const int NSPropertyListBinaryFormat_v1_0 = 200; +} + +class NSThread extends NSObject { + NSThread._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSThread] that points to the same underlying object as [other]. + static NSThread castFrom(T other) { + return NSThread._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSThread] that wraps the given raw object pointer. + static NSThread castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSThread._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSThread]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSThread1); + } + + static NSThread? getCurrentThread(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_496(_lib._class_NSThread1, _lib._sel_currentThread1); + return _ret.address == 0 + ? null + : NSThread._(_ret, _lib, retain: true, release: true); + } + + static void detachNewThreadWithBlock_( + SentryCocoa _lib, ObjCBlock_ffiVoid block) { + _lib._objc_msgSend_497( + _lib._class_NSThread1, _lib._sel_detachNewThreadWithBlock_1, block._id); + } + + static void detachNewThreadSelector_toTarget_withObject_(SentryCocoa _lib, + ffi.Pointer selector, NSObject target, NSObject argument) { + _lib._objc_msgSend_498( + _lib._class_NSThread1, + _lib._sel_detachNewThreadSelector_toTarget_withObject_1, + selector, + target._id, + argument._id); + } + + static bool isMultiThreaded(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_isMultiThreaded1); + } + + NSMutableDictionary? get threadDictionary { + final _ret = _lib._objc_msgSend_503(_id, _lib._sel_threadDictionary1); + return _ret.address == 0 + ? null + : NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static void sleepUntilDate_(SentryCocoa _lib, NSDate? date) { + _lib._objc_msgSend_504(_lib._class_NSThread1, _lib._sel_sleepUntilDate_1, + date?._id ?? ffi.nullptr); + } + + static void sleepForTimeInterval_(SentryCocoa _lib, double ti) { + _lib._objc_msgSend_505( + _lib._class_NSThread1, _lib._sel_sleepForTimeInterval_1, ti); + } + + static void exit(SentryCocoa _lib) { + _lib._objc_msgSend_1(_lib._class_NSThread1, _lib._sel_exit1); + } + + double get threadPriority { + return _lib._objc_msgSend_155(_id, _lib._sel_threadPriority1); + } + + set threadPriority(double value) { + return _lib._objc_msgSend_506(_id, _lib._sel_setThreadPriority_1, value); + } + + int get qualityOfService { + return _lib._objc_msgSend_507(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + return _lib._objc_msgSend_508(_id, _lib._sel_setQualityOfService_1, value); + } + + static NSArray? getCallStackReturnAddresses(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSThread1, _lib._sel_callStackReturnAddresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getCallStackSymbols(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSThread1, _lib._sel_callStackSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + int get stackSize { + return _lib._objc_msgSend_10(_id, _lib._sel_stackSize1); + } + + set stackSize(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setStackSize_1, value); + } + + bool get isMainThread { + return _lib._objc_msgSend_12(_id, _lib._sel_isMainThread1); + } + + static NSThread? getMainThread(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_496(_lib._class_NSThread1, _lib._sel_mainThread1); + return _ret.address == 0 + ? null + : NSThread._(_ret, _lib, retain: true, release: true); + } + + @override + NSThread init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + NSThread initWithTarget_selector_object_( + NSObject target, ffi.Pointer selector, NSObject argument) { + final _ret = _lib._objc_msgSend_510( + _id, + _lib._sel_initWithTarget_selector_object_1, + target._id, + selector, + argument._id); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + NSThread initWithBlock_(ObjCBlock_ffiVoid block) { + final _ret = + _lib._objc_msgSend_511(_id, _lib._sel_initWithBlock_1, block._id); + return NSThread._(_ret, _lib, retain: true, release: true); + } + + bool get executing { + return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + void cancel() { + _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void start() { + _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void main() { + _lib._objc_msgSend_1(_id, _lib._sel_main1); + } + + static NSThread new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_new1); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static NSThread allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSThread1, _lib._sel_allocWithZone_1, zone); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static NSThread alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSThread1, _lib._sel_alloc1); + return NSThread._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSThread1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSThread1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSThread1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSThread1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSThread1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSThread1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSThread1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSThread1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_fnPtrTrampoline(ffi.Pointer<_ObjCBlock> block) { + return block.ref.target + .cast>() + .asFunction()(); +} + +final _ObjCBlock_ffiVoid_closureRegistry = {}; +int _ObjCBlock_ffiVoid_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_closureRegistryIndex; + _ObjCBlock_ffiVoid_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_closureTrampoline(ffi.Pointer<_ObjCBlock> block) { + return (_ObjCBlock_ffiVoid_closureRegistry[block.ref.target.address] as void + Function())(); +} + +class ObjCBlock_ffiVoid extends _ObjCBlockBase { + ObjCBlock_ffiVoid._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid.fromFunctionPointer( + SentryCocoa lib, ffi.Pointer> ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock_ffiVoid_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid.fromFunction(SentryCocoa lib, void Function() fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>( + _ObjCBlock_ffiVoid_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call() { + return _id.ref.invoke + .cast< + ffi + .NativeFunction block)>>() + .asFunction block)>()(_id); + } +} + +class NSMutableDictionary extends NSDictionary { + NSMutableDictionary._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableDictionary] that points to the same underlying object as [other]. + static NSMutableDictionary castFrom(T other) { + return NSMutableDictionary._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableDictionary] that wraps the given raw object pointer. + static NSMutableDictionary castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableDictionary._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableDictionary]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableDictionary1); + } + + void removeObjectForKey_(NSObject aKey) { + _lib._objc_msgSend_15(_id, _lib._sel_removeObjectForKey_1, aKey._id); + } + + void setObject_forKey_(NSObject anObject, NSObject? aKey) { + _lib._objc_msgSend_499(_id, _lib._sel_setObject_forKey_1, anObject._id, + aKey?._id ?? ffi.nullptr); + } + + @override + NSMutableDictionary init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithCapacity_(int numItems) { + final _ret = + _lib._objc_msgSend_60(_id, _lib._sel_initWithCapacity_1, numItems); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableDictionary initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + void addEntriesFromDictionary_(NSDictionary? otherDictionary) { + _lib._objc_msgSend_476(_id, _lib._sel_addEntriesFromDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + } + + void removeAllObjects() { + _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); + } + + void removeObjectsForKeys_(NSArray? keyArray) { + _lib._objc_msgSend_441( + _id, _lib._sel_removeObjectsForKeys_1, keyArray?._id ?? ffi.nullptr); + } + + void setDictionary_(NSDictionary? otherDictionary) { + _lib._objc_msgSend_476( + _id, _lib._sel_setDictionary_1, otherDictionary?._id ?? ffi.nullptr); + } + + void setObject_forKeyedSubscript_(NSObject obj, NSObject? key) { + _lib._objc_msgSend_499(_id, _lib._sel_setObject_forKeyedSubscript_1, + obj._id, key?._id ?? ffi.nullptr); + } + + static NSMutableDictionary dictionaryWithCapacity_( + SentryCocoa _lib, int numItems) { + final _ret = _lib._objc_msgSend_60(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithCapacity_1, numItems); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithContentsOfFile_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_500(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithContentsOfURL_( + SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_501(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithContentsOfFile_(NSString? path) { + final _ret = _lib._objc_msgSend_500( + _id, _lib._sel_initWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + NSMutableDictionary initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_501( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithSharedKeySet_( + SentryCocoa _lib, NSObject keyset) { + final _ret = _lib._objc_msgSend_502(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithSharedKeySet_1, keyset._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + void setValue_forKey_(NSObject value, NSString? key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setValue_forKey_1, value._id, key?._id ?? ffi.nullptr); + } + + @override + NSMutableDictionary initWithObjects_forKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_137( + _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionary(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_dictionary1); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObject_forKey_( + SentryCocoa _lib, NSObject object, NSObject? key) { + final _ret = _lib._objc_msgSend_148( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObject_forKey_1, + object._id, + key?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjects_forKeys_count_( + SentryCocoa _lib, + ffi.Pointer> objects, + ffi.Pointer> keys, + int cnt) { + final _ret = _lib._objc_msgSend_137(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjectsAndKeys_( + SentryCocoa _lib, NSObject firstObject) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithDictionary_( + SentryCocoa _lib, NSDictionary? dict) { + final _ret = _lib._objc_msgSend_149(_lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithDictionary_1, dict?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary dictionaryWithObjects_forKeys_( + SentryCocoa _lib, NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_150( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableDictionary initWithObjectsAndKeys_(NSObject firstObject) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableDictionary initWithDictionary_(NSDictionary? otherDictionary) { + final _ret = _lib._objc_msgSend_149(_id, _lib._sel_initWithDictionary_1, + otherDictionary?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableDictionary initWithDictionary_copyItems_( + NSDictionary? otherDictionary, bool flag) { + final _ret = _lib._objc_msgSend_151( + _id, + _lib._sel_initWithDictionary_copyItems_1, + otherDictionary?._id ?? ffi.nullptr, + flag); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableDictionary initWithObjects_forKeys_( + NSArray? objects, NSArray? keys) { + final _ret = _lib._objc_msgSend_150( + _id, + _lib._sel_initWithObjects_forKeys_1, + objects?._id ?? ffi.nullptr, + keys?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary dictionaryWithContentsOfURL_error_(SentryCocoa _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_152( + _lib._class_NSMutableDictionary1, + _lib._sel_dictionaryWithContentsOfURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSObject sharedKeySetForKeys_(SentryCocoa _lib, NSArray? keys) { + final _ret = _lib._objc_msgSend_67(_lib._class_NSMutableDictionary1, + _lib._sel_sharedKeySetForKeys_1, keys?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSMutableDictionary new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableDictionary1, _lib._sel_new1); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSMutableDictionary allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableDictionary1, _lib._sel_allocWithZone_1, zone); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static NSMutableDictionary alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_alloc1); + return NSMutableDictionary._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableDictionary1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableDictionary1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableDictionary1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableDictionary1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableDictionary1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableDictionary1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMutableDictionary1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableDictionary1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSQualityOfService { + static const int NSQualityOfServiceUserInteractive = 33; + static const int NSQualityOfServiceUserInitiated = 25; + static const int NSQualityOfServiceUtility = 17; + static const int NSQualityOfServiceBackground = 9; + static const int NSQualityOfServiceDefault = -1; +} + +class NSArchiver extends NSCoder { + NSArchiver._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSArchiver] that points to the same underlying object as [other]. + static NSArchiver castFrom(T other) { + return NSArchiver._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSArchiver] that wraps the given raw object pointer. + static NSArchiver castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSArchiver._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSArchiver]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSArchiver1); + } + + NSArchiver initForWritingWithMutableData_(NSMutableData? mdata) { + final _ret = _lib._objc_msgSend_487(_id, + _lib._sel_initForWritingWithMutableData_1, mdata?._id ?? ffi.nullptr); + return NSArchiver._(_ret, _lib, retain: true, release: true); + } + + NSMutableData? get archiverData { + final _ret = _lib._objc_msgSend_514(_id, _lib._sel_archiverData1); + return _ret.address == 0 + ? null + : NSMutableData._(_ret, _lib, retain: true, release: true); + } + + @override + void encodeRootObject_(NSObject rootObject) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeRootObject_1, rootObject._id); + } + + @override + void encodeConditionalObject_(NSObject object) { + _lib._objc_msgSend_15(_id, _lib._sel_encodeConditionalObject_1, object._id); + } + + static NSData archivedDataWithRootObject_( + SentryCocoa _lib, NSObject rootObject) { + final _ret = _lib._objc_msgSend_488(_lib._class_NSArchiver1, + _lib._sel_archivedDataWithRootObject_1, rootObject._id); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static bool archiveRootObject_toFile_( + SentryCocoa _lib, NSObject rootObject, NSString? path) { + return _lib._objc_msgSend_240( + _lib._class_NSArchiver1, + _lib._sel_archiveRootObject_toFile_1, + rootObject._id, + path?._id ?? ffi.nullptr); + } + + void encodeClassName_intoClassName_( + NSString? trueName, NSString? inArchiveName) { + _lib._objc_msgSend_515(_id, _lib._sel_encodeClassName_intoClassName_1, + trueName?._id ?? ffi.nullptr, inArchiveName?._id ?? ffi.nullptr); + } + + NSString classNameEncodedForTrueClassName_(NSString? trueName) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_classNameEncodedForTrueClassName_1, + trueName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void replaceObject_withObject_(NSObject object, NSObject newObject) { + _lib._objc_msgSend_499( + _id, _lib._sel_replaceObject_withObject_1, object._id, newObject._id); + } + + @override + NSArchiver init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSArchiver._(_ret, _lib, retain: true, release: true); + } + + static NSArchiver new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_new1); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSArchiver allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSArchiver1, _lib._sel_allocWithZone_1, zone); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static NSArchiver alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSArchiver1, _lib._sel_alloc1); + return NSArchiver._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSArchiver1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArchiver1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSArchiver1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSArchiver1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSArchiver1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSArchiver1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSArchiver1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSArchiver1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPortCoder extends NSCoder { + NSPortCoder._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPortCoder] that points to the same underlying object as [other]. + static NSPortCoder castFrom(T other) { + return NSPortCoder._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPortCoder] that wraps the given raw object pointer. + static NSPortCoder castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPortCoder._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPortCoder]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPortCoder1); + } + + bool isBycopy() { + return _lib._objc_msgSend_12(_id, _lib._sel_isBycopy1); + } + + bool isByref() { + return _lib._objc_msgSend_12(_id, _lib._sel_isByref1); + } + + void encodePortObject_(NSPort? aport) { + _lib._objc_msgSend_552( + _id, _lib._sel_encodePortObject_1, aport?._id ?? ffi.nullptr); + } + + NSPort decodePortObject() { + final _ret = _lib._objc_msgSend_517(_id, _lib._sel_decodePortObject1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + NSConnection connection() { + final _ret = _lib._objc_msgSend_536(_id, _lib._sel_connection1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject portCoderWithReceivePort_sendPort_components_( + SentryCocoa _lib, NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { + final _ret = _lib._objc_msgSend_553( + _lib._class_NSPortCoder1, + _lib._sel_portCoderWithReceivePort_sendPort_components_1, + rcvPort?._id ?? ffi.nullptr, + sndPort?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithReceivePort_sendPort_components_( + NSPort? rcvPort, NSPort? sndPort, NSArray? comps) { + final _ret = _lib._objc_msgSend_553( + _id, + _lib._sel_initWithReceivePort_sendPort_components_1, + rcvPort?._id ?? ffi.nullptr, + sndPort?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void dispatch() { + _lib._objc_msgSend_1(_id, _lib._sel_dispatch1); + } + + @override + NSPortCoder init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSPortCoder._(_ret, _lib, retain: true, release: true); + } + + static NSPortCoder new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_new1); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static NSPortCoder allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSPortCoder1, _lib._sel_allocWithZone_1, zone); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static NSPortCoder alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortCoder1, _lib._sel_alloc1); + return NSPortCoder._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSPortCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSPortCoder1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortCoder1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortCoder1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPortCoder1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPortCoder1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSPortCoder1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSPortCoder1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPortCoder1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPort extends NSObject { + NSPort._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPort] that points to the same underlying object as [other]. + static NSPort castFrom(T other) { + return NSPort._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPort] that wraps the given raw object pointer. + static NSPort castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPort._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPort]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSPort1); + } + + static NSPort port(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_517(_lib._class_NSPort1, _lib._sel_port1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + void invalidate() { + _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + void setDelegate_(NSObject? anObject) { + _lib._objc_msgSend_15( + _id, _lib._sel_setDelegate_1, anObject?._id ?? ffi.nullptr); + } + + NSObject delegate() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? runLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_scheduleInRunLoop_forMode_1, + runLoop?._id ?? ffi.nullptr, mode._id); + } + + void removeFromRunLoop_forMode_(NSRunLoop? runLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_removeFromRunLoop_forMode_1, + runLoop?._id ?? ffi.nullptr, mode._id); + } + + int get reservedSpaceLength { + return _lib._objc_msgSend_10(_id, _lib._sel_reservedSpaceLength1); + } + + bool sendBeforeDate_components_from_reserved_( + NSDate? limitDate, + NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _lib._objc_msgSend_534( + _id, + _lib._sel_sendBeforeDate_components_from_reserved_1, + limitDate?._id ?? ffi.nullptr, + components?._id ?? ffi.nullptr, + receivePort?._id ?? ffi.nullptr, + headerSpaceReserved); + } + + bool sendBeforeDate_msgid_components_from_reserved_( + NSDate? limitDate, + int msgID, + NSMutableArray? components, + NSPort? receivePort, + int headerSpaceReserved) { + return _lib._objc_msgSend_535( + _id, + _lib._sel_sendBeforeDate_msgid_components_from_reserved_1, + limitDate?._id ?? ffi.nullptr, + msgID, + components?._id ?? ffi.nullptr, + receivePort?._id ?? ffi.nullptr, + headerSpaceReserved); + } + + void addConnection_toRunLoop_forMode_( + NSConnection? conn, NSRunLoop? runLoop, NSString mode) { + _lib._objc_msgSend_551(_id, _lib._sel_addConnection_toRunLoop_forMode_1, + conn?._id ?? ffi.nullptr, runLoop?._id ?? ffi.nullptr, mode._id); + } + + void removeConnection_fromRunLoop_forMode_( + NSConnection? conn, NSRunLoop? runLoop, NSString mode) { + _lib._objc_msgSend_551( + _id, + _lib._sel_removeConnection_fromRunLoop_forMode_1, + conn?._id ?? ffi.nullptr, + runLoop?._id ?? ffi.nullptr, + mode._id); + } + + @override + NSPort init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + static NSPort new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_new1); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static NSPort allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSPort1, _lib._sel_allocWithZone_1, zone); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static NSPort alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSPort1, _lib._sel_alloc1); + return NSPort._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSPort1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSPort1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPort1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPort1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPort1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPort1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSPort1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSPort1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPort1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSRunLoop extends NSObject { + NSRunLoop._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSRunLoop] that points to the same underlying object as [other]. + static NSRunLoop castFrom(T other) { + return NSRunLoop._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSRunLoop] that wraps the given raw object pointer. + static NSRunLoop castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSRunLoop._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSRunLoop]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSRunLoop1); + } + + static NSRunLoop? getCurrentRunLoop(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_518( + _lib._class_NSRunLoop1, _lib._sel_currentRunLoop1); + return _ret.address == 0 + ? null + : NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + static NSRunLoop? getMainRunLoop(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_518(_lib._class_NSRunLoop1, _lib._sel_mainRunLoop1); + return _ret.address == 0 + ? null + : NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + NSString get currentMode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentMode1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer<__CFRunLoop> getCFRunLoop() { + return _lib._objc_msgSend_519(_id, _lib._sel_getCFRunLoop1); + } + + void addTimer_forMode_(NSTimer? timer, NSString mode) { + _lib._objc_msgSend_526( + _id, _lib._sel_addTimer_forMode_1, timer?._id ?? ffi.nullptr, mode._id); + } + + void addPort_forMode_(NSPort? aPort, NSString mode) { + _lib._objc_msgSend_527( + _id, _lib._sel_addPort_forMode_1, aPort?._id ?? ffi.nullptr, mode._id); + } + + void removePort_forMode_(NSPort? aPort, NSString mode) { + _lib._objc_msgSend_527(_id, _lib._sel_removePort_forMode_1, + aPort?._id ?? ffi.nullptr, mode._id); + } + + NSDate limitDateForMode_(NSString mode) { + final _ret = + _lib._objc_msgSend_528(_id, _lib._sel_limitDateForMode_1, mode._id); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + void acceptInputForMode_beforeDate_(NSString mode, NSDate? limitDate) { + _lib._objc_msgSend_529(_id, _lib._sel_acceptInputForMode_beforeDate_1, + mode._id, limitDate?._id ?? ffi.nullptr); + } + + void run() { + _lib._objc_msgSend_1(_id, _lib._sel_run1); + } + + void runUntilDate_(NSDate? limitDate) { + _lib._objc_msgSend_504( + _id, _lib._sel_runUntilDate_1, limitDate?._id ?? ffi.nullptr); + } + + bool runMode_beforeDate_(NSString mode, NSDate? limitDate) { + return _lib._objc_msgSend_530(_id, _lib._sel_runMode_beforeDate_1, mode._id, + limitDate?._id ?? ffi.nullptr); + } + + void configureAsServer() { + _lib._objc_msgSend_1(_id, _lib._sel_configureAsServer1); + } + + void performInModes_block_(NSArray? modes, ObjCBlock_ffiVoid block) { + _lib._objc_msgSend_531(_id, _lib._sel_performInModes_block_1, + modes?._id ?? ffi.nullptr, block._id); + } + + void performBlock_(ObjCBlock_ffiVoid block) { + _lib._objc_msgSend_497(_id, _lib._sel_performBlock_1, block._id); + } + + void performSelector_target_argument_order_modes_( + ffi.Pointer aSelector, + NSObject target, + NSObject arg, + int order, + NSArray? modes) { + _lib._objc_msgSend_532( + _id, + _lib._sel_performSelector_target_argument_order_modes_1, + aSelector, + target._id, + arg._id, + order, + modes?._id ?? ffi.nullptr); + } + + void cancelPerformSelector_target_argument_( + ffi.Pointer aSelector, NSObject target, NSObject arg) { + _lib._objc_msgSend_498( + _id, + _lib._sel_cancelPerformSelector_target_argument_1, + aSelector, + target._id, + arg._id); + } + + void cancelPerformSelectorsWithTarget_(NSObject target) { + _lib._objc_msgSend_15( + _id, _lib._sel_cancelPerformSelectorsWithTarget_1, target._id); + } + + @override + NSRunLoop init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSRunLoop._(_ret, _lib, retain: true, release: true); + } + + static NSRunLoop new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_new1); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static NSRunLoop allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSRunLoop1, _lib._sel_allocWithZone_1, zone); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static NSRunLoop alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_alloc1); + return NSRunLoop._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSRunLoop1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSRunLoop1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRunLoop1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRunLoop1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSRunLoop1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSRunLoop1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSRunLoop1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSRunLoop1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRunLoop1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class __CFRunLoop extends ffi.Opaque {} + +class NSTimer extends NSObject { + NSTimer._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTimer] that points to the same underlying object as [other]. + static NSTimer castFrom(T other) { + return NSTimer._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTimer] that wraps the given raw object pointer. + static NSTimer castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTimer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTimer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTimer1); + } + + static NSTimer timerWithTimeInterval_invocation_repeats_( + SentryCocoa _lib, double ti, NSInvocation? invocation, bool yesOrNo) { + final _ret = _lib._objc_msgSend_520( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_invocation_repeats_1, + ti, + invocation?._id ?? ffi.nullptr, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( + SentryCocoa _lib, double ti, NSInvocation? invocation, bool yesOrNo) { + final _ret = _lib._objc_msgSend_520( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_invocation_repeats_1, + ti, + invocation?._id ?? ffi.nullptr, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( + SentryCocoa _lib, + double ti, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject userInfo, + bool yesOrNo) { + final _ret = _lib._objc_msgSend_521( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_target_selector_userInfo_repeats_1, + ti, + aTarget._id, + aSelector, + userInfo._id, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer + scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( + SentryCocoa _lib, + double ti, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject userInfo, + bool yesOrNo) { + final _ret = _lib._objc_msgSend_521( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_1, + ti, + aTarget._id, + aSelector, + userInfo._id, + yesOrNo); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer timerWithTimeInterval_repeats_block_(SentryCocoa _lib, + double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { + final _ret = _lib._objc_msgSend_522( + _lib._class_NSTimer1, + _lib._sel_timerWithTimeInterval_repeats_block_1, + interval, + repeats, + block._id); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer scheduledTimerWithTimeInterval_repeats_block_(SentryCocoa _lib, + double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { + final _ret = _lib._objc_msgSend_522( + _lib._class_NSTimer1, + _lib._sel_scheduledTimerWithTimeInterval_repeats_block_1, + interval, + repeats, + block._id); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + NSTimer initWithFireDate_interval_repeats_block_(NSDate? date, + double interval, bool repeats, ObjCBlock_ffiVoid_NSTimer block) { + final _ret = _lib._objc_msgSend_523( + _id, + _lib._sel_initWithFireDate_interval_repeats_block_1, + date?._id ?? ffi.nullptr, + interval, + repeats, + block._id); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( + NSDate? date, + double ti, + NSObject t, + ffi.Pointer s, + NSObject ui, + bool rep) { + final _ret = _lib._objc_msgSend_524( + _id, + _lib._sel_initWithFireDate_interval_target_selector_userInfo_repeats_1, + date?._id ?? ffi.nullptr, + ti, + t._id, + s, + ui._id, + rep); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + void fire() { + _lib._objc_msgSend_1(_id, _lib._sel_fire1); + } + + NSDate? get fireDate { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_fireDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set fireDate(NSDate? value) { + return _lib._objc_msgSend_525( + _id, _lib._sel_setFireDate_1, value?._id ?? ffi.nullptr); + } + + double get timeInterval { + return _lib._objc_msgSend_155(_id, _lib._sel_timeInterval1); + } + + double get tolerance { + return _lib._objc_msgSend_155(_id, _lib._sel_tolerance1); + } + + set tolerance(double value) { + return _lib._objc_msgSend_506(_id, _lib._sel_setTolerance_1, value); + } + + void invalidate() { + _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + NSObject get userInfo { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + @override + NSTimer init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSTimer._(_ret, _lib, retain: true, release: true); + } + + static NSTimer new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_new1); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static NSTimer allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSTimer1, _lib._sel_allocWithZone_1, zone); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static NSTimer alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTimer1, _lib._sel_alloc1); + return NSTimer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSTimer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSTimer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimer1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTimer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTimer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTimer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSTimer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSTimer1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTimer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSTimer_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSTimer_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSTimer_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSTimer_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSTimer_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSTimer_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSTimer_closureRegistry[block.ref.target.address] + as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSTimer extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSTimer._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSTimer.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSTimer.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSTimer_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSConnection extends NSObject { + NSConnection._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSConnection] that points to the same underlying object as [other]. + static NSConnection castFrom(T other) { + return NSConnection._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSConnection] that wraps the given raw object pointer. + static NSConnection castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSConnection._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSConnection]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSConnection1); + } + + NSDictionary? get statistics { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_statistics1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSArray allConnections(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSConnection1, _lib._sel_allConnections1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSConnection defaultConnection(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_536( + _lib._class_NSConnection1, _lib._sel_defaultConnection1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection connectionWithRegisteredName_host_( + SentryCocoa _lib, NSString? name, NSString? hostName) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSConnection1, + _lib._sel_connectionWithRegisteredName_host_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection connectionWithRegisteredName_host_usingNameServer_( + SentryCocoa _lib, + NSString? name, + NSString? hostName, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_541( + _lib._class_NSConnection1, + _lib._sel_connectionWithRegisteredName_host_usingNameServer_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr, + server?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSDistantObject rootProxyForConnectionWithRegisteredName_host_( + SentryCocoa _lib, NSString? name, NSString? hostName) { + final _ret = _lib._objc_msgSend_544( + _lib._class_NSConnection1, + _lib._sel_rootProxyForConnectionWithRegisteredName_host_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSDistantObject + rootProxyForConnectionWithRegisteredName_host_usingNameServer_( + SentryCocoa _lib, + NSString? name, + NSString? hostName, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_545( + _lib._class_NSConnection1, + _lib._sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_1, + name?._id ?? ffi.nullptr, + hostName?._id ?? ffi.nullptr, + server?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSConnection serviceConnectionWithName_rootObject_usingNameServer_( + SentryCocoa _lib, + NSString? name, + NSObject root, + NSPortNameServer? server) { + final _ret = _lib._objc_msgSend_546( + _lib._class_NSConnection1, + _lib._sel_serviceConnectionWithName_rootObject_usingNameServer_1, + name?._id ?? ffi.nullptr, + root._id, + server?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection serviceConnectionWithName_rootObject_( + SentryCocoa _lib, NSString? name, NSObject root) { + final _ret = _lib._objc_msgSend_163( + _lib._class_NSConnection1, + _lib._sel_serviceConnectionWithName_rootObject_1, + name?._id ?? ffi.nullptr, + root._id); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + double get requestTimeout { + return _lib._objc_msgSend_155(_id, _lib._sel_requestTimeout1); + } + + set requestTimeout(double value) { + return _lib._objc_msgSend_506(_id, _lib._sel_setRequestTimeout_1, value); + } + + double get replyTimeout { + return _lib._objc_msgSend_155(_id, _lib._sel_replyTimeout1); + } + + set replyTimeout(double value) { + return _lib._objc_msgSend_506(_id, _lib._sel_setReplyTimeout_1, value); + } + + NSObject get rootObject { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_rootObject1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set rootObject(NSObject value) { + return _lib._objc_msgSend_387(_id, _lib._sel_setRootObject_1, value._id); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get independentConversationQueueing { + return _lib._objc_msgSend_12( + _id, _lib._sel_independentConversationQueueing1); + } + + set independentConversationQueueing(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setIndependentConversationQueueing_1, value); + } + + bool get valid { + return _lib._objc_msgSend_12(_id, _lib._sel_isValid1); + } + + NSDistantObject? get rootProxy { + final _ret = _lib._objc_msgSend_547(_id, _lib._sel_rootProxy1); + return _ret.address == 0 + ? null + : NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + void invalidate() { + _lib._objc_msgSend_1(_id, _lib._sel_invalidate1); + } + + void addRequestMode_(NSString? rmode) { + _lib._objc_msgSend_192( + _id, _lib._sel_addRequestMode_1, rmode?._id ?? ffi.nullptr); + } + + void removeRequestMode_(NSString? rmode) { + _lib._objc_msgSend_192( + _id, _lib._sel_removeRequestMode_1, rmode?._id ?? ffi.nullptr); + } + + NSArray? get requestModes { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_requestModes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool registerName_(NSString? name) { + return _lib._objc_msgSend_59( + _id, _lib._sel_registerName_1, name?._id ?? ffi.nullptr); + } + + bool registerName_withNameServer_(NSString? name, NSPortNameServer? server) { + return _lib._objc_msgSend_548(_id, _lib._sel_registerName_withNameServer_1, + name?._id ?? ffi.nullptr, server?._id ?? ffi.nullptr); + } + + static NSConnection connectionWithReceivePort_sendPort_( + SentryCocoa _lib, NSPort? receivePort, NSPort? sendPort) { + final _ret = _lib._objc_msgSend_549( + _lib._class_NSConnection1, + _lib._sel_connectionWithReceivePort_sendPort_1, + receivePort?._id ?? ffi.nullptr, + sendPort?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject currentConversation(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSConnection1, _lib._sel_currentConversation1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSConnection initWithReceivePort_sendPort_( + NSPort? receivePort, NSPort? sendPort) { + final _ret = _lib._objc_msgSend_549( + _id, + _lib._sel_initWithReceivePort_sendPort_1, + receivePort?._id ?? ffi.nullptr, + sendPort?._id ?? ffi.nullptr); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + NSPort? get sendPort { + final _ret = _lib._objc_msgSend_517(_id, _lib._sel_sendPort1); + return _ret.address == 0 + ? null + : NSPort._(_ret, _lib, retain: true, release: true); + } + + NSPort? get receivePort { + final _ret = _lib._objc_msgSend_517(_id, _lib._sel_receivePort1); + return _ret.address == 0 + ? null + : NSPort._(_ret, _lib, retain: true, release: true); + } + + void enableMultipleThreads() { + _lib._objc_msgSend_1(_id, _lib._sel_enableMultipleThreads1); + } + + bool get multipleThreadsEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_multipleThreadsEnabled1); + } + + void addRunLoop_(NSRunLoop? runloop) { + _lib._objc_msgSend_550( + _id, _lib._sel_addRunLoop_1, runloop?._id ?? ffi.nullptr); + } + + void removeRunLoop_(NSRunLoop? runloop) { + _lib._objc_msgSend_550( + _id, _lib._sel_removeRunLoop_1, runloop?._id ?? ffi.nullptr); + } + + void runInNewThread() { + _lib._objc_msgSend_1(_id, _lib._sel_runInNewThread1); + } + + NSArray? get remoteObjects { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_remoteObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localObjects { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_localObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void dispatchWithComponents_(NSArray? components) { + _lib._objc_msgSend_441(_id, _lib._sel_dispatchWithComponents_1, + components?._id ?? ffi.nullptr); + } + + @override + NSConnection init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSConnection new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_new1); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static NSConnection allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSConnection1, _lib._sel_allocWithZone_1, zone); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static NSConnection alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSConnection1, _lib._sel_alloc1); + return NSConnection._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSConnection1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSConnection1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSConnection1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSConnection1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSConnection1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSConnection1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSConnection1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSPortNameServer extends NSObject { + NSPortNameServer._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPortNameServer] that points to the same underlying object as [other]. + static NSPortNameServer castFrom(T other) { + return NSPortNameServer._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSPortNameServer] that wraps the given raw object pointer. + static NSPortNameServer castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPortNameServer._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPortNameServer]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPortNameServer1); + } + + static NSPortNameServer systemDefaultPortNameServer(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_537( + _lib._class_NSPortNameServer1, _lib._sel_systemDefaultPortNameServer1); + return NSPortNameServer._(_ret, _lib, retain: true, release: true); + } + + NSPort portForName_(NSString? name) { + final _ret = _lib._objc_msgSend_538( + _id, _lib._sel_portForName_1, name?._id ?? ffi.nullptr); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + NSPort portForName_host_(NSString? name, NSString? host) { + final _ret = _lib._objc_msgSend_539(_id, _lib._sel_portForName_host_1, + name?._id ?? ffi.nullptr, host?._id ?? ffi.nullptr); + return NSPort._(_ret, _lib, retain: true, release: true); + } + + bool registerPort_name_(NSPort? port, NSString? name) { + return _lib._objc_msgSend_540(_id, _lib._sel_registerPort_name_1, + port?._id ?? ffi.nullptr, name?._id ?? ffi.nullptr); + } + + bool removePortForName_(NSString? name) { + return _lib._objc_msgSend_59( + _id, _lib._sel_removePortForName_1, name?._id ?? ffi.nullptr); + } + + @override + NSPortNameServer init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSPortNameServer._(_ret, _lib, retain: true, release: true); + } + + static NSPortNameServer new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_new1); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static NSPortNameServer allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSPortNameServer1, _lib._sel_allocWithZone_1, zone); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static NSPortNameServer alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPortNameServer1, _lib._sel_alloc1); + return NSPortNameServer._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSPortNameServer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSPortNameServer1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPortNameServer1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPortNameServer1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPortNameServer1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPortNameServer1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSPortNameServer1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSPortNameServer1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPortNameServer1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDistantObject extends NSProxy { + NSDistantObject._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDistantObject] that points to the same underlying object as [other]. + static NSDistantObject castFrom(T other) { + return NSDistantObject._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDistantObject] that wraps the given raw object pointer. + static NSDistantObject castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDistantObject._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDistantObject]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDistantObject1); + } + + static NSObject proxyWithTarget_connection_( + SentryCocoa _lib, NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_542( + _lib._class_NSDistantObject1, + _lib._sel_proxyWithTarget_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithTarget_connection_( + NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_542( + _id, + _lib._sel_initWithTarget_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject proxyWithLocal_connection_( + SentryCocoa _lib, NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_542( + _lib._class_NSDistantObject1, + _lib._sel_proxyWithLocal_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithLocal_connection_( + NSObject target, NSConnection? connection) { + final _ret = _lib._objc_msgSend_542( + _id, + _lib._sel_initWithLocal_connection_1, + target._id, + connection?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + NSDistantObject initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSDistantObject._(_ret, _lib, retain: true, release: true); + } + + void setProtocolForProxy_(Protocol? proto) { + _lib._objc_msgSend_543( + _id, _lib._sel_setProtocolForProxy_1, proto?._id ?? ffi.nullptr); + } + + NSConnection? get connectionForProxy { + final _ret = _lib._objc_msgSend_536(_id, _lib._sel_connectionForProxy1); + return _ret.address == 0 + ? null + : NSConnection._(_ret, _lib, retain: true, release: true); + } + + static NSObject alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDistantObject1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool respondsToSelector_( + SentryCocoa _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSDistantObject1, + _lib._sel_respondsToSelector_1, aSelector); + } +} + +class NSProxy extends _ObjCWrapper { + NSProxy._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProxy] that points to the same underlying object as [other]. + static NSProxy castFrom(T other) { + return NSProxy._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProxy] that wraps the given raw object pointer. + static NSProxy castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProxy._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProxy]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProxy1); + } + + static NSObject alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSProxy1, _lib._sel_allocWithZone_1, zone); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static NSObject class1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProxy1, _lib._sel_class1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void forwardInvocation_(NSInvocation? invocation) { + _lib._objc_msgSend_392( + _id, _lib._sel_forwardInvocation_1, invocation?._id ?? ffi.nullptr); + } + + NSMethodSignature methodSignatureForSelector_(ffi.Pointer sel) { + final _ret = _lib._objc_msgSend_393( + _id, _lib._sel_methodSignatureForSelector_1, sel); + return NSMethodSignature._(_ret, _lib, retain: true, release: true); + } + + void dealloc() { + _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); + } + + void finalize() { + _lib._objc_msgSend_1(_id, _lib._sel_finalize1); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get debugDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_debugDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static bool respondsToSelector_( + SentryCocoa _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4( + _lib._class_NSProxy1, _lib._sel_respondsToSelector_1, aSelector); + } + + bool allowsWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsWeakReference1); + } + + bool retainWeakReference() { + return _lib._objc_msgSend_12(_id, _lib._sel_retainWeakReference1); + } +} + +class NSClassDescription extends NSObject { + NSClassDescription._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSClassDescription] that points to the same underlying object as [other]. + static NSClassDescription castFrom(T other) { + return NSClassDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSClassDescription] that wraps the given raw object pointer. + static NSClassDescription castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSClassDescription._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSClassDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSClassDescription1); + } + + static void registerClassDescription_forClass_( + SentryCocoa _lib, NSClassDescription? description, NSObject aClass) { + _lib._objc_msgSend_555( + _lib._class_NSClassDescription1, + _lib._sel_registerClassDescription_forClass_1, + description?._id ?? ffi.nullptr, + aClass._id); + } + + static void invalidateClassDescriptionCache(SentryCocoa _lib) { + _lib._objc_msgSend_1(_lib._class_NSClassDescription1, + _lib._sel_invalidateClassDescriptionCache1); + } + + static NSClassDescription classDescriptionForClass_( + SentryCocoa _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_556(_lib._class_NSClassDescription1, + _lib._sel_classDescriptionForClass_1, aClass._id); + return NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get attributeKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_attributeKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get toOneRelationshipKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_toOneRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSArray? get toManyRelationshipKeys { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_toManyRelationshipKeys1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSString inverseForRelationshipKey_(NSString? relationshipKey) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_inverseForRelationshipKey_1, + relationshipKey?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSClassDescription init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSClassDescription._(_ret, _lib, retain: true, release: true); + } + + static NSClassDescription new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_new1); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSClassDescription allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSClassDescription1, _lib._sel_allocWithZone_1, zone); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSClassDescription alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSClassDescription1, _lib._sel_alloc1); + return NSClassDescription._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSClassDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSClassDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSClassDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSClassDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSClassDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSClassDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSClassDescription1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptObjectSpecifier extends NSObject { + NSScriptObjectSpecifier._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptObjectSpecifier] that points to the same underlying object as [other]. + static NSScriptObjectSpecifier castFrom(T other) { + return NSScriptObjectSpecifier._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptObjectSpecifier] that wraps the given raw object pointer. + static NSScriptObjectSpecifier castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptObjectSpecifier._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptObjectSpecifier]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptObjectSpecifier1); + } + + static NSScriptObjectSpecifier objectSpecifierWithDescriptor_( + SentryCocoa _lib, NSAppleEventDescriptor? descriptor) { + final _ret = _lib._objc_msgSend_580( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_objectSpecifierWithDescriptor_1, + descriptor?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier initWithContainerSpecifier_key_( + NSScriptObjectSpecifier? container, NSString? property) { + final _ret = _lib._objc_msgSend_581( + _id, + _lib._sel_initWithContainerSpecifier_key_1, + container?._id ?? ffi.nullptr, + property?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier + initWithContainerClassDescription_containerSpecifier_key_( + NSScriptClassDescription? classDesc, + NSScriptObjectSpecifier? container, + NSString? property) { + final _ret = _lib._objc_msgSend_598( + _id, + _lib._sel_initWithContainerClassDescription_containerSpecifier_key_1, + classDesc?._id ?? ffi.nullptr, + container?._id ?? ffi.nullptr, + property?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSScriptObjectSpecifier? get childSpecifier { + final _ret = _lib._objc_msgSend_588(_id, _lib._sel_childSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set childSpecifier(NSScriptObjectSpecifier? value) { + return _lib._objc_msgSend_589( + _id, _lib._sel_setChildSpecifier_1, value?._id ?? ffi.nullptr); + } + + NSScriptObjectSpecifier? get containerSpecifier { + final _ret = _lib._objc_msgSend_588(_id, _lib._sel_containerSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set containerSpecifier(NSScriptObjectSpecifier? value) { + return _lib._objc_msgSend_589( + _id, _lib._sel_setContainerSpecifier_1, value?._id ?? ffi.nullptr); + } + + bool get containerIsObjectBeingTested { + return _lib._objc_msgSend_12(_id, _lib._sel_containerIsObjectBeingTested1); + } + + set containerIsObjectBeingTested(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setContainerIsObjectBeingTested_1, value); + } + + bool get containerIsRangeContainerObject { + return _lib._objc_msgSend_12( + _id, _lib._sel_containerIsRangeContainerObject1); + } + + set containerIsRangeContainerObject(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setContainerIsRangeContainerObject_1, value); + } + + NSString? get key { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_key1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set key(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setKey_1, value?._id ?? ffi.nullptr); + } + + NSScriptClassDescription? get containerClassDescription { + final _ret = + _lib._objc_msgSend_584(_id, _lib._sel_containerClassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + set containerClassDescription(NSScriptClassDescription? value) { + return _lib._objc_msgSend_599(_id, _lib._sel_setContainerClassDescription_1, + value?._id ?? ffi.nullptr); + } + + NSScriptClassDescription? get keyClassDescription { + final _ret = _lib._objc_msgSend_584(_id, _lib._sel_keyClassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer indicesOfObjectsByEvaluatingWithContainer_count_( + NSObject container, ffi.Pointer count) { + return _lib._objc_msgSend_600( + _id, + _lib._sel_indicesOfObjectsByEvaluatingWithContainer_count_1, + container._id, + count); + } + + NSObject objectsByEvaluatingWithContainers_(NSObject containers) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_objectsByEvaluatingWithContainers_1, containers._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get objectsByEvaluatingSpecifier { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_objectsByEvaluatingSpecifier1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get evaluationErrorNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_evaluationErrorNumber1); + } + + set evaluationErrorNumber(int value) { + return _lib._objc_msgSend_590( + _id, _lib._sel_setEvaluationErrorNumber_1, value); + } + + NSScriptObjectSpecifier? get evaluationErrorSpecifier { + final _ret = + _lib._objc_msgSend_588(_id, _lib._sel_evaluationErrorSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor? get descriptor { + final _ret = _lib._objc_msgSend_558(_id, _lib._sel_descriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + @override + NSScriptObjectSpecifier init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + static NSScriptObjectSpecifier new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_new1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static NSScriptObjectSpecifier allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_allocWithZone_1, zone); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static NSScriptObjectSpecifier alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_alloc1); + return NSScriptObjectSpecifier._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptObjectSpecifier1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSScriptObjectSpecifier1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptObjectSpecifier1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSAppleEventDescriptor extends NSObject { + NSAppleEventDescriptor._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAppleEventDescriptor] that points to the same underlying object as [other]. + static NSAppleEventDescriptor castFrom(T other) { + return NSAppleEventDescriptor._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAppleEventDescriptor] that wraps the given raw object pointer. + static NSAppleEventDescriptor castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAppleEventDescriptor._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAppleEventDescriptor]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAppleEventDescriptor1); + } + + static NSAppleEventDescriptor nullDescriptor(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_558( + _lib._class_NSAppleEventDescriptor1, _lib._sel_nullDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDescriptorType_bytes_length_( + SentryCocoa _lib, + int descriptorType, + ffi.Pointer bytes, + int byteCount) { + final _ret = _lib._objc_msgSend_559( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDescriptorType_bytes_length_1, + descriptorType, + bytes, + byteCount); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDescriptorType_data_( + SentryCocoa _lib, int descriptorType, NSData? data) { + final _ret = _lib._objc_msgSend_560( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDescriptorType_data_1, + descriptorType, + data?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithBoolean_( + SentryCocoa _lib, int boolean) { + final _ret = _lib._objc_msgSend_561(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithBoolean_1, boolean); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithEnumCode_( + SentryCocoa _lib, int enumerator) { + final _ret = _lib._objc_msgSend_562(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithEnumCode_1, enumerator); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithInt32_( + SentryCocoa _lib, int signedInt) { + final _ret = _lib._objc_msgSend_563(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithInt32_1, signedInt); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDouble_( + SentryCocoa _lib, double doubleValue) { + final _ret = _lib._objc_msgSend_564(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDouble_1, doubleValue); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithTypeCode_( + SentryCocoa _lib, int typeCode) { + final _ret = _lib._objc_msgSend_562(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithTypeCode_1, typeCode); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_565(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithString_1, string?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithDate_( + SentryCocoa _lib, NSDate? date) { + final _ret = _lib._objc_msgSend_566(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithDate_1, date?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithFileURL_( + SentryCocoa _lib, NSURL? fileURL) { + final _ret = _lib._objc_msgSend_567(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithFileURL_1, fileURL?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor + appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_( + SentryCocoa _lib, + int eventClass, + int eventID, + NSAppleEventDescriptor? targetDescriptor, + int returnID, + int transactionID) { + final _ret = _lib._objc_msgSend_568( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, + eventClass, + eventID, + targetDescriptor?._id ?? ffi.nullptr, + returnID, + transactionID); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor listDescriptor(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_558( + _lib._class_NSAppleEventDescriptor1, _lib._sel_listDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor recordDescriptor(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_558( + _lib._class_NSAppleEventDescriptor1, _lib._sel_recordDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor currentProcessDescriptor(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_558(_lib._class_NSAppleEventDescriptor1, + _lib._sel_currentProcessDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithProcessIdentifier_( + SentryCocoa _lib, int processIdentifier) { + final _ret = _lib._objc_msgSend_563(_lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithProcessIdentifier_1, processIdentifier); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithBundleIdentifier_( + SentryCocoa _lib, NSString? bundleIdentifier) { + final _ret = _lib._objc_msgSend_565( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithBundleIdentifier_1, + bundleIdentifier?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor descriptorWithApplicationURL_( + SentryCocoa _lib, NSURL? applicationURL) { + final _ret = _lib._objc_msgSend_567( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_descriptorWithApplicationURL_1, + applicationURL?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initWithAEDescNoCopy_(ffi.Pointer aeDesc) { + final _ret = + _lib._objc_msgSend_569(_id, _lib._sel_initWithAEDescNoCopy_1, aeDesc); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + NSAppleEventDescriptor initWithDescriptorType_bytes_length_( + int descriptorType, ffi.Pointer bytes, int byteCount) { + final _ret = _lib._objc_msgSend_570( + _id, + _lib._sel_initWithDescriptorType_bytes_length_1, + descriptorType, + bytes, + byteCount); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initWithDescriptorType_data_( + int descriptorType, NSData? data) { + final _ret = _lib._objc_msgSend_571( + _id, + _lib._sel_initWithDescriptorType_data_1, + descriptorType, + data?._id ?? ffi.nullptr); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor + initWithEventClass_eventID_targetDescriptor_returnID_transactionID_( + int eventClass, + int eventID, + NSAppleEventDescriptor? targetDescriptor, + int returnID, + int transactionID) { + final _ret = _lib._objc_msgSend_572( + _id, + _lib._sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_1, + eventClass, + eventID, + targetDescriptor?._id ?? ffi.nullptr, + returnID, + transactionID); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initListDescriptor() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initListDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor initRecordDescriptor() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initRecordDescriptor1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer get aeDesc { + return _lib._objc_msgSend_573(_id, _lib._sel_aeDesc1); + } + + int get descriptorType { + return _lib._objc_msgSend_197(_id, _lib._sel_descriptorType1); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + int get booleanValue { + return _lib._objc_msgSend_216(_id, _lib._sel_booleanValue1); + } + + int get enumCodeValue { + return _lib._objc_msgSend_197(_id, _lib._sel_enumCodeValue1); + } + + int get int32Value { + return _lib._objc_msgSend_219(_id, _lib._sel_int32Value1); + } + + double get doubleValue { + return _lib._objc_msgSend_155(_id, _lib._sel_doubleValue1); + } + + int get typeCodeValue { + return _lib._objc_msgSend_197(_id, _lib._sel_typeCodeValue1); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate? get dateValue { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_dateValue1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSURL? get fileURLValue { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileURLValue1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get eventClass { + return _lib._objc_msgSend_197(_id, _lib._sel_eventClass1); + } + + int get eventID { + return _lib._objc_msgSend_197(_id, _lib._sel_eventID1); + } + + int get returnID { + return _lib._objc_msgSend_217(_id, _lib._sel_returnID1); + } + + int get transactionID { + return _lib._objc_msgSend_219(_id, _lib._sel_transactionID1); + } + + void setParamDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + _lib._objc_msgSend_574(_id, _lib._sel_setParamDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, keyword); + } + + NSAppleEventDescriptor paramDescriptorForKeyword_(int keyword) { + final _ret = _lib._objc_msgSend_562( + _id, _lib._sel_paramDescriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeParamDescriptorWithKeyword_(int keyword) { + _lib._objc_msgSend_575( + _id, _lib._sel_removeParamDescriptorWithKeyword_1, keyword); + } + + void setAttributeDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + _lib._objc_msgSend_574(_id, _lib._sel_setAttributeDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, keyword); + } + + NSAppleEventDescriptor attributeDescriptorForKeyword_(int keyword) { + final _ret = _lib._objc_msgSend_562( + _id, _lib._sel_attributeDescriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor sendEventWithOptions_timeout_error_(int sendOptions, + double timeoutInSeconds, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_576( + _id, + _lib._sel_sendEventWithOptions_timeout_error_1, + sendOptions, + timeoutInSeconds, + error); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + bool get isRecordDescriptor { + return _lib._objc_msgSend_12(_id, _lib._sel_isRecordDescriptor1); + } + + int get numberOfItems { + return _lib._objc_msgSend_78(_id, _lib._sel_numberOfItems1); + } + + void insertDescriptor_atIndex_( + NSAppleEventDescriptor? descriptor, int index) { + _lib._objc_msgSend_577(_id, _lib._sel_insertDescriptor_atIndex_1, + descriptor?._id ?? ffi.nullptr, index); + } + + NSAppleEventDescriptor descriptorAtIndex_(int index) { + final _ret = + _lib._objc_msgSend_578(_id, _lib._sel_descriptorAtIndex_1, index); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeDescriptorAtIndex_(int index) { + _lib._objc_msgSend_394(_id, _lib._sel_removeDescriptorAtIndex_1, index); + } + + void setDescriptor_forKeyword_( + NSAppleEventDescriptor? descriptor, int keyword) { + _lib._objc_msgSend_574(_id, _lib._sel_setDescriptor_forKeyword_1, + descriptor?._id ?? ffi.nullptr, keyword); + } + + NSAppleEventDescriptor descriptorForKeyword_(int keyword) { + final _ret = + _lib._objc_msgSend_562(_id, _lib._sel_descriptorForKeyword_1, keyword); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void removeDescriptorWithKeyword_(int keyword) { + _lib._objc_msgSend_575( + _id, _lib._sel_removeDescriptorWithKeyword_1, keyword); + } + + int keywordForDescriptorAtIndex_(int index) { + return _lib._objc_msgSend_579( + _id, _lib._sel_keywordForDescriptorAtIndex_1, index); + } + + NSAppleEventDescriptor coerceToDescriptorType_(int descriptorType) { + final _ret = _lib._objc_msgSend_562( + _id, _lib._sel_coerceToDescriptorType_1, descriptorType); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + @override + NSAppleEventDescriptor init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + static NSAppleEventDescriptor new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAppleEventDescriptor1, _lib._sel_new1); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static NSAppleEventDescriptor allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSAppleEventDescriptor1, _lib._sel_allocWithZone_1, zone); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static NSAppleEventDescriptor alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAppleEventDescriptor1, _lib._sel_alloc1); + return NSAppleEventDescriptor._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSAppleEventDescriptor1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSAppleEventDescriptor1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAppleEventDescriptor1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSAppleEventDescriptor1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSAppleEventDescriptor1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSAppleEventDescriptor1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +@ffi.Packed(2) +class AEDesc extends ffi.Struct { + @ffi.UnsignedInt() + external int descriptorType; + + external ffi.Pointer> dataHandle; +} + +class OpaqueAEDataStorageType extends ffi.Opaque {} + +abstract class NSAppleEventSendOptions { + static const int NSAppleEventSendNoReply = 1; + static const int NSAppleEventSendQueueReply = 2; + static const int NSAppleEventSendWaitForReply = 3; + static const int NSAppleEventSendNeverInteract = 16; + static const int NSAppleEventSendCanInteract = 32; + static const int NSAppleEventSendAlwaysInteract = 48; + static const int NSAppleEventSendCanSwitchLayer = 64; + static const int NSAppleEventSendDontRecord = 4096; + static const int NSAppleEventSendDontExecute = 8192; + static const int NSAppleEventSendDontAnnotate = 65536; + static const int NSAppleEventSendDefaultOptions = 35; +} + +class NSScriptClassDescription extends NSClassDescription { + NSScriptClassDescription._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptClassDescription] that points to the same underlying object as [other]. + static NSScriptClassDescription castFrom(T other) { + return NSScriptClassDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptClassDescription] that wraps the given raw object pointer. + static NSScriptClassDescription castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptClassDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptClassDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptClassDescription1); + } + + static NSScriptClassDescription classDescriptionForClass_( + SentryCocoa _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_582(_lib._class_NSScriptClassDescription1, + _lib._sel_classDescriptionForClass_1, aClass._id); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription initWithSuiteName_className_dictionary_( + NSString? suiteName, + NSString? className, + NSDictionary? classDeclaration) { + final _ret = _lib._objc_msgSend_583( + _id, + _lib._sel_initWithSuiteName_className_dictionary_1, + suiteName?._id ?? ffi.nullptr, + className?._id ?? ffi.nullptr, + classDeclaration?._id ?? ffi.nullptr); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + NSString? get suiteName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suiteName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get className { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_className1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get implementationClassName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_implementationClassName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription? get superclassDescription { + final _ret = _lib._objc_msgSend_584(_id, _lib._sel_superclassDescription1); + return _ret.address == 0 + ? null + : NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + int get appleEventCode { + return _lib._objc_msgSend_197(_id, _lib._sel_appleEventCode1); + } + + bool matchesAppleEventCode_(int appleEventCode) { + return _lib._objc_msgSend_179( + _id, _lib._sel_matchesAppleEventCode_1, appleEventCode); + } + + bool supportsCommand_(NSScriptCommandDescription? commandDescription) { + return _lib._objc_msgSend_594(_id, _lib._sel_supportsCommand_1, + commandDescription?._id ?? ffi.nullptr); + } + + ffi.Pointer selectorForCommand_( + NSScriptCommandDescription? commandDescription) { + return _lib._objc_msgSend_595(_id, _lib._sel_selectorForCommand_1, + commandDescription?._id ?? ffi.nullptr); + } + + NSString typeForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_typeForKey_1, key?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSScriptClassDescription classDescriptionForKey_(NSString? key) { + final _ret = _lib._objc_msgSend_596( + _id, _lib._sel_classDescriptionForKey_1, key?._id ?? ffi.nullptr); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + int appleEventCodeForKey_(NSString? key) { + return _lib._objc_msgSend_585( + _id, _lib._sel_appleEventCodeForKey_1, key?._id ?? ffi.nullptr); + } + + NSString keyWithAppleEventCode_(int appleEventCode) { + final _ret = _lib._objc_msgSend_597( + _id, _lib._sel_keyWithAppleEventCode_1, appleEventCode); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get defaultSubcontainerAttributeKey { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_defaultSubcontainerAttributeKey1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool isLocationRequiredToCreateForKey_(NSString? toManyRelationshipKey) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_isLocationRequiredToCreateForKey_1, + toManyRelationshipKey?._id ?? ffi.nullptr); + } + + bool hasPropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasPropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool hasOrderedToManyRelationshipForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_hasOrderedToManyRelationshipForKey_1, + key?._id ?? ffi.nullptr); + } + + bool hasReadablePropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasReadablePropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool hasWritablePropertyForKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_hasWritablePropertyForKey_1, key?._id ?? ffi.nullptr); + } + + bool isReadOnlyKey_(NSString? key) { + return _lib._objc_msgSend_59( + _id, _lib._sel_isReadOnlyKey_1, key?._id ?? ffi.nullptr); + } + + static void registerClassDescription_forClass_( + SentryCocoa _lib, NSClassDescription? description, NSObject aClass) { + _lib._objc_msgSend_555( + _lib._class_NSScriptClassDescription1, + _lib._sel_registerClassDescription_forClass_1, + description?._id ?? ffi.nullptr, + aClass._id); + } + + static void invalidateClassDescriptionCache(SentryCocoa _lib) { + _lib._objc_msgSend_1(_lib._class_NSScriptClassDescription1, + _lib._sel_invalidateClassDescriptionCache1); + } + + @override + NSScriptClassDescription init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSScriptClassDescription._(_ret, _lib, retain: true, release: true); + } + + static NSScriptClassDescription new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptClassDescription1, _lib._sel_new1); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSScriptClassDescription allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSScriptClassDescription1, _lib._sel_allocWithZone_1, zone); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static NSScriptClassDescription alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptClassDescription1, _lib._sel_alloc1); + return NSScriptClassDescription._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSScriptClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSScriptClassDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptClassDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptClassDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptClassDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptClassDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSScriptClassDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSScriptClassDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptClassDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptCommandDescription extends NSObject { + NSScriptCommandDescription._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptCommandDescription] that points to the same underlying object as [other]. + static NSScriptCommandDescription castFrom(T other) { + return NSScriptCommandDescription._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptCommandDescription] that wraps the given raw object pointer. + static NSScriptCommandDescription castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptCommandDescription._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptCommandDescription]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptCommandDescription1); + } + + @override + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommandDescription initWithSuiteName_commandName_dictionary_( + NSString? suiteName, + NSString? commandName, + NSDictionary? commandDeclaration) { + final _ret = _lib._objc_msgSend_583( + _id, + _lib._sel_initWithSuiteName_commandName_dictionary_1, + suiteName?._id ?? ffi.nullptr, + commandName?._id ?? ffi.nullptr, + commandDeclaration?._id ?? ffi.nullptr); + return NSScriptCommandDescription._(_ret, _lib, + retain: true, release: true); + } + + NSScriptCommandDescription initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptCommandDescription._(_ret, _lib, + retain: true, release: true); + } + + NSString? get suiteName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suiteName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get commandName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_commandName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get appleEventClassCode { + return _lib._objc_msgSend_197(_id, _lib._sel_appleEventClassCode1); + } + + int get appleEventCode { + return _lib._objc_msgSend_197(_id, _lib._sel_appleEventCode1); + } + + NSString? get commandClassName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_commandClassName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get returnType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_returnType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get appleEventCodeForReturnType { + return _lib._objc_msgSend_197(_id, _lib._sel_appleEventCodeForReturnType1); + } + + NSArray? get argumentNames { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_argumentNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString typeForArgumentWithName_(NSString? argumentName) { + final _ret = _lib._objc_msgSend_64(_id, _lib._sel_typeForArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int appleEventCodeForArgumentWithName_(NSString? argumentName) { + return _lib._objc_msgSend_585( + _id, + _lib._sel_appleEventCodeForArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + } + + bool isOptionalArgumentWithName_(NSString? argumentName) { + return _lib._objc_msgSend_59(_id, _lib._sel_isOptionalArgumentWithName_1, + argumentName?._id ?? ffi.nullptr); + } + + NSScriptCommand createCommandInstance() { + final _ret = _lib._objc_msgSend_592(_id, _lib._sel_createCommandInstance1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommand createCommandInstanceWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_593( + _id, _lib._sel_createCommandInstanceWithZone_1, zone); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + static NSScriptCommandDescription new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommandDescription1, _lib._sel_new1); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static NSScriptCommandDescription allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3(_lib._class_NSScriptCommandDescription1, + _lib._sel_allocWithZone_1, zone); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static NSScriptCommandDescription alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommandDescription1, _lib._sel_alloc1); + return NSScriptCommandDescription._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSScriptCommandDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSScriptCommandDescription1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptCommandDescription1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptCommandDescription1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptCommandDescription1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptCommandDescription1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSScriptCommandDescription1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSScriptCommandDescription1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScriptCommandDescription1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSScriptCommand extends NSObject { + NSScriptCommand._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScriptCommand] that points to the same underlying object as [other]. + static NSScriptCommand castFrom(T other) { + return NSScriptCommand._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSScriptCommand] that wraps the given raw object pointer. + static NSScriptCommand castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScriptCommand._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScriptCommand]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSScriptCommand1); + } + + NSScriptCommand initWithCommandDescription_( + NSScriptCommandDescription? commandDef) { + final _ret = _lib._objc_msgSend_586(_id, + _lib._sel_initWithCommandDescription_1, commandDef?._id ?? ffi.nullptr); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommand initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSScriptCommandDescription? get commandDescription { + final _ret = _lib._objc_msgSend_587(_id, _lib._sel_commandDescription1); + return _ret.address == 0 + ? null + : NSScriptCommandDescription._(_ret, _lib, retain: true, release: true); + } + + NSObject get directParameter { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_directParameter1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set directParameter(NSObject value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDirectParameter_1, value._id); + } + + NSScriptObjectSpecifier? get receiversSpecifier { + final _ret = _lib._objc_msgSend_588(_id, _lib._sel_receiversSpecifier1); + return _ret.address == 0 + ? null + : NSScriptObjectSpecifier._(_ret, _lib, retain: true, release: true); + } + + set receiversSpecifier(NSScriptObjectSpecifier? value) { + return _lib._objc_msgSend_589( + _id, _lib._sel_setReceiversSpecifier_1, value?._id ?? ffi.nullptr); + } + + NSObject get evaluatedReceivers { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_evaluatedReceivers1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get arguments { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set arguments(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get evaluatedArguments { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_evaluatedArguments1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + bool get wellFormed { + return _lib._objc_msgSend_12(_id, _lib._sel_isWellFormed1); + } + + NSObject performDefaultImplementation() { + final _ret = + _lib._objc_msgSend_2(_id, _lib._sel_performDefaultImplementation1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject executeCommand() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_executeCommand1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get scriptErrorNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_scriptErrorNumber1); + } + + set scriptErrorNumber(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setScriptErrorNumber_1, value); + } + + NSAppleEventDescriptor? get scriptErrorOffendingObjectDescriptor { + final _ret = _lib._objc_msgSend_558( + _id, _lib._sel_scriptErrorOffendingObjectDescriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor? value) { + return _lib._objc_msgSend_591( + _id, + _lib._sel_setScriptErrorOffendingObjectDescriptor_1, + value?._id ?? ffi.nullptr); + } + + NSAppleEventDescriptor? get scriptErrorExpectedTypeDescriptor { + final _ret = _lib._objc_msgSend_558( + _id, _lib._sel_scriptErrorExpectedTypeDescriptor1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor? value) { + return _lib._objc_msgSend_591( + _id, + _lib._sel_setScriptErrorExpectedTypeDescriptor_1, + value?._id ?? ffi.nullptr); + } + + NSString? get scriptErrorString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_scriptErrorString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set scriptErrorString(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setScriptErrorString_1, value?._id ?? ffi.nullptr); + } + + static NSScriptCommand currentCommand(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_592( + _lib._class_NSScriptCommand1, _lib._sel_currentCommand1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + NSAppleEventDescriptor? get appleEvent { + final _ret = _lib._objc_msgSend_558(_id, _lib._sel_appleEvent1); + return _ret.address == 0 + ? null + : NSAppleEventDescriptor._(_ret, _lib, retain: true, release: true); + } + + void suspendExecution() { + _lib._objc_msgSend_1(_id, _lib._sel_suspendExecution1); + } + + void resumeExecutionWithResult_(NSObject result) { + _lib._objc_msgSend_15( + _id, _lib._sel_resumeExecutionWithResult_1, result._id); + } + + @override + NSScriptCommand init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSScriptCommand._(_ret, _lib, retain: true, release: true); + } + + static NSScriptCommand new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_new1); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static NSScriptCommand allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSScriptCommand1, _lib._sel_allocWithZone_1, zone); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static NSScriptCommand alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSScriptCommand1, _lib._sel_alloc1); + return NSScriptCommand._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSScriptCommand1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSScriptCommand1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSScriptCommand1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScriptCommand1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScriptCommand1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScriptCommand1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSScriptCommand1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSScriptCommand1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScriptCommand1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSItemProvider extends NSObject { + NSItemProvider._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSItemProvider] that points to the same underlying object as [other]. + static NSItemProvider castFrom(T other) { + return NSItemProvider._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSItemProvider] that wraps the given raw object pointer. + static NSItemProvider castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSItemProvider._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSItemProvider]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSItemProvider1); + } + + @override + NSItemProvider init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerDataRepresentationForTypeIdentifier_visibility_loadHandler_( + NSString? typeIdentifier, + int visibility, + ObjCBlock_NSProgress_ffiVoidNSDataNSError loadHandler) { + _lib._objc_msgSend_623( + _id, + _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + visibility, + loadHandler._id); + } + + void + registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( + NSString? typeIdentifier, + int fileOptions, + int visibility, + ObjCBlock_NSProgress_ffiVoidNSURLboolNSError loadHandler) { + _lib._objc_msgSend_624( + _id, + _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions, + visibility, + loadHandler._id); + } + + NSArray? get registeredTypeIdentifiers { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_registeredTypeIdentifiers1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray registeredTypeIdentifiersWithFileOptions_(int fileOptions) { + final _ret = _lib._objc_msgSend_625( + _id, _lib._sel_registeredTypeIdentifiersWithFileOptions_1, fileOptions); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + bool hasItemConformingToTypeIdentifier_(NSString? typeIdentifier) { + return _lib._objc_msgSend_59( + _id, + _lib._sel_hasItemConformingToTypeIdentifier_1, + typeIdentifier?._id ?? ffi.nullptr); + } + + bool hasRepresentationConformingToTypeIdentifier_fileOptions_( + NSString? typeIdentifier, int fileOptions) { + return _lib._objc_msgSend_626( + _id, + _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, + typeIdentifier?._id ?? ffi.nullptr, + fileOptions); + } + + NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, + ObjCBlock_ffiVoid_NSData_NSError completionHandler) { + final _ret = _lib._objc_msgSend_627( + _id, + _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, + ObjCBlock_ffiVoid_NSURL_NSError completionHandler) { + final _ret = _lib._objc_msgSend_628( + _id, + _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( + NSString? typeIdentifier, + ObjCBlock_ffiVoid_NSURL_bool_NSError completionHandler) { + final _ret = _lib._objc_msgSend_629( + _id, + _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSString? get suggestedName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suggestedName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set suggestedName(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); + } + + NSItemProvider initWithObject_(NSObject? object) { + final _ret = _lib._objc_msgSend_16( + _id, _lib._sel_initWithObject_1, object?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerObject_visibility_(NSObject? object, int visibility) { + _lib._objc_msgSend_630(_id, _lib._sel_registerObject_visibility_1, + object?._id ?? ffi.nullptr, visibility); + } + + void registerObjectOfClass_visibility_loadHandler_( + NSObject? aClass, + int visibility, + ObjCBlock_NSProgress_ffiVoidObjCObjectNSError loadHandler) { + _lib._objc_msgSend_631( + _id, + _lib._sel_registerObjectOfClass_visibility_loadHandler_1, + aClass?._id ?? ffi.nullptr, + visibility, + loadHandler._id); + } + + bool canLoadObjectOfClass_(NSObject? aClass) { + return _lib._objc_msgSend_0( + _id, _lib._sel_canLoadObjectOfClass_1, aClass?._id ?? ffi.nullptr); + } + + NSProgress loadObjectOfClass_completionHandler_(NSObject? aClass, + ObjCBlock_ffiVoid_ObjCObject_NSError completionHandler) { + final _ret = _lib._objc_msgSend_632( + _id, + _lib._sel_loadObjectOfClass_completionHandler_1, + aClass?._id ?? ffi.nullptr, + completionHandler._id); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSItemProvider initWithItem_typeIdentifier_( + NSObject? item, NSString? typeIdentifier) { + final _ret = _lib._objc_msgSend_287( + _id, + _lib._sel_initWithItem_typeIdentifier_1, + item?._id ?? ffi.nullptr, + typeIdentifier?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + NSItemProvider initWithContentsOfURL_(NSURL? fileURL) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithContentsOfURL_1, fileURL?._id ?? ffi.nullptr); + return NSItemProvider._(_ret, _lib, retain: true, release: true); + } + + void registerItemForTypeIdentifier_loadHandler_( + NSString? typeIdentifier, + ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary + loadHandler) { + _lib._objc_msgSend_633( + _id, + _lib._sel_registerItemForTypeIdentifier_loadHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + loadHandler._id); + } + + void loadItemForTypeIdentifier_options_completionHandler_( + NSString? typeIdentifier, + NSDictionary? options, + ObjCBlock_ffiVoid_ObjCObject_NSError completionHandler) { + _lib._objc_msgSend_634( + _id, + _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, + typeIdentifier?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + completionHandler._id); + } + + ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary + get previewImageHandler { + final _ret = _lib._objc_msgSend_635(_id, _lib._sel_previewImageHandler1); + return ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary._( + _ret, _lib); + } + + set previewImageHandler( + ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary + value) { + return _lib._objc_msgSend_636( + _id, _lib._sel_setPreviewImageHandler_1, value._id); + } + + void loadPreviewImageWithOptions_completionHandler_(NSDictionary? options, + ObjCBlock_ffiVoid_ObjCObject_NSError completionHandler) { + _lib._objc_msgSend_637( + _id, + _lib._sel_loadPreviewImageWithOptions_completionHandler_1, + options?._id ?? ffi.nullptr, + completionHandler._id); + } + + static NSItemProvider new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_new1); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static NSItemProvider allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSItemProvider1, _lib._sel_allocWithZone_1, zone); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static NSItemProvider alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_alloc1); + return NSItemProvider._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSItemProvider1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSItemProvider1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSItemProvider1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSItemProvider1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSItemProvider1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSItemProvider1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSItemProvider1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSItemProvider1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSItemProvider1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSItemProviderRepresentationVisibility { + static const int NSItemProviderRepresentationVisibilityAll = 0; + static const int NSItemProviderRepresentationVisibilityTeam = 1; + static const int NSItemProviderRepresentationVisibilityGroup = 2; + static const int NSItemProviderRepresentationVisibilityOwnProcess = 3; +} + +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry = + {}; +int _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_registerClosure(Function fn) { + final id = ++_ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistryIndex; + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return (_ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry[ + block.ref.target.address] + as ffi.Pointer Function(ffi.Pointer<_ObjCBlock>))(arg0); +} + +class ObjCBlock_NSProgress_ffiVoidNSDataNSError extends _ObjCBlockBase { + ObjCBlock_NSProgress_ffiVoidNSDataNSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_NSProgress_ffiVoidNSDataNSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_NSProgress_ffiVoidNSDataNSError.fromFunction(SentryCocoa lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureTrampoline) + .cast(), + _ObjCBlock_NSProgress_ffiVoidNSDataNSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); + } +} + +class NSProgress extends NSObject { + NSProgress._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProgress] that points to the same underlying object as [other]. + static NSProgress castFrom(T other) { + return NSProgress._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProgress] that wraps the given raw object pointer. + static NSProgress castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProgress._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProgress]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProgress1); + } + + static NSProgress currentProgress(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_609( + _lib._class_NSProgress1, _lib._sel_currentProgress1); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress progressWithTotalUnitCount_( + SentryCocoa _lib, int unitCount) { + final _ret = _lib._objc_msgSend_610(_lib._class_NSProgress1, + _lib._sel_progressWithTotalUnitCount_1, unitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress discreteProgressWithTotalUnitCount_( + SentryCocoa _lib, int unitCount) { + final _ret = _lib._objc_msgSend_610(_lib._class_NSProgress1, + _lib._sel_discreteProgressWithTotalUnitCount_1, unitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( + SentryCocoa _lib, + int unitCount, + NSProgress? parent, + int portionOfParentTotalUnitCount) { + final _ret = _lib._objc_msgSend_611( + _lib._class_NSProgress1, + _lib._sel_progressWithTotalUnitCount_parent_pendingUnitCount_1, + unitCount, + parent?._id ?? ffi.nullptr, + portionOfParentTotalUnitCount); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSProgress initWithParent_userInfo_( + NSProgress? parentProgressOrNil, NSObject? userInfoOrNil) { + final _ret = _lib._objc_msgSend_612( + _id, + _lib._sel_initWithParent_userInfo_1, + parentProgressOrNil?._id ?? ffi.nullptr, + userInfoOrNil?._id ?? ffi.nullptr); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + void becomeCurrentWithPendingUnitCount_(int unitCount) { + _lib._objc_msgSend_613( + _id, _lib._sel_becomeCurrentWithPendingUnitCount_1, unitCount); + } + + void performAsCurrentWithPendingUnitCount_usingBlock_( + int unitCount, ObjCBlock_ffiVoid work) { + _lib._objc_msgSend_614( + _id, + _lib._sel_performAsCurrentWithPendingUnitCount_usingBlock_1, + unitCount, + work._id); + } + + void resignCurrent() { + _lib._objc_msgSend_1(_id, _lib._sel_resignCurrent1); + } + + void addChild_withPendingUnitCount_(NSProgress? child, int inUnitCount) { + _lib._objc_msgSend_615(_id, _lib._sel_addChild_withPendingUnitCount_1, + child?._id ?? ffi.nullptr, inUnitCount); + } + + int get totalUnitCount { + return _lib._objc_msgSend_616(_id, _lib._sel_totalUnitCount1); + } + + set totalUnitCount(int value) { + return _lib._objc_msgSend_617(_id, _lib._sel_setTotalUnitCount_1, value); + } + + int get completedUnitCount { + return _lib._objc_msgSend_616(_id, _lib._sel_completedUnitCount1); + } + + set completedUnitCount(int value) { + return _lib._objc_msgSend_617( + _id, _lib._sel_setCompletedUnitCount_1, value); + } + + NSString? get localizedDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set localizedDescription(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setLocalizedDescription_1, value?._id ?? ffi.nullptr); + } + + NSString? get localizedAdditionalDescription { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_localizedAdditionalDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set localizedAdditionalDescription(NSString? value) { + return _lib._objc_msgSend_509( + _id, + _lib._sel_setLocalizedAdditionalDescription_1, + value?._id ?? ffi.nullptr); + } + + bool get cancellable { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancellable1); + } + + set cancellable(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setCancellable_1, value); + } + + bool get pausable { + return _lib._objc_msgSend_12(_id, _lib._sel_isPausable1); + } + + set pausable(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setPausable_1, value); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + bool get paused { + return _lib._objc_msgSend_12(_id, _lib._sel_isPaused1); + } + + ObjCBlock_ffiVoid get cancellationHandler { + final _ret = _lib._objc_msgSend_618(_id, _lib._sel_cancellationHandler1); + return ObjCBlock_ffiVoid._(_ret, _lib); + } + + set cancellationHandler(ObjCBlock_ffiVoid value) { + return _lib._objc_msgSend_619( + _id, _lib._sel_setCancellationHandler_1, value._id); + } + + ObjCBlock_ffiVoid get pausingHandler { + final _ret = _lib._objc_msgSend_618(_id, _lib._sel_pausingHandler1); + return ObjCBlock_ffiVoid._(_ret, _lib); + } + + set pausingHandler(ObjCBlock_ffiVoid value) { + return _lib._objc_msgSend_619( + _id, _lib._sel_setPausingHandler_1, value._id); + } + + ObjCBlock_ffiVoid get resumingHandler { + final _ret = _lib._objc_msgSend_618(_id, _lib._sel_resumingHandler1); + return ObjCBlock_ffiVoid._(_ret, _lib); + } + + set resumingHandler(ObjCBlock_ffiVoid value) { + return _lib._objc_msgSend_619( + _id, _lib._sel_setResumingHandler_1, value._id); + } + + void setUserInfoObject_forKey_(NSObject objectOrNil, NSString key) { + _lib._objc_msgSend_126( + _id, _lib._sel_setUserInfoObject_forKey_1, objectOrNil._id, key._id); + } + + bool get indeterminate { + return _lib._objc_msgSend_12(_id, _lib._sel_isIndeterminate1); + } + + double get fractionCompleted { + return _lib._objc_msgSend_155(_id, _lib._sel_fractionCompleted1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + void cancel() { + _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void pause() { + _lib._objc_msgSend_1(_id, _lib._sel_pause1); + } + + void resume() { + _lib._objc_msgSend_1(_id, _lib._sel_resume1); + } + + NSObject? get userInfo { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString get kind { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_kind1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + set kind(NSString value) { + return _lib._objc_msgSend_509(_id, _lib._sel_setKind_1, value._id); + } + + NSNumber? get estimatedTimeRemaining { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_estimatedTimeRemaining1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set estimatedTimeRemaining(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setEstimatedTimeRemaining_1, value?._id ?? ffi.nullptr); + } + + NSNumber? get throughput { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_throughput1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set throughput(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setThroughput_1, value?._id ?? ffi.nullptr); + } + + NSString get fileOperationKind { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fileOperationKind1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + set fileOperationKind(NSString value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setFileOperationKind_1, value._id); + } + + NSURL? get fileURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_fileURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set fileURL(NSURL? value) { + return _lib._objc_msgSend_621( + _id, _lib._sel_setFileURL_1, value?._id ?? ffi.nullptr); + } + + NSNumber? get fileTotalCount { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_fileTotalCount1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set fileTotalCount(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setFileTotalCount_1, value?._id ?? ffi.nullptr); + } + + NSNumber? get fileCompletedCount { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_fileCompletedCount1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set fileCompletedCount(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setFileCompletedCount_1, value?._id ?? ffi.nullptr); + } + + void publish() { + _lib._objc_msgSend_1(_id, _lib._sel_publish1); + } + + void unpublish() { + _lib._objc_msgSend_1(_id, _lib._sel_unpublish1); + } + + static NSObject addSubscriberForFileURL_withPublishingHandler_( + SentryCocoa _lib, + NSURL? url, + ObjCBlock_ffiVoid_NSProgress publishingHandler) { + final _ret = _lib._objc_msgSend_622( + _lib._class_NSProgress1, + _lib._sel_addSubscriberForFileURL_withPublishingHandler_1, + url?._id ?? ffi.nullptr, + publishingHandler._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static void removeSubscriber_(SentryCocoa _lib, NSObject subscriber) { + _lib._objc_msgSend_15( + _lib._class_NSProgress1, _lib._sel_removeSubscriber_1, subscriber._id); + } + + bool get old { + return _lib._objc_msgSend_12(_id, _lib._sel_isOld1); + } + + @override + NSProgress init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSProgress._(_ret, _lib, retain: true, release: true); + } + + static NSProgress new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_new1); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static NSProgress allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSProgress1, _lib._sel_allocWithZone_1, zone); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static NSProgress alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_alloc1); + return NSProgress._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSProgress1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSProgress1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProgress1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProgress1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSProgress1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSProgress1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSProgress1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSProgress1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSProgress1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +ffi.Pointer<_ObjCBlock> _ObjCBlock_ffiVoid_NSProgress_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function(ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSProgress_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSProgress_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSProgress_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSProgress_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSProgress_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer<_ObjCBlock> _ObjCBlock_ffiVoid_NSProgress_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSProgress_closureRegistry[ + block.ref.target.address] + as ffi.Pointer<_ObjCBlock> Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSProgress extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSProgress._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSProgress.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSProgress_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSProgress.fromFunction(SentryCocoa lib, + ffi.Pointer<_ObjCBlock> Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer<_ObjCBlock> Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSProgress_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSProgress_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + ffi.Pointer<_ObjCBlock> call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer<_ObjCBlock> Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer<_ObjCBlock> Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSData_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSData_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_NSData_NSError_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_NSData_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSData_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSData_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSData_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSData_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSItemProviderFileOptions { + static const int NSItemProviderFileOptionOpenInPlace = 1; +} + +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry = + {}; +int _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_registerClosure(Function fn) { + final id = + ++_ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistryIndex; + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return (_ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry[ + block.ref.target.address] + as ffi.Pointer Function(ffi.Pointer<_ObjCBlock>))(arg0); +} + +class ObjCBlock_NSProgress_ffiVoidNSURLboolNSError extends _ObjCBlockBase { + ObjCBlock_NSProgress_ffiVoidNSURLboolNSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_NSProgress_ffiVoidNSURLboolNSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_NSProgress_ffiVoidNSURLboolNSError.fromFunction(SentryCocoa lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureTrampoline) + .cast(), + _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); + } +} + +void _ObjCBlock_ffiVoid_NSURL_bool_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, bool, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSURL_bool_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSURL_bool_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSURL_bool_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSURL_bool_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSURL_bool_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +void _ObjCBlock_ffiVoid_NSURL_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSURL_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_NSURL_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSURL_NSError._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSURL_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSURL_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSURL_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>()(arg0); +} + +final _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry = + {}; +int _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistryIndex; + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) { + return (_ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry[ + block.ref.target.address] + as ffi.Pointer Function(ffi.Pointer<_ObjCBlock>))(arg0); +} + +class ObjCBlock_NSProgress_ffiVoidObjCObjectNSError extends _ObjCBlockBase { + ObjCBlock_NSProgress_ffiVoidObjCObjectNSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_NSProgress_ffiVoidObjCObjectNSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_NSProgress_ffiVoidObjCObjectNSError.fromFunction(SentryCocoa lib, + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>( + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureTrampoline) + .cast(), + _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + ffi.Pointer call(ffi.Pointer<_ObjCBlock> arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0)>()(_id, arg0); + } +} + +void _ObjCBlock_ffiVoid_ObjCObject_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry = {}; +int _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_ObjCObject_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ObjCObject_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ObjCObject_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_ObjCObject_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ObjCObject_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +void + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistryIndex = + 0; +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistryIndex; + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistry[ + id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary + extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer<_ObjCBlock> arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ffiVoidObjCObjectNSError_ObjCObject_NSDictionary_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer<_ObjCBlock> arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer<_ObjCBlock> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSMutableString extends NSString { + NSMutableString._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableString] that points to the same underlying object as [other]. + static NSMutableString castFrom(T other) { + return NSMutableString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableString] that wraps the given raw object pointer. + static NSMutableString castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableString1); + } + + void replaceCharactersInRange_withString_(_NSRange range, NSString? aString) { + _lib._objc_msgSend_638(_id, _lib._sel_replaceCharactersInRange_withString_1, + range, aString?._id ?? ffi.nullptr); + } + + void insertString_atIndex_(NSString? aString, int loc) { + _lib._objc_msgSend_639(_id, _lib._sel_insertString_atIndex_1, + aString?._id ?? ffi.nullptr, loc); + } + + void deleteCharactersInRange_(_NSRange range) { + _lib._objc_msgSend_445(_id, _lib._sel_deleteCharactersInRange_1, range); + } + + void appendString_(NSString? aString) { + _lib._objc_msgSend_192( + _id, _lib._sel_appendString_1, aString?._id ?? ffi.nullptr); + } + + void appendFormat_(NSString? format) { + _lib._objc_msgSend_192( + _id, _lib._sel_appendFormat_1, format?._id ?? ffi.nullptr); + } + + void setString_(NSString? aString) { + _lib._objc_msgSend_192( + _id, _lib._sel_setString_1, aString?._id ?? ffi.nullptr); + } + + int replaceOccurrencesOfString_withString_options_range_(NSString? target, + NSString? replacement, int options, _NSRange searchRange) { + return _lib._objc_msgSend_640( + _id, + _lib._sel_replaceOccurrencesOfString_withString_options_range_1, + target?._id ?? ffi.nullptr, + replacement?._id ?? ffi.nullptr, + options, + searchRange); + } + + bool applyTransform_reverse_range_updatedRange_(NSString transform, + bool reverse, _NSRange range, ffi.Pointer<_NSRange> resultingRange) { + return _lib._objc_msgSend_641( + _id, + _lib._sel_applyTransform_reverse_range_updatedRange_1, + transform._id, + reverse, + range, + resultingRange); + } + + NSMutableString initWithCapacity_(int capacity) { + final _ret = + _lib._objc_msgSend_642(_id, _lib._sel_initWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCapacity_(SentryCocoa _lib, int capacity) { + final _ret = _lib._objc_msgSend_642( + _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static ffi.Pointer getAvailableStringEncodings( + SentryCocoa _lib) { + return _lib._objc_msgSend_333( + _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + } + + static NSString localizedNameOfStringEncoding_( + SentryCocoa _lib, int encoding) { + final _ret = _lib._objc_msgSend_308(_lib._class_NSMutableString1, + _lib._sel_localizedNameOfStringEncoding_1, encoding); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultCStringEncoding(SentryCocoa _lib) { + return _lib._objc_msgSend_10( + _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + } + + @override + NSMutableString initWithCharactersNoCopy_length_freeWhenDone_( + ffi.Pointer characters, int length, bool freeBuffer) { + final _ret = _lib._objc_msgSend_344( + _id, + _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, + characters, + length, + freeBuffer); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableString initWithCharactersNoCopy_length_deallocator_( + ffi.Pointer chars, + int len, + ObjCBlock_ffiVoid_ffiUnsignedShort_ffiUnsignedLong deallocator) { + final _ret = _lib._objc_msgSend_345( + _id, + _lib._sel_initWithCharactersNoCopy_length_deallocator_1, + chars, + len, + deallocator._id); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableString initWithCharacters_length_( + ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_346( + _id, _lib._sel_initWithCharacters_length_1, characters, length); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithUTF8String_( + ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_347( + _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithString_(NSString? aString) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, aString?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithFormat_(NSString? format) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithFormat_arguments_( + NSString? format, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_348( + _id, + _lib._sel_initWithFormat_arguments_1, + format?._id ?? ffi.nullptr, + argList); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithFormat_locale_(NSString? format, NSObject locale) { + final _ret = _lib._objc_msgSend_163(_id, _lib._sel_initWithFormat_locale_1, + format?._id ?? ffi.nullptr, locale._id); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithFormat_locale_arguments_( + NSString? format, NSObject locale, ffi.Pointer<__va_list_tag> argList) { + final _ret = _lib._objc_msgSend_349( + _id, + _lib._sel_initWithFormat_locale_arguments_1, + format?._id ?? ffi.nullptr, + locale._id, + argList); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithValidatedFormat_validFormatSpecifiers_error_( + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_350( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithValidatedFormat_validFormatSpecifiers_locale_error_( + NSString? format, + NSString? validFormatSpecifiers, + NSObject locale, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_351( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + locale._id, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString + initWithValidatedFormat_validFormatSpecifiers_arguments_error_( + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer<__va_list_tag> argList, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_352( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + argList, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString + initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( + NSString? format, + NSString? validFormatSpecifiers, + NSObject locale, + ffi.Pointer<__va_list_tag> argList, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_353( + _id, + _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + locale._id, + argList, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithData_encoding_(NSData? data, int encoding) { + final _ret = _lib._objc_msgSend_354(_id, _lib._sel_initWithData_encoding_1, + data?._id ?? ffi.nullptr, encoding); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithBytes_length_encoding_( + ffi.Pointer bytes, int len, int encoding) { + final _ret = _lib._objc_msgSend_355( + _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithBytesNoCopy_length_encoding_freeWhenDone_( + ffi.Pointer bytes, int len, int encoding, bool freeBuffer) { + final _ret = _lib._objc_msgSend_356( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, + bytes, + len, + encoding, + freeBuffer); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + @override + NSMutableString initWithBytesNoCopy_length_encoding_deallocator_( + ffi.Pointer bytes, + int len, + int encoding, + ObjCBlock_ffiVoid_ffiVoid_ffiUnsignedLong deallocator) { + final _ret = _lib._objc_msgSend_357( + _id, + _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, + bytes, + len, + encoding, + deallocator._id); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static NSMutableString string(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_string1); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithString_1, string?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCharacters_length_( + SentryCocoa _lib, ffi.Pointer characters, int length) { + final _ret = _lib._objc_msgSend_346(_lib._class_NSMutableString1, + _lib._sel_stringWithCharacters_length_1, characters, length); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithUTF8String_( + SentryCocoa _lib, ffi.Pointer nullTerminatedCString) { + final _ret = _lib._objc_msgSend_347(_lib._class_NSMutableString1, + _lib._sel_stringWithUTF8String_1, nullTerminatedCString); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithFormat_(SentryCocoa _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString localizedStringWithFormat_( + SentryCocoa _lib, NSString? format) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_localizedStringWithFormat_1, format?._id ?? ffi.nullptr); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithValidatedFormat_validFormatSpecifiers_error_( + SentryCocoa _lib, + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_350( + _lib._class_NSMutableString1, + _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString + localizedStringWithValidatedFormat_validFormatSpecifiers_error_( + SentryCocoa _lib, + NSString? format, + NSString? validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_350( + _lib._class_NSMutableString1, + _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, + format?._id ?? ffi.nullptr, + validFormatSpecifiers?._id ?? ffi.nullptr, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithCString_encoding_( + ffi.Pointer nullTerminatedCString, int encoding) { + final _ret = _lib._objc_msgSend_358(_id, + _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithCString_encoding_( + SentryCocoa _lib, ffi.Pointer cString, int enc) { + final _ret = _lib._objc_msgSend_358(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_encoding_1, cString, enc); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithContentsOfURL_encoding_error_( + NSURL? url, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_359( + _id, + _lib._sel_initWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithContentsOfFile_encoding_error_( + NSString? path, int enc, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_360( + _id, + _lib._sel_initWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfURL_encoding_error_( + SentryCocoa _lib, + NSURL? url, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_359( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_encoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfFile_encoding_error_( + SentryCocoa _lib, + NSString? path, + int enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_360( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_encoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithContentsOfURL_usedEncoding_error_( + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_361( + _id, + _lib._sel_initWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableString initWithContentsOfFile_usedEncoding_error_( + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_362( + _id, + _lib._sel_initWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfURL_usedEncoding_error_( + SentryCocoa _lib, + NSURL? url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_361( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, + url?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString stringWithContentsOfFile_usedEncoding_error_( + SentryCocoa _lib, + NSString? path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_362( + _lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, + path?._id ?? ffi.nullptr, + enc, + error); + return NSMutableString._(_ret, _lib, retain: true, release: true); + } + + static int + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + SentryCocoa _lib, + NSData? data, + NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _lib._objc_msgSend_363( + _lib._class_NSMutableString1, + _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, + data?._id ?? ffi.nullptr, + opts?._id ?? ffi.nullptr, + string, + usedLossyConversion); + } + + static NSObject stringWithContentsOfFile_(SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfFile_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithContentsOfURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSMutableString1, + _lib._sel_stringWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_length_( + SentryCocoa _lib, ffi.Pointer bytes, int length) { + final _ret = _lib._objc_msgSend_358(_lib._class_NSMutableString1, + _lib._sel_stringWithCString_length_1, bytes, length); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject stringWithCString_( + SentryCocoa _lib, ffi.Pointer bytes) { + final _ret = _lib._objc_msgSend_347( + _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString pathWithComponents_(SentryCocoa _lib, NSArray? components) { + final _ret = _lib._objc_msgSend_369(_lib._class_NSMutableString1, + _lib._sel_pathWithComponents_1, components?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableString new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_new1); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static NSMutableString allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableString1, _lib._sel_allocWithZone_1, zone); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static NSMutableString alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_alloc1); + return NSMutableString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMutableString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSNotification extends NSObject { + NSNotification._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNotification] that points to the same underlying object as [other]. + static NSNotification castFrom(T other) { + return NSNotification._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNotification] that wraps the given raw object pointer. + static NSNotification castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNotification._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNotification]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSNotification1); + } + + NSString get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSObject get object { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_object1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSNotification initWithName_object_userInfo_( + NSString name, NSObject object, NSDictionary? userInfo) { + final _ret = _lib._objc_msgSend_643( + _id, + _lib._sel_initWithName_object_userInfo_1, + name._id, + object._id, + userInfo?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + NSNotification initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification notificationWithName_object_( + SentryCocoa _lib, NSString aName, NSObject anObject) { + final _ret = _lib._objc_msgSend_163(_lib._class_NSNotification1, + _lib._sel_notificationWithName_object_1, aName._id, anObject._id); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification notificationWithName_object_userInfo_(SentryCocoa _lib, + NSString aName, NSObject anObject, NSDictionary? aUserInfo) { + final _ret = _lib._objc_msgSend_643( + _lib._class_NSNotification1, + _lib._sel_notificationWithName_object_userInfo_1, + aName._id, + anObject._id, + aUserInfo?._id ?? ffi.nullptr); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + @override + NSNotification init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSNotification._(_ret, _lib, retain: true, release: true); + } + + static NSNotification new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_new1); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static NSNotification allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSNotification1, _lib._sel_allocWithZone_1, zone); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static NSNotification alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_alloc1); + return NSNotification._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSNotification1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSNotification1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSNotification1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNotification1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNotification1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNotification1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSNotification1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSNotification1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNotification1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSBundle extends NSObject { + NSBundle._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSBundle] that points to the same underlying object as [other]. + static NSBundle castFrom(T other) { + return NSBundle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSBundle] that wraps the given raw object pointer. + static NSBundle castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSBundle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSBundle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSBundle1); + } + + static NSBundle? getMainBundle(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_644(_lib._class_NSBundle1, _lib._sel_mainBundle1); + return _ret.address == 0 + ? null + : NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithPath_(SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSBundle1, + _lib._sel_bundleWithPath_1, path?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + NSBundle initWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithPath_1, path?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSBundle1, + _lib._sel_bundleWithURL_1, url?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + NSBundle initWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithURL_1, url?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleForClass_(SentryCocoa _lib, NSObject aClass) { + final _ret = _lib._objc_msgSend_645( + _lib._class_NSBundle1, _lib._sel_bundleForClass_1, aClass._id); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle bundleWithIdentifier_( + SentryCocoa _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_646(_lib._class_NSBundle1, + _lib._sel_bundleWithIdentifier_1, identifier?._id ?? ffi.nullptr); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAllBundles(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_79(_lib._class_NSBundle1, _lib._sel_allBundles1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray? getAllFrameworks(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_79(_lib._class_NSBundle1, _lib._sel_allFrameworks1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + bool load() { + return _lib._objc_msgSend_12(_id, _lib._sel_load1); + } + + bool get loaded { + return _lib._objc_msgSend_12(_id, _lib._sel_isLoaded1); + } + + bool unload() { + return _lib._objc_msgSend_12(_id, _lib._sel_unload1); + } + + bool preflightAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_225( + _id, _lib._sel_preflightAndReturnError_1, error); + } + + bool loadAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_225(_id, _lib._sel_loadAndReturnError_1, error); + } + + NSURL? get bundleURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_bundleURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get resourceURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_resourceURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get executableURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_executableURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForAuxiliaryExecutable_(NSString? executableName) { + final _ret = _lib._objc_msgSend_34( + _id, + _lib._sel_URLForAuxiliaryExecutable_1, + executableName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get privateFrameworksURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_privateFrameworksURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get sharedFrameworksURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_sharedFrameworksURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get sharedSupportURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_sharedSupportURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get builtInPlugInsURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_builtInPlugInsURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL? get appStoreReceiptURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_appStoreReceiptURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get bundlePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_bundlePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get resourcePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_resourcePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get executablePath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_executablePath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString pathForAuxiliaryExecutable_(NSString? executableName) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_pathForAuxiliaryExecutable_1, + executableName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get privateFrameworksPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_privateFrameworksPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get sharedFrameworksPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sharedFrameworksPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get sharedSupportPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sharedSupportPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get builtInPlugInsPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_builtInPlugInsPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSURL URLForResource_withExtension_subdirectory_inBundleWithURL_( + SentryCocoa _lib, + NSString? name, + NSString? ext, + NSString? subpath, + NSURL? bundleURL) { + final _ret = _lib._objc_msgSend_647( + _lib._class_NSBundle1, + _lib._sel_URLForResource_withExtension_subdirectory_inBundleWithURL_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + bundleURL?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + static NSArray URLsForResourcesWithExtension_subdirectory_inBundleWithURL_( + SentryCocoa _lib, NSString? ext, NSString? subpath, NSURL? bundleURL) { + final _ret = _lib._objc_msgSend_648( + _lib._class_NSBundle1, + _lib._sel_URLsForResourcesWithExtension_subdirectory_inBundleWithURL_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + bundleURL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_(NSString? name, NSString? ext) { + final _ret = _lib._objc_msgSend_649( + _id, + _lib._sel_URLForResource_withExtension_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_subdirectory_( + NSString? name, NSString? ext, NSString? subpath) { + final _ret = _lib._objc_msgSend_650( + _id, + _lib._sel_URLForResource_withExtension_subdirectory_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSURL URLForResource_withExtension_subdirectory_localization_(NSString? name, + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_651( + _id, + _lib._sel_URLForResource_withExtension_subdirectory_localization_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForResourcesWithExtension_subdirectory_( + NSString? ext, NSString? subpath) { + final _ret = _lib._objc_msgSend_652( + _id, + _lib._sel_URLsForResourcesWithExtension_subdirectory_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray URLsForResourcesWithExtension_subdirectory_localization_( + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_653( + _id, + _lib._sel_URLsForResourcesWithExtension_subdirectory_localization_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSString pathForResource_ofType_inDirectory_( + SentryCocoa _lib, NSString? name, NSString? ext, NSString? bundlePath) { + final _ret = _lib._objc_msgSend_654( + _lib._class_NSBundle1, + _lib._sel_pathForResource_ofType_inDirectory_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + bundlePath?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSArray pathsForResourcesOfType_inDirectory_( + SentryCocoa _lib, NSString? ext, NSString? bundlePath) { + final _ret = _lib._objc_msgSend_652( + _lib._class_NSBundle1, + _lib._sel_pathsForResourcesOfType_inDirectory_1, + ext?._id ?? ffi.nullptr, + bundlePath?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString pathForResource_ofType_(NSString? name, NSString? ext) { + final _ret = _lib._objc_msgSend_339(_id, _lib._sel_pathForResource_ofType_1, + name?._id ?? ffi.nullptr, ext?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString pathForResource_ofType_inDirectory_forLocalization_(NSString? name, + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_655( + _id, + _lib._sel_pathForResource_ofType_inDirectory_forLocalization_1, + name?._id ?? ffi.nullptr, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray pathsForResourcesOfType_inDirectory_forLocalization_( + NSString? ext, NSString? subpath, NSString? localizationName) { + final _ret = _lib._objc_msgSend_653( + _id, + _lib._sel_pathsForResourcesOfType_inDirectory_forLocalization_1, + ext?._id ?? ffi.nullptr, + subpath?._id ?? ffi.nullptr, + localizationName?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString localizedStringForKey_value_table_( + NSString? key, NSString? value, NSString? tableName) { + final _ret = _lib._objc_msgSend_654( + _id, + _lib._sel_localizedStringForKey_value_table_1, + key?._id ?? ffi.nullptr, + value?._id ?? ffi.nullptr, + tableName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString localizedAttributedStringForKey_value_table_( + NSString? key, NSString? value, NSString? tableName) { + final _ret = _lib._objc_msgSend_676( + _id, + _lib._sel_localizedAttributedStringForKey_value_table_1, + key?._id ?? ffi.nullptr, + value?._id ?? ffi.nullptr, + tableName?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSString? get bundleIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_bundleIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get infoDictionary { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_infoDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get localizedInfoDictionary { + final _ret = + _lib._objc_msgSend_170(_id, _lib._sel_localizedInfoDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject objectForInfoDictionaryKey_(NSString? key) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_objectForInfoDictionaryKey_1, key?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject classNamed_(NSString? className) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_classNamed_1, className?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject get principalClass { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_principalClass1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSArray? get preferredLocalizations { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_preferredLocalizations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get localizations { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_localizations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get developmentLocalization { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_developmentLocalization1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSArray preferredLocalizationsFromArray_( + SentryCocoa _lib, NSArray? localizationsArray) { + final _ret = _lib._objc_msgSend_63( + _lib._class_NSBundle1, + _lib._sel_preferredLocalizationsFromArray_1, + localizationsArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSArray preferredLocalizationsFromArray_forPreferences_( + SentryCocoa _lib, + NSArray? localizationsArray, + NSArray? preferencesArray) { + final _ret = _lib._objc_msgSend_677( + _lib._class_NSBundle1, + _lib._sel_preferredLocalizationsFromArray_forPreferences_1, + localizationsArray?._id ?? ffi.nullptr, + preferencesArray?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get executableArchitectures { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_executableArchitectures1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void setPreservationPriority_forTags_(double priority, NSSet? tags) { + _lib._objc_msgSend_678(_id, _lib._sel_setPreservationPriority_forTags_1, + priority, tags?._id ?? ffi.nullptr); + } + + double preservationPriorityForTag_(NSString? tag) { + return _lib._objc_msgSend_284( + _id, _lib._sel_preservationPriorityForTag_1, tag?._id ?? ffi.nullptr); + } + + @override + NSBundle init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSBundle._(_ret, _lib, retain: true, release: true); + } + + static NSBundle new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_new1); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static NSBundle allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSBundle1, _lib._sel_allocWithZone_1, zone); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static NSBundle alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSBundle1, _lib._sel_alloc1); + return NSBundle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSBundle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSBundle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSBundle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSBundle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSBundle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSBundle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSBundle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSBundle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSBundle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSAttributedString extends NSObject { + NSAttributedString._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAttributedString] that points to the same underlying object as [other]. + static NSAttributedString castFrom(T other) { + return NSAttributedString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAttributedString] that wraps the given raw object pointer. + static NSAttributedString castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAttributedString._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAttributedString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAttributedString1); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesAtIndex_effectiveRange_( + int location, ffi.Pointer<_NSRange> range) { + final _ret = _lib._objc_msgSend_656( + _id, _lib._sel_attributesAtIndex_effectiveRange_1, location, range); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + NSObject attribute_atIndex_effectiveRange_( + NSString attrName, int location, ffi.Pointer<_NSRange> range) { + final _ret = _lib._objc_msgSend_657( + _id, + _lib._sel_attribute_atIndex_effectiveRange_1, + attrName._id, + location, + range); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedSubstringFromRange_(_NSRange range) { + final _ret = _lib._objc_msgSend_658( + _id, _lib._sel_attributedSubstringFromRange_1, range); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary attributesAtIndex_longestEffectiveRange_inRange_( + int location, ffi.Pointer<_NSRange> range, _NSRange rangeLimit) { + final _ret = _lib._objc_msgSend_659( + _id, + _lib._sel_attributesAtIndex_longestEffectiveRange_inRange_1, + location, + range, + rangeLimit); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSObject attribute_atIndex_longestEffectiveRange_inRange_(NSString attrName, + int location, ffi.Pointer<_NSRange> range, _NSRange rangeLimit) { + final _ret = _lib._objc_msgSend_660( + _id, + _lib._sel_attribute_atIndex_longestEffectiveRange_inRange_1, + attrName._id, + location, + range, + rangeLimit); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToAttributedString_(NSAttributedString? other) { + return _lib._objc_msgSend_661( + _id, _lib._sel_isEqualToAttributedString_1, other?._id ?? ffi.nullptr); + } + + NSAttributedString initWithString_(NSString? str) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, str?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithString_attributes_( + NSString? str, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_371( + _id, + _lib._sel_initWithString_attributes_1, + str?._id ?? ffi.nullptr, + attrs?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithAttributedString_(NSAttributedString? attrStr) { + final _ret = _lib._objc_msgSend_662( + _id, _lib._sel_initWithAttributedString_1, attrStr?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + void enumerateAttributesInRange_options_usingBlock_(_NSRange enumerationRange, + int opts, ObjCBlock_ffiVoid_NSDictionary_NSRange_bool block) { + _lib._objc_msgSend_663( + _id, + _lib._sel_enumerateAttributesInRange_options_usingBlock_1, + enumerationRange, + opts, + block._id); + } + + void enumerateAttribute_inRange_options_usingBlock_( + NSString attrName, + _NSRange enumerationRange, + int opts, + ObjCBlock_ffiVoid_ObjCObject_NSRange_bool block) { + _lib._objc_msgSend_664( + _id, + _lib._sel_enumerateAttribute_inRange_options_usingBlock_1, + attrName._id, + enumerationRange, + opts, + block._id); + } + + NSAttributedString initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( + NSURL? markdownFile, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_669( + _id, + _lib._sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1, + markdownFile?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithMarkdown_options_baseURL_error_( + NSData? markdown, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_670( + _id, + _lib._sel_initWithMarkdown_options_baseURL_error_1, + markdown?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithMarkdownString_options_baseURL_error_( + NSString? markdownString, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_671( + _id, + _lib._sel_initWithMarkdownString_options_baseURL_error_1, + markdownString?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithFormat_options_locale_( + NSAttributedString? format, int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_672( + _id, + _lib._sel_initWithFormat_options_locale_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString initWithFormat_options_locale_arguments_( + NSAttributedString? format, + int options, + NSLocale? locale, + ffi.Pointer<__va_list_tag> arguments) { + final _ret = _lib._objc_msgSend_673( + _id, + _lib._sel_initWithFormat_options_locale_arguments_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr, + arguments); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString localizedAttributedStringWithFormat_( + SentryCocoa _lib, NSAttributedString? format) { + final _ret = _lib._objc_msgSend_662( + _lib._class_NSAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_1, + format?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString localizedAttributedStringWithFormat_options_( + SentryCocoa _lib, NSAttributedString? format, int options) { + final _ret = _lib._objc_msgSend_674( + _lib._class_NSAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_options_1, + format?._id ?? ffi.nullptr, + options); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedStringByInflectingString() { + final _ret = _lib._objc_msgSend_675( + _id, _lib._sel_attributedStringByInflectingString1); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSAttributedString init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSAttributedString new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_new1); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static NSAttributedString allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSAttributedString1, _lib._sel_allocWithZone_1, zone); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static NSAttributedString alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSAttributedString1, _lib._sel_alloc1); + return NSAttributedString._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSAttributedString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAttributedString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAttributedString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSAttributedString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSAttributedString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedString1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSAttributedStringEnumerationOptions { + static const int NSAttributedStringEnumerationReverse = 2; + static const int + NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1048576; +} + +void _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_registerClosure(Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, _NSRange, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSDictionary_NSRange_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSDictionary_NSRange_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSDictionary_NSRange_bool_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, _NSRange arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +void _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, _NSRange, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_ObjCObject_NSRange_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_ObjCObject_NSRange_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_ObjCObject_NSRange_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_ObjCObject_NSRange_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, _NSRange arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_ObjCObject_NSRange_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, _NSRange arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + _NSRange arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSAttributedStringMarkdownParsingOptions extends NSObject { + NSAttributedStringMarkdownParsingOptions._( + ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSAttributedStringMarkdownParsingOptions] that points to the same underlying object as [other]. + static NSAttributedStringMarkdownParsingOptions + castFrom(T other) { + return NSAttributedStringMarkdownParsingOptions._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSAttributedStringMarkdownParsingOptions] that wraps the given raw object pointer. + static NSAttributedStringMarkdownParsingOptions castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSAttributedStringMarkdownParsingOptions._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSAttributedStringMarkdownParsingOptions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSAttributedStringMarkdownParsingOptions1); + } + + @override + NSAttributedStringMarkdownParsingOptions init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: true, release: true); + } + + bool get allowsExtendedAttributes { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExtendedAttributes1); + } + + set allowsExtendedAttributes(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsExtendedAttributes_1, value); + } + + int get interpretedSyntax { + return _lib._objc_msgSend_665(_id, _lib._sel_interpretedSyntax1); + } + + set interpretedSyntax(int value) { + return _lib._objc_msgSend_666(_id, _lib._sel_setInterpretedSyntax_1, value); + } + + int get failurePolicy { + return _lib._objc_msgSend_667(_id, _lib._sel_failurePolicy1); + } + + set failurePolicy(int value) { + return _lib._objc_msgSend_668(_id, _lib._sel_setFailurePolicy_1, value); + } + + NSString? get languageCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_languageCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set languageCode(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setLanguageCode_1, value?._id ?? ffi.nullptr); + } + + bool get appliesSourcePositionAttributes { + return _lib._objc_msgSend_12( + _id, _lib._sel_appliesSourcePositionAttributes1); + } + + set appliesSourcePositionAttributes(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAppliesSourcePositionAttributes_1, value); + } + + static NSAttributedStringMarkdownParsingOptions new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, _lib._sel_new1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static NSAttributedStringMarkdownParsingOptions allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_allocWithZone_1, + zone); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static NSAttributedStringMarkdownParsingOptions alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_alloc1); + return NSAttributedStringMarkdownParsingOptions._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSAttributedStringMarkdownParsingOptions1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSAttributedStringMarkdownInterpretedSyntax { + static const int NSAttributedStringMarkdownInterpretedSyntaxFull = 0; + static const int NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1; + static const int + NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = + 2; +} + +abstract class NSAttributedStringMarkdownParsingFailurePolicy { + static const int NSAttributedStringMarkdownParsingFailureReturnError = 0; + static const int + NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = + 1; +} + +abstract class NSAttributedStringFormattingOptions { + static const int + NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1; + static const int NSAttributedStringFormattingApplyReplacementIndexAttribute = + 2; +} + +class NSMutableAttributedString extends NSAttributedString { + NSMutableAttributedString._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableAttributedString] that points to the same underlying object as [other]. + static NSMutableAttributedString castFrom(T other) { + return NSMutableAttributedString._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableAttributedString] that wraps the given raw object pointer. + static NSMutableAttributedString castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableAttributedString._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableAttributedString]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableAttributedString1); + } + + void replaceCharactersInRange_withString_(_NSRange range, NSString? str) { + _lib._objc_msgSend_638(_id, _lib._sel_replaceCharactersInRange_withString_1, + range, str?._id ?? ffi.nullptr); + } + + void setAttributes_range_(NSDictionary? attrs, _NSRange range) { + _lib._objc_msgSend_679( + _id, _lib._sel_setAttributes_range_1, attrs?._id ?? ffi.nullptr, range); + } + + NSMutableString? get mutableString { + final _ret = _lib._objc_msgSend_680(_id, _lib._sel_mutableString1); + return _ret.address == 0 + ? null + : NSMutableString._(_ret, _lib, retain: true, release: true); + } + + void addAttribute_value_range_( + NSString name, NSObject value, _NSRange range) { + _lib._objc_msgSend_681( + _id, _lib._sel_addAttribute_value_range_1, name._id, value._id, range); + } + + void addAttributes_range_(NSDictionary? attrs, _NSRange range) { + _lib._objc_msgSend_679( + _id, _lib._sel_addAttributes_range_1, attrs?._id ?? ffi.nullptr, range); + } + + void removeAttribute_range_(NSString name, _NSRange range) { + _lib._objc_msgSend_682( + _id, _lib._sel_removeAttribute_range_1, name._id, range); + } + + void replaceCharactersInRange_withAttributedString_( + _NSRange range, NSAttributedString? attrString) { + _lib._objc_msgSend_683( + _id, + _lib._sel_replaceCharactersInRange_withAttributedString_1, + range, + attrString?._id ?? ffi.nullptr); + } + + void insertAttributedString_atIndex_( + NSAttributedString? attrString, int loc) { + _lib._objc_msgSend_684(_id, _lib._sel_insertAttributedString_atIndex_1, + attrString?._id ?? ffi.nullptr, loc); + } + + void appendAttributedString_(NSAttributedString? attrString) { + _lib._objc_msgSend_685(_id, _lib._sel_appendAttributedString_1, + attrString?._id ?? ffi.nullptr); + } + + void deleteCharactersInRange_(_NSRange range) { + _lib._objc_msgSend_445(_id, _lib._sel_deleteCharactersInRange_1, range); + } + + void setAttributedString_(NSAttributedString? attrString) { + _lib._objc_msgSend_685( + _id, _lib._sel_setAttributedString_1, attrString?._id ?? ffi.nullptr); + } + + void beginEditing() { + _lib._objc_msgSend_1(_id, _lib._sel_beginEditing1); + } + + void endEditing() { + _lib._objc_msgSend_1(_id, _lib._sel_endEditing1); + } + + void appendLocalizedFormat_(NSAttributedString? format) { + _lib._objc_msgSend_685( + _id, _lib._sel_appendLocalizedFormat_1, format?._id ?? ffi.nullptr); + } + + @override + NSMutableAttributedString initWithString_(NSString? str) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, str?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString initWithString_attributes_( + NSString? str, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_371( + _id, + _lib._sel_initWithString_attributes_1, + str?._id ?? ffi.nullptr, + attrs?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString initWithAttributedString_( + NSAttributedString? attrStr) { + final _ret = _lib._objc_msgSend_662( + _id, _lib._sel_initWithAttributedString_1, attrStr?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString + initWithContentsOfMarkdownFileAtURL_options_baseURL_error_( + NSURL? markdownFile, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_669( + _id, + _lib._sel_initWithContentsOfMarkdownFileAtURL_options_baseURL_error_1, + markdownFile?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString initWithMarkdown_options_baseURL_error_( + NSData? markdown, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_670( + _id, + _lib._sel_initWithMarkdown_options_baseURL_error_1, + markdown?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString initWithMarkdownString_options_baseURL_error_( + NSString? markdownString, + NSAttributedStringMarkdownParsingOptions? options, + NSURL? baseURL, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_671( + _id, + _lib._sel_initWithMarkdownString_options_baseURL_error_1, + markdownString?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + baseURL?._id ?? ffi.nullptr, + error); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString initWithFormat_options_locale_( + NSAttributedString? format, int options, NSLocale? locale) { + final _ret = _lib._objc_msgSend_672( + _id, + _lib._sel_initWithFormat_options_locale_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString initWithFormat_options_locale_arguments_( + NSAttributedString? format, + int options, + NSLocale? locale, + ffi.Pointer<__va_list_tag> arguments) { + final _ret = _lib._objc_msgSend_673( + _id, + _lib._sel_initWithFormat_options_locale_arguments_1, + format?._id ?? ffi.nullptr, + options, + locale?._id ?? ffi.nullptr, + arguments); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString localizedAttributedStringWithFormat_( + SentryCocoa _lib, NSAttributedString? format) { + final _ret = _lib._objc_msgSend_662( + _lib._class_NSMutableAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_1, + format?._id ?? ffi.nullptr); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString localizedAttributedStringWithFormat_options_( + SentryCocoa _lib, NSAttributedString? format, int options) { + final _ret = _lib._objc_msgSend_674( + _lib._class_NSMutableAttributedString1, + _lib._sel_localizedAttributedStringWithFormat_options_1, + format?._id ?? ffi.nullptr, + options); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableAttributedString init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableAttributedString._(_ret, _lib, retain: true, release: true); + } + + static NSMutableAttributedString new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableAttributedString1, _lib._sel_new1); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static NSMutableAttributedString allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3(_lib._class_NSMutableAttributedString1, + _lib._sel_allocWithZone_1, zone); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static NSMutableAttributedString alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableAttributedString1, _lib._sel_alloc1); + return NSMutableAttributedString._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableAttributedString1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableAttributedString1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableAttributedString1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableAttributedString1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableAttributedString1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableAttributedString1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMutableAttributedString1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSMutableAttributedString1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDateFormatter extends NSFormatter { + NSDateFormatter._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDateFormatter] that points to the same underlying object as [other]. + static NSDateFormatter castFrom(T other) { + return NSDateFormatter._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDateFormatter] that wraps the given raw object pointer. + static NSDateFormatter castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDateFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDateFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDateFormatter1); + } + + int get formattingContext { + return _lib._objc_msgSend_690(_id, _lib._sel_formattingContext1); + } + + set formattingContext(int value) { + return _lib._objc_msgSend_691(_id, _lib._sel_setFormattingContext_1, value); + } + + bool getObjectValue_forString_range_error_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer<_NSRange> rangep, + ffi.Pointer> error) { + return _lib._objc_msgSend_692( + _id, + _lib._sel_getObjectValue_forString_range_error_1, + obj, + string?._id ?? ffi.nullptr, + rangep, + error); + } + + NSString stringFromDate_(NSDate? date) { + final _ret = _lib._objc_msgSend_167( + _id, _lib._sel_stringFromDate_1, date?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate dateFromString_(NSString? string) { + final _ret = _lib._objc_msgSend_528( + _id, _lib._sel_dateFromString_1, string?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringFromDate_dateStyle_timeStyle_( + SentryCocoa _lib, NSDate? date, int dstyle, int tstyle) { + final _ret = _lib._objc_msgSend_693( + _lib._class_NSDateFormatter1, + _lib._sel_localizedStringFromDate_dateStyle_timeStyle_1, + date?._id ?? ffi.nullptr, + dstyle, + tstyle); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString dateFormatFromTemplate_options_locale_( + SentryCocoa _lib, NSString? tmplate, int opts, NSLocale? locale) { + final _ret = _lib._objc_msgSend_694( + _lib._class_NSDateFormatter1, + _lib._sel_dateFormatFromTemplate_options_locale_1, + tmplate?._id ?? ffi.nullptr, + opts, + locale?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int getDefaultFormatterBehavior(SentryCocoa _lib) { + return _lib._objc_msgSend_695( + _lib._class_NSDateFormatter1, _lib._sel_defaultFormatterBehavior1); + } + + static void setDefaultFormatterBehavior(SentryCocoa _lib, int value) { + return _lib._objc_msgSend_696(_lib._class_NSDateFormatter1, + _lib._sel_setDefaultFormatterBehavior_1, value); + } + + void setLocalizedDateFormatFromTemplate_(NSString? dateFormatTemplate) { + _lib._objc_msgSend_192(_id, _lib._sel_setLocalizedDateFormatFromTemplate_1, + dateFormatTemplate?._id ?? ffi.nullptr); + } + + NSString? get dateFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_dateFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set dateFormat(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setDateFormat_1, value?._id ?? ffi.nullptr); + } + + int get dateStyle { + return _lib._objc_msgSend_697(_id, _lib._sel_dateStyle1); + } + + set dateStyle(int value) { + return _lib._objc_msgSend_698(_id, _lib._sel_setDateStyle_1, value); + } + + int get timeStyle { + return _lib._objc_msgSend_697(_id, _lib._sel_timeStyle1); + } + + set timeStyle(int value) { + return _lib._objc_msgSend_698(_id, _lib._sel_setTimeStyle_1, value); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_182(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + return _lib._objc_msgSend_699( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + bool get generatesCalendarDates { + return _lib._objc_msgSend_12(_id, _lib._sel_generatesCalendarDates1); + } + + set generatesCalendarDates(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setGeneratesCalendarDates_1, value); + } + + int get formatterBehavior { + return _lib._objc_msgSend_695(_id, _lib._sel_formatterBehavior1); + } + + set formatterBehavior(int value) { + return _lib._objc_msgSend_696(_id, _lib._sel_setFormatterBehavior_1, value); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + return _lib._objc_msgSend_169( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + NSCalendar? get calendar { + final _ret = _lib._objc_msgSend_700(_id, _lib._sel_calendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + set calendar(NSCalendar? value) { + return _lib._objc_msgSend_706( + _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); + } + + bool get lenient { + return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); + } + + set lenient(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setLenient_1, value); + } + + NSDate? get twoDigitStartDate { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_twoDigitStartDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set twoDigitStartDate(NSDate? value) { + return _lib._objc_msgSend_525( + _id, _lib._sel_setTwoDigitStartDate_1, value?._id ?? ffi.nullptr); + } + + NSDate? get defaultDate { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_defaultDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set defaultDate(NSDate? value) { + return _lib._objc_msgSend_525( + _id, _lib._sel_setDefaultDate_1, value?._id ?? ffi.nullptr); + } + + NSArray? get eraSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_eraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set eraSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setEraSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get monthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_monthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set monthSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortMonthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_shortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortMonthSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setShortMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get weekdaySymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_weekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set weekdaySymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortWeekdaySymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_shortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortWeekdaySymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setShortWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSString? get AMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_AMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set AMSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setAMSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get PMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_PMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set PMSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPMSymbol_1, value?._id ?? ffi.nullptr); + } + + NSArray? get longEraSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_longEraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set longEraSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setLongEraSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortMonthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_veryShortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortMonthSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setVeryShortMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneMonthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_standaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneMonthSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setStandaloneMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_shortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneMonthSymbols(NSArray? value) { + return _lib._objc_msgSend_731(_id, + _lib._sel_setShortStandaloneMonthSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_veryShortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortStandaloneMonthSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, + _lib._sel_setVeryShortStandaloneMonthSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortWeekdaySymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_veryShortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortWeekdaySymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setVeryShortWeekdaySymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_standaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneWeekdaySymbols(NSArray? value) { + return _lib._objc_msgSend_731(_id, _lib._sel_setStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_shortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneWeekdaySymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, + _lib._sel_setShortStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get veryShortStandaloneWeekdaySymbols { + final _ret = _lib._objc_msgSend_79( + _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set veryShortStandaloneWeekdaySymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, + _lib._sel_setVeryShortStandaloneWeekdaySymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get quarterSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_quarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set quarterSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setQuarterSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get shortQuarterSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_shortQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortQuarterSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setShortQuarterSymbols_1, value?._id ?? ffi.nullptr); + } + + NSArray? get standaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_standaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set standaloneQuarterSymbols(NSArray? value) { + return _lib._objc_msgSend_731(_id, _lib._sel_setStandaloneQuarterSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSArray? get shortStandaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_shortStandaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set shortStandaloneQuarterSymbols(NSArray? value) { + return _lib._objc_msgSend_731( + _id, + _lib._sel_setShortStandaloneQuarterSymbols_1, + value?._id ?? ffi.nullptr); + } + + NSDate? get gregorianStartDate { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_gregorianStartDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set gregorianStartDate(NSDate? value) { + return _lib._objc_msgSend_525( + _id, _lib._sel_setGregorianStartDate_1, value?._id ?? ffi.nullptr); + } + + bool get doesRelativeDateFormatting { + return _lib._objc_msgSend_12(_id, _lib._sel_doesRelativeDateFormatting1); + } + + set doesRelativeDateFormatting(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setDoesRelativeDateFormatting_1, value); + } + + NSObject initWithDateFormat_allowNaturalLanguage_( + NSString? format, bool flag) { + final _ret = _lib._objc_msgSend_29( + _id, + _lib._sel_initWithDateFormat_allowNaturalLanguage_1, + format?._id ?? ffi.nullptr, + flag); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool allowsNaturalLanguage() { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsNaturalLanguage1); + } + + @override + NSDateFormatter init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDateFormatter._(_ret, _lib, retain: true, release: true); + } + + static NSDateFormatter new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_new1); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSDateFormatter allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSDateFormatter1, _lib._sel_allocWithZone_1, zone); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSDateFormatter alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateFormatter1, _lib._sel_alloc1); + return NSDateFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSDateFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSDateFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDateFormatter1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDateFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDateFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDateFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSDateFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSDateFormatter1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDateFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSFormatter extends NSObject { + NSFormatter._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFormatter] that points to the same underlying object as [other]. + static NSFormatter castFrom(T other) { + return NSFormatter._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFormatter] that wraps the given raw object pointer. + static NSFormatter castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFormatter1); + } + + NSString stringForObjectValue_(NSObject obj) { + final _ret = + _lib._objc_msgSend_65(_id, _lib._sel_stringForObjectValue_1, obj._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSAttributedString attributedStringForObjectValue_withDefaultAttributes_( + NSObject obj, NSDictionary? attrs) { + final _ret = _lib._objc_msgSend_686( + _id, + _lib._sel_attributedStringForObjectValue_withDefaultAttributes_1, + obj._id, + attrs?._id ?? ffi.nullptr); + return NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + NSString editingStringForObjectValue_(NSObject obj) { + final _ret = _lib._objc_msgSend_65( + _id, _lib._sel_editingStringForObjectValue_1, obj._id); + return NSString._(_ret, _lib, retain: true, release: true); + } + + bool getObjectValue_forString_errorDescription_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer> error) { + return _lib._objc_msgSend_687( + _id, + _lib._sel_getObjectValue_forString_errorDescription_1, + obj, + string?._id ?? ffi.nullptr, + error); + } + + bool isPartialStringValid_newEditingString_errorDescription_( + NSString? partialString, + ffi.Pointer> newString, + ffi.Pointer> error) { + return _lib._objc_msgSend_688( + _id, + _lib._sel_isPartialStringValid_newEditingString_errorDescription_1, + partialString?._id ?? ffi.nullptr, + newString, + error); + } + + bool + isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_( + ffi.Pointer> partialStringPtr, + ffi.Pointer<_NSRange> proposedSelRangePtr, + NSString? origString, + _NSRange origSelRange, + ffi.Pointer> error) { + return _lib._objc_msgSend_689( + _id, + _lib._sel_isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_1, + partialStringPtr, + proposedSelRangePtr, + origString?._id ?? ffi.nullptr, + origSelRange, + error); + } + + @override + NSFormatter init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSFormatter._(_ret, _lib, retain: true, release: true); + } + + static NSFormatter new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_new1); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSFormatter allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSFormatter1, _lib._sel_allocWithZone_1, zone); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSFormatter alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFormatter1, _lib._sel_alloc1); + return NSFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFormatter1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSFormatter1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSFormattingContext { + static const int NSFormattingContextUnknown = 0; + static const int NSFormattingContextDynamic = 1; + static const int NSFormattingContextStandalone = 2; + static const int NSFormattingContextListItem = 3; + static const int NSFormattingContextBeginningOfSentence = 4; + static const int NSFormattingContextMiddleOfSentence = 5; +} + +abstract class NSDateFormatterStyle { + static const int NSDateFormatterNoStyle = 0; + static const int NSDateFormatterShortStyle = 1; + static const int NSDateFormatterMediumStyle = 2; + static const int NSDateFormatterLongStyle = 3; + static const int NSDateFormatterFullStyle = 4; +} + +abstract class NSDateFormatterBehavior { + static const int NSDateFormatterBehaviorDefault = 0; + static const int NSDateFormatterBehavior10_0 = 1000; + static const int NSDateFormatterBehavior10_4 = 1040; +} + +class NSCalendar extends NSObject { + NSCalendar._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCalendar] that points to the same underlying object as [other]. + static NSCalendar castFrom(T other) { + return NSCalendar._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSCalendar] that wraps the given raw object pointer. + static NSCalendar castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCalendar._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCalendar]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSCalendar1); + } + + static NSCalendar? getCurrentCalendar(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_700( + _lib._class_NSCalendar1, _lib._sel_currentCalendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + static NSCalendar? getAutoupdatingCurrentCalendar(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_700( + _lib._class_NSCalendar1, _lib._sel_autoupdatingCurrentCalendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + static NSCalendar calendarWithIdentifier_( + SentryCocoa _lib, NSString calendarIdentifierConstant) { + final _ret = _lib._objc_msgSend_701(_lib._class_NSCalendar1, + _lib._sel_calendarWithIdentifier_1, calendarIdentifierConstant._id); + return NSCalendar._(_ret, _lib, retain: true, release: true); + } + + @override + NSCalendar init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCalendar._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithCalendarIdentifier_(NSString ident) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithCalendarIdentifier_1, ident._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString get calendarIdentifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_calendarIdentifier1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_182(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + return _lib._objc_msgSend_699( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + return _lib._objc_msgSend_169( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + int get firstWeekday { + return _lib._objc_msgSend_10(_id, _lib._sel_firstWeekday1); + } + + set firstWeekday(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setFirstWeekday_1, value); + } + + int get minimumDaysInFirstWeek { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumDaysInFirstWeek1); + } + + set minimumDaysInFirstWeek(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMinimumDaysInFirstWeek_1, value); + } + + NSArray? get eraSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_eraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get longEraSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_longEraSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get monthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_monthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortMonthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_shortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortMonthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_veryShortMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneMonthSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_standaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_shortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortStandaloneMonthSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_veryShortStandaloneMonthSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get weekdaySymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_weekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortWeekdaySymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_shortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortWeekdaySymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_veryShortWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_standaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneWeekdaySymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_shortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get veryShortStandaloneWeekdaySymbols { + final _ret = _lib._objc_msgSend_79( + _id, _lib._sel_veryShortStandaloneWeekdaySymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get quarterSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_quarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortQuarterSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_shortQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get standaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_standaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get shortStandaloneQuarterSymbols { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_shortStandaloneQuarterSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get AMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_AMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get PMSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_PMSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + void minimumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { + _lib._objc_msgSend_702(stret, _id, _lib._sel_minimumRangeOfUnit_1, unit); + } + + void maximumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { + _lib._objc_msgSend_702(stret, _id, _lib._sel_maximumRangeOfUnit_1, unit); + } + + void rangeOfUnit_inUnit_forDate_( + ffi.Pointer<_NSRange> stret, int smaller, int larger, NSDate? date) { + _lib._objc_msgSend_703(stret, _id, _lib._sel_rangeOfUnit_inUnit_forDate_1, + smaller, larger, date?._id ?? ffi.nullptr); + } + + int ordinalityOfUnit_inUnit_forDate_(int smaller, int larger, NSDate? date) { + return _lib._objc_msgSend_704( + _id, + _lib._sel_ordinalityOfUnit_inUnit_forDate_1, + smaller, + larger, + date?._id ?? ffi.nullptr); + } + + bool rangeOfUnit_startDate_interval_forDate_( + int unit, + ffi.Pointer> datep, + ffi.Pointer tip, + NSDate? date) { + return _lib._objc_msgSend_705( + _id, + _lib._sel_rangeOfUnit_startDate_interval_forDate_1, + unit, + datep, + tip, + date?._id ?? ffi.nullptr); + } + + NSDate dateFromComponents_(NSDateComponents? comps) { + final _ret = _lib._objc_msgSend_710( + _id, _lib._sel_dateFromComponents_1, comps?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents components_fromDate_(int unitFlags, NSDate? date) { + final _ret = _lib._objc_msgSend_711(_id, _lib._sel_components_fromDate_1, + unitFlags, date?._id ?? ffi.nullptr); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingComponents_toDate_options_( + NSDateComponents? comps, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_712( + _id, + _lib._sel_dateByAddingComponents_toDate_options_1, + comps?._id ?? ffi.nullptr, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents components_fromDate_toDate_options_( + int unitFlags, NSDate? startingDate, NSDate? resultDate, int opts) { + final _ret = _lib._objc_msgSend_713( + _id, + _lib._sel_components_fromDate_toDate_options_1, + unitFlags, + startingDate?._id ?? ffi.nullptr, + resultDate?._id ?? ffi.nullptr, + opts); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + void getEra_year_month_day_fromDate_( + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer monthValuePointer, + ffi.Pointer dayValuePointer, + NSDate? date) { + _lib._objc_msgSend_714( + _id, + _lib._sel_getEra_year_month_day_fromDate_1, + eraValuePointer, + yearValuePointer, + monthValuePointer, + dayValuePointer, + date?._id ?? ffi.nullptr); + } + + void getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_( + ffi.Pointer eraValuePointer, + ffi.Pointer yearValuePointer, + ffi.Pointer weekValuePointer, + ffi.Pointer weekdayValuePointer, + NSDate? date) { + _lib._objc_msgSend_714( + _id, + _lib._sel_getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate_1, + eraValuePointer, + yearValuePointer, + weekValuePointer, + weekdayValuePointer, + date?._id ?? ffi.nullptr); + } + + void getHour_minute_second_nanosecond_fromDate_( + ffi.Pointer hourValuePointer, + ffi.Pointer minuteValuePointer, + ffi.Pointer secondValuePointer, + ffi.Pointer nanosecondValuePointer, + NSDate? date) { + _lib._objc_msgSend_714( + _id, + _lib._sel_getHour_minute_second_nanosecond_fromDate_1, + hourValuePointer, + minuteValuePointer, + secondValuePointer, + nanosecondValuePointer, + date?._id ?? ffi.nullptr); + } + + int component_fromDate_(int unit, NSDate? date) { + return _lib._objc_msgSend_715( + _id, _lib._sel_component_fromDate_1, unit, date?._id ?? ffi.nullptr); + } + + NSDate dateWithEra_year_month_day_hour_minute_second_nanosecond_( + int eraValue, + int yearValue, + int monthValue, + int dayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue) { + final _ret = _lib._objc_msgSend_716( + _id, + _lib._sel_dateWithEra_year_month_day_hour_minute_second_nanosecond_1, + eraValue, + yearValue, + monthValue, + dayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate + dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_( + int eraValue, + int yearValue, + int weekValue, + int weekdayValue, + int hourValue, + int minuteValue, + int secondValue, + int nanosecondValue) { + final _ret = _lib._objc_msgSend_716( + _id, + _lib._sel_dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond_1, + eraValue, + yearValue, + weekValue, + weekdayValue, + hourValue, + minuteValue, + secondValue, + nanosecondValue); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate startOfDayForDate_(NSDate? date) { + final _ret = _lib._objc_msgSend_158( + _id, _lib._sel_startOfDayForDate_1, date?._id ?? ffi.nullptr); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDateComponents componentsInTimeZone_fromDate_( + NSTimeZone? timezone, NSDate? date) { + final _ret = _lib._objc_msgSend_717( + _id, + _lib._sel_componentsInTimeZone_fromDate_1, + timezone?._id ?? ffi.nullptr, + date?._id ?? ffi.nullptr); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + int compareDate_toDate_toUnitGranularity_( + NSDate? date1, NSDate? date2, int unit) { + return _lib._objc_msgSend_718( + _id, + _lib._sel_compareDate_toDate_toUnitGranularity_1, + date1?._id ?? ffi.nullptr, + date2?._id ?? ffi.nullptr, + unit); + } + + bool isDate_equalToDate_toUnitGranularity_( + NSDate? date1, NSDate? date2, int unit) { + return _lib._objc_msgSend_719( + _id, + _lib._sel_isDate_equalToDate_toUnitGranularity_1, + date1?._id ?? ffi.nullptr, + date2?._id ?? ffi.nullptr, + unit); + } + + bool isDate_inSameDayAsDate_(NSDate? date1, NSDate? date2) { + return _lib._objc_msgSend_720(_id, _lib._sel_isDate_inSameDayAsDate_1, + date1?._id ?? ffi.nullptr, date2?._id ?? ffi.nullptr); + } + + bool isDateInToday_(NSDate? date) { + return _lib._objc_msgSend_160( + _id, _lib._sel_isDateInToday_1, date?._id ?? ffi.nullptr); + } + + bool isDateInYesterday_(NSDate? date) { + return _lib._objc_msgSend_160( + _id, _lib._sel_isDateInYesterday_1, date?._id ?? ffi.nullptr); + } + + bool isDateInTomorrow_(NSDate? date) { + return _lib._objc_msgSend_160( + _id, _lib._sel_isDateInTomorrow_1, date?._id ?? ffi.nullptr); + } + + bool isDateInWeekend_(NSDate? date) { + return _lib._objc_msgSend_160( + _id, _lib._sel_isDateInWeekend_1, date?._id ?? ffi.nullptr); + } + + bool rangeOfWeekendStartDate_interval_containingDate_( + ffi.Pointer> datep, + ffi.Pointer tip, + NSDate? date) { + return _lib._objc_msgSend_721( + _id, + _lib._sel_rangeOfWeekendStartDate_interval_containingDate_1, + datep, + tip, + date?._id ?? ffi.nullptr); + } + + bool nextWeekendStartDate_interval_options_afterDate_( + ffi.Pointer> datep, + ffi.Pointer tip, + int options, + NSDate? date) { + return _lib._objc_msgSend_722( + _id, + _lib._sel_nextWeekendStartDate_interval_options_afterDate_1, + datep, + tip, + options, + date?._id ?? ffi.nullptr); + } + + NSDateComponents components_fromDateComponents_toDateComponents_options_( + int unitFlags, + NSDateComponents? startingDateComp, + NSDateComponents? resultDateComp, + int options) { + final _ret = _lib._objc_msgSend_723( + _id, + _lib._sel_components_fromDateComponents_toDateComponents_options_1, + unitFlags, + startingDateComp?._id ?? ffi.nullptr, + resultDateComp?._id ?? ffi.nullptr, + options); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + NSDate dateByAddingUnit_value_toDate_options_( + int unit, int value, NSDate? date, int options) { + final _ret = _lib._objc_msgSend_724( + _id, + _lib._sel_dateByAddingUnit_value_toDate_options_1, + unit, + value, + date?._id ?? ffi.nullptr, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + void enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_( + NSDate? start, + NSDateComponents? comps, + int opts, + ObjCBlock_ffiVoid_NSDate_bool_bool block) { + _lib._objc_msgSend_725( + _id, + _lib._sel_enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock_1, + start?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr, + opts, + block._id); + } + + NSDate nextDateAfterDate_matchingComponents_options_( + NSDate? date, NSDateComponents? comps, int options) { + final _ret = _lib._objc_msgSend_726( + _id, + _lib._sel_nextDateAfterDate_matchingComponents_options_1, + date?._id ?? ffi.nullptr, + comps?._id ?? ffi.nullptr, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate nextDateAfterDate_matchingUnit_value_options_( + NSDate? date, int unit, int value, int options) { + final _ret = _lib._objc_msgSend_727( + _id, + _lib._sel_nextDateAfterDate_matchingUnit_value_options_1, + date?._id ?? ffi.nullptr, + unit, + value, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate nextDateAfterDate_matchingHour_minute_second_options_(NSDate? date, + int hourValue, int minuteValue, int secondValue, int options) { + final _ret = _lib._objc_msgSend_728( + _id, + _lib._sel_nextDateAfterDate_matchingHour_minute_second_options_1, + date?._id ?? ffi.nullptr, + hourValue, + minuteValue, + secondValue, + options); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate dateBySettingUnit_value_ofDate_options_( + int unit, int v, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_724( + _id, + _lib._sel_dateBySettingUnit_value_ofDate_options_1, + unit, + v, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + NSDate dateBySettingHour_minute_second_ofDate_options_( + int h, int m, int s, NSDate? date, int opts) { + final _ret = _lib._objc_msgSend_729( + _id, + _lib._sel_dateBySettingHour_minute_second_ofDate_options_1, + h, + m, + s, + date?._id ?? ffi.nullptr, + opts); + return NSDate._(_ret, _lib, retain: true, release: true); + } + + bool date_matchesComponents_(NSDate? date, NSDateComponents? components) { + return _lib._objc_msgSend_730(_id, _lib._sel_date_matchesComponents_1, + date?._id ?? ffi.nullptr, components?._id ?? ffi.nullptr); + } + + static NSCalendar new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_new1); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static NSCalendar allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSCalendar1, _lib._sel_allocWithZone_1, zone); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static NSCalendar alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCalendar1, _lib._sel_alloc1); + return NSCalendar._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSCalendar1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSCalendar1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendar1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCalendar1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCalendar1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCalendar1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSCalendar1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSCalendar1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCalendar1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSCalendarUnit { + static const int NSCalendarUnitEra = 2; + static const int NSCalendarUnitYear = 4; + static const int NSCalendarUnitMonth = 8; + static const int NSCalendarUnitDay = 16; + static const int NSCalendarUnitHour = 32; + static const int NSCalendarUnitMinute = 64; + static const int NSCalendarUnitSecond = 128; + static const int NSCalendarUnitWeekday = 512; + static const int NSCalendarUnitWeekdayOrdinal = 1024; + static const int NSCalendarUnitQuarter = 2048; + static const int NSCalendarUnitWeekOfMonth = 4096; + static const int NSCalendarUnitWeekOfYear = 8192; + static const int NSCalendarUnitYearForWeekOfYear = 16384; + static const int NSCalendarUnitNanosecond = 32768; + static const int NSCalendarUnitCalendar = 1048576; + static const int NSCalendarUnitTimeZone = 2097152; + static const int NSEraCalendarUnit = 2; + static const int NSYearCalendarUnit = 4; + static const int NSMonthCalendarUnit = 8; + static const int NSDayCalendarUnit = 16; + static const int NSHourCalendarUnit = 32; + static const int NSMinuteCalendarUnit = 64; + static const int NSSecondCalendarUnit = 128; + static const int NSWeekCalendarUnit = 256; + static const int NSWeekdayCalendarUnit = 512; + static const int NSWeekdayOrdinalCalendarUnit = 1024; + static const int NSQuarterCalendarUnit = 2048; + static const int NSWeekOfMonthCalendarUnit = 4096; + static const int NSWeekOfYearCalendarUnit = 8192; + static const int NSYearForWeekOfYearCalendarUnit = 16384; + static const int NSCalendarCalendarUnit = 1048576; + static const int NSTimeZoneCalendarUnit = 2097152; +} + +class NSDateComponents extends NSObject { + NSDateComponents._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDateComponents] that points to the same underlying object as [other]. + static NSDateComponents castFrom(T other) { + return NSDateComponents._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDateComponents] that wraps the given raw object pointer. + static NSDateComponents castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDateComponents._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDateComponents]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDateComponents1); + } + + NSCalendar? get calendar { + final _ret = _lib._objc_msgSend_700(_id, _lib._sel_calendar1); + return _ret.address == 0 + ? null + : NSCalendar._(_ret, _lib, retain: true, release: true); + } + + set calendar(NSCalendar? value) { + return _lib._objc_msgSend_706( + _id, _lib._sel_setCalendar_1, value?._id ?? ffi.nullptr); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + set timeZone(NSTimeZone? value) { + return _lib._objc_msgSend_169( + _id, _lib._sel_setTimeZone_1, value?._id ?? ffi.nullptr); + } + + int get era { + return _lib._objc_msgSend_78(_id, _lib._sel_era1); + } + + set era(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setEra_1, value); + } + + int get year { + return _lib._objc_msgSend_78(_id, _lib._sel_year1); + } + + set year(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setYear_1, value); + } + + int get month { + return _lib._objc_msgSend_78(_id, _lib._sel_month1); + } + + set month(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setMonth_1, value); + } + + int get day { + return _lib._objc_msgSend_78(_id, _lib._sel_day1); + } + + set day(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setDay_1, value); + } + + int get hour { + return _lib._objc_msgSend_78(_id, _lib._sel_hour1); + } + + set hour(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setHour_1, value); + } + + int get minute { + return _lib._objc_msgSend_78(_id, _lib._sel_minute1); + } + + set minute(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setMinute_1, value); + } + + int get second { + return _lib._objc_msgSend_78(_id, _lib._sel_second1); + } + + set second(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setSecond_1, value); + } + + int get nanosecond { + return _lib._objc_msgSend_78(_id, _lib._sel_nanosecond1); + } + + set nanosecond(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setNanosecond_1, value); + } + + int get weekday { + return _lib._objc_msgSend_78(_id, _lib._sel_weekday1); + } + + set weekday(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setWeekday_1, value); + } + + int get weekdayOrdinal { + return _lib._objc_msgSend_78(_id, _lib._sel_weekdayOrdinal1); + } + + set weekdayOrdinal(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setWeekdayOrdinal_1, value); + } + + int get quarter { + return _lib._objc_msgSend_78(_id, _lib._sel_quarter1); + } + + set quarter(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setQuarter_1, value); + } + + int get weekOfMonth { + return _lib._objc_msgSend_78(_id, _lib._sel_weekOfMonth1); + } + + set weekOfMonth(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setWeekOfMonth_1, value); + } + + int get weekOfYear { + return _lib._objc_msgSend_78(_id, _lib._sel_weekOfYear1); + } + + set weekOfYear(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setWeekOfYear_1, value); + } + + int get yearForWeekOfYear { + return _lib._objc_msgSend_78(_id, _lib._sel_yearForWeekOfYear1); + } + + set yearForWeekOfYear(int value) { + return _lib._objc_msgSend_590(_id, _lib._sel_setYearForWeekOfYear_1, value); + } + + bool get leapMonth { + return _lib._objc_msgSend_12(_id, _lib._sel_isLeapMonth1); + } + + set leapMonth(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setLeapMonth_1, value); + } + + NSDate? get date { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_date1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + int week() { + return _lib._objc_msgSend_78(_id, _lib._sel_week1); + } + + void setWeek_(int v) { + _lib._objc_msgSend_394(_id, _lib._sel_setWeek_1, v); + } + + void setValue_forComponent_(int value, int unit) { + _lib._objc_msgSend_707(_id, _lib._sel_setValue_forComponent_1, value, unit); + } + + int valueForComponent_(int unit) { + return _lib._objc_msgSend_708(_id, _lib._sel_valueForComponent_1, unit); + } + + bool get validDate { + return _lib._objc_msgSend_12(_id, _lib._sel_isValidDate1); + } + + bool isValidDateInCalendar_(NSCalendar? calendar) { + return _lib._objc_msgSend_709( + _id, _lib._sel_isValidDateInCalendar_1, calendar?._id ?? ffi.nullptr); + } + + @override + NSDateComponents init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDateComponents._(_ret, _lib, retain: true, release: true); + } + + static NSDateComponents new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_new1); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static NSDateComponents allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSDateComponents1, _lib._sel_allocWithZone_1, zone); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static NSDateComponents alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSDateComponents1, _lib._sel_alloc1); + return NSDateComponents._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSDateComponents1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSDateComponents1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDateComponents1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDateComponents1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDateComponents1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDateComponents1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSDateComponents1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSDateComponents1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDateComponents1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSCalendarOptions { + static const int NSCalendarWrapComponents = 1; + static const int NSCalendarMatchStrictly = 2; + static const int NSCalendarSearchBackwards = 4; + static const int NSCalendarMatchPreviousTimePreservingSmallerUnits = 256; + static const int NSCalendarMatchNextTimePreservingSmallerUnits = 512; + static const int NSCalendarMatchNextTime = 1024; + static const int NSCalendarMatchFirst = 4096; + static const int NSCalendarMatchLast = 8192; +} + +void _ObjCBlock_ffiVoid_NSDate_bool_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSDate_bool_bool_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSDate_bool_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSDate_bool_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, bool, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSDate_bool_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSDate_bool_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSDate_bool_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSDate_bool_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSDate_bool_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSDate_bool_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSDate_bool_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSNumberFormatter extends NSFormatter { + NSNumberFormatter._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNumberFormatter] that points to the same underlying object as [other]. + static NSNumberFormatter castFrom(T other) { + return NSNumberFormatter._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSNumberFormatter] that wraps the given raw object pointer. + static NSNumberFormatter castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNumberFormatter._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNumberFormatter]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSNumberFormatter1); + } + + int get formattingContext { + return _lib._objc_msgSend_690(_id, _lib._sel_formattingContext1); + } + + set formattingContext(int value) { + return _lib._objc_msgSend_691(_id, _lib._sel_setFormattingContext_1, value); + } + + bool getObjectValue_forString_range_error_( + ffi.Pointer> obj, + NSString? string, + ffi.Pointer<_NSRange> rangep, + ffi.Pointer> error) { + return _lib._objc_msgSend_692( + _id, + _lib._sel_getObjectValue_forString_range_error_1, + obj, + string?._id ?? ffi.nullptr, + rangep, + error); + } + + NSString stringFromNumber_(NSNumber? number) { + final _ret = _lib._objc_msgSend_732( + _id, _lib._sel_stringFromNumber_1, number?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSNumber numberFromString_(NSString? string) { + final _ret = _lib._objc_msgSend_733( + _id, _lib._sel_numberFromString_1, string?._id ?? ffi.nullptr); + return NSNumber._(_ret, _lib, retain: true, release: true); + } + + static NSString localizedStringFromNumber_numberStyle_( + SentryCocoa _lib, NSNumber? num, int nstyle) { + final _ret = _lib._objc_msgSend_734( + _lib._class_NSNumberFormatter1, + _lib._sel_localizedStringFromNumber_numberStyle_1, + num?._id ?? ffi.nullptr, + nstyle); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static int defaultFormatterBehavior(SentryCocoa _lib) { + return _lib._objc_msgSend_735( + _lib._class_NSNumberFormatter1, _lib._sel_defaultFormatterBehavior1); + } + + static void setDefaultFormatterBehavior_(SentryCocoa _lib, int behavior) { + _lib._objc_msgSend_736(_lib._class_NSNumberFormatter1, + _lib._sel_setDefaultFormatterBehavior_1, behavior); + } + + int get numberStyle { + return _lib._objc_msgSend_737(_id, _lib._sel_numberStyle1); + } + + set numberStyle(int value) { + return _lib._objc_msgSend_738(_id, _lib._sel_setNumberStyle_1, value); + } + + NSLocale? get locale { + final _ret = _lib._objc_msgSend_182(_id, _lib._sel_locale1); + return _ret.address == 0 + ? null + : NSLocale._(_ret, _lib, retain: true, release: true); + } + + set locale(NSLocale? value) { + return _lib._objc_msgSend_699( + _id, _lib._sel_setLocale_1, value?._id ?? ffi.nullptr); + } + + bool get generatesDecimalNumbers { + return _lib._objc_msgSend_12(_id, _lib._sel_generatesDecimalNumbers1); + } + + set generatesDecimalNumbers(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setGeneratesDecimalNumbers_1, value); + } + + int get formatterBehavior { + return _lib._objc_msgSend_735(_id, _lib._sel_formatterBehavior1); + } + + set formatterBehavior(int value) { + return _lib._objc_msgSend_739(_id, _lib._sel_setFormatterBehavior_1, value); + } + + NSString? get negativeFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeFormat(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNegativeFormat_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNegativeValues { + final _ret = + _lib._objc_msgSend_170(_id, _lib._sel_textAttributesForNegativeValues1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNegativeValues(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, + _lib._sel_setTextAttributesForNegativeValues_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positiveFormat { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveFormat1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveFormat(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPositiveFormat_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForPositiveValues { + final _ret = + _lib._objc_msgSend_170(_id, _lib._sel_textAttributesForPositiveValues1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForPositiveValues(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, + _lib._sel_setTextAttributesForPositiveValues_1, + value?._id ?? ffi.nullptr); + } + + bool get allowsFloats { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsFloats1); + } + + set allowsFloats(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setAllowsFloats_1, value); + } + + NSString? get decimalSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_decimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set decimalSeparator(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setDecimalSeparator_1, value?._id ?? ffi.nullptr); + } + + bool get alwaysShowsDecimalSeparator { + return _lib._objc_msgSend_12(_id, _lib._sel_alwaysShowsDecimalSeparator1); + } + + set alwaysShowsDecimalSeparator(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAlwaysShowsDecimalSeparator_1, value); + } + + NSString? get currencyDecimalSeparator { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_currencyDecimalSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyDecimalSeparator(NSString? value) { + return _lib._objc_msgSend_509(_id, _lib._sel_setCurrencyDecimalSeparator_1, + value?._id ?? ffi.nullptr); + } + + bool get usesGroupingSeparator { + return _lib._objc_msgSend_12(_id, _lib._sel_usesGroupingSeparator1); + } + + set usesGroupingSeparator(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setUsesGroupingSeparator_1, value); + } + + NSString? get groupingSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_groupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set groupingSeparator(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setGroupingSeparator_1, value?._id ?? ffi.nullptr); + } + + NSString? get zeroSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_zeroSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set zeroSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setZeroSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForZero { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_textAttributesForZero1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForZero(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setTextAttributesForZero_1, value?._id ?? ffi.nullptr); + } + + NSString? get nilSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_nilSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set nilSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNilSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNil { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_textAttributesForNil1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNil(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setTextAttributesForNil_1, value?._id ?? ffi.nullptr); + } + + NSString? get notANumberSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_notANumberSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set notANumberSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNotANumberSymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNotANumber { + final _ret = + _lib._objc_msgSend_170(_id, _lib._sel_textAttributesForNotANumber1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNotANumber(NSDictionary? value) { + return _lib._objc_msgSend_171(_id, + _lib._sel_setTextAttributesForNotANumber_1, value?._id ?? ffi.nullptr); + } + + NSString? get positiveInfinitySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveInfinitySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveInfinitySymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPositiveInfinitySymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForPositiveInfinity { + final _ret = _lib._objc_msgSend_170( + _id, _lib._sel_textAttributesForPositiveInfinity1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForPositiveInfinity(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, + _lib._sel_setTextAttributesForPositiveInfinity_1, + value?._id ?? ffi.nullptr); + } + + NSString? get negativeInfinitySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeInfinitySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeInfinitySymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNegativeInfinitySymbol_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get textAttributesForNegativeInfinity { + final _ret = _lib._objc_msgSend_170( + _id, _lib._sel_textAttributesForNegativeInfinity1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set textAttributesForNegativeInfinity(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, + _lib._sel_setTextAttributesForNegativeInfinity_1, + value?._id ?? ffi.nullptr); + } + + NSString? get positivePrefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positivePrefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positivePrefix(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPositivePrefix_1, value?._id ?? ffi.nullptr); + } + + NSString? get positiveSuffix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_positiveSuffix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set positiveSuffix(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPositiveSuffix_1, value?._id ?? ffi.nullptr); + } + + NSString? get negativePrefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativePrefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativePrefix(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNegativePrefix_1, value?._id ?? ffi.nullptr); + } + + NSString? get negativeSuffix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_negativeSuffix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set negativeSuffix(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNegativeSuffix_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencyCode { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencyCode1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyCode(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setCurrencyCode_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencySymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencySymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setCurrencySymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get internationalCurrencySymbol { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_internationalCurrencySymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set internationalCurrencySymbol(NSString? value) { + return _lib._objc_msgSend_509(_id, + _lib._sel_setInternationalCurrencySymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get percentSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_percentSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set percentSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPercentSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get perMillSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_perMillSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set perMillSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPerMillSymbol_1, value?._id ?? ffi.nullptr); + } + + NSString? get minusSign { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_minusSign1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set minusSign(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setMinusSign_1, value?._id ?? ffi.nullptr); + } + + NSString? get plusSign { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_plusSign1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set plusSign(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPlusSign_1, value?._id ?? ffi.nullptr); + } + + NSString? get exponentSymbol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_exponentSymbol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set exponentSymbol(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setExponentSymbol_1, value?._id ?? ffi.nullptr); + } + + int get groupingSize { + return _lib._objc_msgSend_10(_id, _lib._sel_groupingSize1); + } + + set groupingSize(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setGroupingSize_1, value); + } + + int get secondaryGroupingSize { + return _lib._objc_msgSend_10(_id, _lib._sel_secondaryGroupingSize1); + } + + set secondaryGroupingSize(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setSecondaryGroupingSize_1, value); + } + + NSNumber? get multiplier { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_multiplier1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set multiplier(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setMultiplier_1, value?._id ?? ffi.nullptr); + } + + int get formatWidth { + return _lib._objc_msgSend_10(_id, _lib._sel_formatWidth1); + } + + set formatWidth(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setFormatWidth_1, value); + } + + NSString? get paddingCharacter { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_paddingCharacter1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set paddingCharacter(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPaddingCharacter_1, value?._id ?? ffi.nullptr); + } + + int get paddingPosition { + return _lib._objc_msgSend_740(_id, _lib._sel_paddingPosition1); + } + + set paddingPosition(int value) { + return _lib._objc_msgSend_741(_id, _lib._sel_setPaddingPosition_1, value); + } + + int get roundingMode { + return _lib._objc_msgSend_742(_id, _lib._sel_roundingMode1); + } + + set roundingMode(int value) { + return _lib._objc_msgSend_743(_id, _lib._sel_setRoundingMode_1, value); + } + + NSNumber? get roundingIncrement { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_roundingIncrement1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set roundingIncrement(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setRoundingIncrement_1, value?._id ?? ffi.nullptr); + } + + int get minimumIntegerDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumIntegerDigits1); + } + + set minimumIntegerDigits(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMinimumIntegerDigits_1, value); + } + + int get maximumIntegerDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumIntegerDigits1); + } + + set maximumIntegerDigits(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMaximumIntegerDigits_1, value); + } + + int get minimumFractionDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumFractionDigits1); + } + + set minimumFractionDigits(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMinimumFractionDigits_1, value); + } + + int get maximumFractionDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumFractionDigits1); + } + + set maximumFractionDigits(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMaximumFractionDigits_1, value); + } + + NSNumber? get minimum { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_minimum1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set minimum(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setMinimum_1, value?._id ?? ffi.nullptr); + } + + NSNumber? get maximum { + final _ret = _lib._objc_msgSend_198(_id, _lib._sel_maximum1); + return _ret.address == 0 + ? null + : NSNumber._(_ret, _lib, retain: true, release: true); + } + + set maximum(NSNumber? value) { + return _lib._objc_msgSend_620( + _id, _lib._sel_setMaximum_1, value?._id ?? ffi.nullptr); + } + + NSString? get currencyGroupingSeparator { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_currencyGroupingSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currencyGroupingSeparator(NSString? value) { + return _lib._objc_msgSend_509(_id, _lib._sel_setCurrencyGroupingSeparator_1, + value?._id ?? ffi.nullptr); + } + + bool get lenient { + return _lib._objc_msgSend_12(_id, _lib._sel_isLenient1); + } + + set lenient(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setLenient_1, value); + } + + bool get usesSignificantDigits { + return _lib._objc_msgSend_12(_id, _lib._sel_usesSignificantDigits1); + } + + set usesSignificantDigits(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setUsesSignificantDigits_1, value); + } + + int get minimumSignificantDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_minimumSignificantDigits1); + } + + set minimumSignificantDigits(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMinimumSignificantDigits_1, value); + } + + int get maximumSignificantDigits { + return _lib._objc_msgSend_10(_id, _lib._sel_maximumSignificantDigits1); + } + + set maximumSignificantDigits(int value) { + return _lib._objc_msgSend_483( + _id, _lib._sel_setMaximumSignificantDigits_1, value); + } + + bool get partialStringValidationEnabled { + return _lib._objc_msgSend_12( + _id, _lib._sel_isPartialStringValidationEnabled1); + } + + set partialStringValidationEnabled(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setPartialStringValidationEnabled_1, value); + } + + bool get hasThousandSeparators { + return _lib._objc_msgSend_12(_id, _lib._sel_hasThousandSeparators1); + } + + set hasThousandSeparators(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setHasThousandSeparators_1, value); + } + + NSString? get thousandSeparator { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_thousandSeparator1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set thousandSeparator(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setThousandSeparator_1, value?._id ?? ffi.nullptr); + } + + bool get localizesFormat { + return _lib._objc_msgSend_12(_id, _lib._sel_localizesFormat1); + } + + set localizesFormat(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setLocalizesFormat_1, value); + } + + NSString? get format { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_format1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set format(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setFormat_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForZero { + final _ret = + _lib._objc_msgSend_675(_id, _lib._sel_attributedStringForZero1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForZero(NSAttributedString? value) { + return _lib._objc_msgSend_744( + _id, _lib._sel_setAttributedStringForZero_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForNil { + final _ret = _lib._objc_msgSend_675(_id, _lib._sel_attributedStringForNil1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForNil(NSAttributedString? value) { + return _lib._objc_msgSend_744( + _id, _lib._sel_setAttributedStringForNil_1, value?._id ?? ffi.nullptr); + } + + NSAttributedString? get attributedStringForNotANumber { + final _ret = + _lib._objc_msgSend_675(_id, _lib._sel_attributedStringForNotANumber1); + return _ret.address == 0 + ? null + : NSAttributedString._(_ret, _lib, retain: true, release: true); + } + + set attributedStringForNotANumber(NSAttributedString? value) { + return _lib._objc_msgSend_744( + _id, + _lib._sel_setAttributedStringForNotANumber_1, + value?._id ?? ffi.nullptr); + } + + NSDecimalNumberHandler? get roundingBehavior { + final _ret = _lib._objc_msgSend_745(_id, _lib._sel_roundingBehavior1); + return _ret.address == 0 + ? null + : NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + set roundingBehavior(NSDecimalNumberHandler? value) { + return _lib._objc_msgSend_747( + _id, _lib._sel_setRoundingBehavior_1, value?._id ?? ffi.nullptr); + } + + @override + NSNumberFormatter init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSNumberFormatter._(_ret, _lib, retain: true, release: true); + } + + static NSNumberFormatter new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_new1); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSNumberFormatter allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSNumberFormatter1, _lib._sel_allocWithZone_1, zone); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static NSNumberFormatter alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNumberFormatter1, _lib._sel_alloc1); + return NSNumberFormatter._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSNumberFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSNumberFormatter1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSNumberFormatter1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNumberFormatter1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNumberFormatter1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNumberFormatter1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSNumberFormatter1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSNumberFormatter1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNumberFormatter1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSNumberFormatterStyle { + static const int NSNumberFormatterNoStyle = 0; + static const int NSNumberFormatterDecimalStyle = 1; + static const int NSNumberFormatterCurrencyStyle = 2; + static const int NSNumberFormatterPercentStyle = 3; + static const int NSNumberFormatterScientificStyle = 4; + static const int NSNumberFormatterSpellOutStyle = 5; + static const int NSNumberFormatterOrdinalStyle = 6; + static const int NSNumberFormatterCurrencyISOCodeStyle = 8; + static const int NSNumberFormatterCurrencyPluralStyle = 9; + static const int NSNumberFormatterCurrencyAccountingStyle = 10; +} + +abstract class NSNumberFormatterBehavior { + static const int NSNumberFormatterBehaviorDefault = 0; + static const int NSNumberFormatterBehavior10_0 = 1000; + static const int NSNumberFormatterBehavior10_4 = 1040; +} + +abstract class NSNumberFormatterPadPosition { + static const int NSNumberFormatterPadBeforePrefix = 0; + static const int NSNumberFormatterPadAfterPrefix = 1; + static const int NSNumberFormatterPadBeforeSuffix = 2; + static const int NSNumberFormatterPadAfterSuffix = 3; +} + +abstract class NSNumberFormatterRoundingMode { + static const int NSNumberFormatterRoundCeiling = 0; + static const int NSNumberFormatterRoundFloor = 1; + static const int NSNumberFormatterRoundDown = 2; + static const int NSNumberFormatterRoundUp = 3; + static const int NSNumberFormatterRoundHalfEven = 4; + static const int NSNumberFormatterRoundHalfDown = 5; + static const int NSNumberFormatterRoundHalfUp = 6; +} + +class NSDecimalNumberHandler extends NSObject { + NSDecimalNumberHandler._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSDecimalNumberHandler] that points to the same underlying object as [other]. + static NSDecimalNumberHandler castFrom(T other) { + return NSDecimalNumberHandler._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSDecimalNumberHandler] that wraps the given raw object pointer. + static NSDecimalNumberHandler castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSDecimalNumberHandler._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSDecimalNumberHandler]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSDecimalNumberHandler1); + } + + static NSDecimalNumberHandler? getDefaultDecimalNumberHandler( + SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_745(_lib._class_NSDecimalNumberHandler1, + _lib._sel_defaultDecimalNumberHandler1); + return _ret.address == 0 + ? null + : NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + NSDecimalNumberHandler + initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero) { + final _ret = _lib._objc_msgSend_746( + _id, + _lib._sel_initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + static NSDecimalNumberHandler + decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_( + SentryCocoa _lib, + int roundingMode, + int scale, + bool exact, + bool overflow, + bool underflow, + bool divideByZero) { + final _ret = _lib._objc_msgSend_746( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero_1, + roundingMode, + scale, + exact, + overflow, + underflow, + divideByZero); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + @override + NSDecimalNumberHandler init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSDecimalNumberHandler._(_ret, _lib, retain: true, release: true); + } + + static NSDecimalNumberHandler new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDecimalNumberHandler1, _lib._sel_new1); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static NSDecimalNumberHandler allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSDecimalNumberHandler1, _lib._sel_allocWithZone_1, zone); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static NSDecimalNumberHandler alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSDecimalNumberHandler1, _lib._sel_alloc1); + return NSDecimalNumberHandler._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSDecimalNumberHandler1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSDecimalNumberHandler1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSDecimalNumberHandler1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSDecimalNumberHandler1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSDecimalNumberHandler1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSDecimalNumberHandler1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSRoundingMode { + static const int NSRoundPlain = 0; + static const int NSRoundDown = 1; + static const int NSRoundUp = 2; + static const int NSRoundBankers = 3; +} + +class NSScanner extends NSObject { + NSScanner._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSScanner] that points to the same underlying object as [other]. + static NSScanner castFrom(T other) { + return NSScanner._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSScanner] that wraps the given raw object pointer. + static NSScanner castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSScanner._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSScanner]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSScanner1); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get scanLocation { + return _lib._objc_msgSend_10(_id, _lib._sel_scanLocation1); + } + + set scanLocation(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setScanLocation_1, value); + } + + NSCharacterSet? get charactersToBeSkipped { + final _ret = _lib._objc_msgSend_174(_id, _lib._sel_charactersToBeSkipped1); + return _ret.address == 0 + ? null + : NSCharacterSet._(_ret, _lib, retain: true, release: true); + } + + set charactersToBeSkipped(NSCharacterSet? value) { + return _lib._objc_msgSend_748( + _id, _lib._sel_setCharactersToBeSkipped_1, value?._id ?? ffi.nullptr); + } + + bool get caseSensitive { + return _lib._objc_msgSend_12(_id, _lib._sel_caseSensitive1); + } + + set caseSensitive(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setCaseSensitive_1, value); + } + + NSObject get locale { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_locale1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set locale(NSObject value) { + return _lib._objc_msgSend_387(_id, _lib._sel_setLocale_1, value._id); + } + + NSScanner initWithString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, string?._id ?? ffi.nullptr); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + bool scanInt_(ffi.Pointer result) { + return _lib._objc_msgSend_749(_id, _lib._sel_scanInt_1, result); + } + + bool scanInteger_(ffi.Pointer result) { + return _lib._objc_msgSend_750(_id, _lib._sel_scanInteger_1, result); + } + + bool scanLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_751(_id, _lib._sel_scanLongLong_1, result); + } + + bool scanUnsignedLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_752( + _id, _lib._sel_scanUnsignedLongLong_1, result); + } + + bool scanFloat_(ffi.Pointer result) { + return _lib._objc_msgSend_753(_id, _lib._sel_scanFloat_1, result); + } + + bool scanDouble_(ffi.Pointer result) { + return _lib._objc_msgSend_754(_id, _lib._sel_scanDouble_1, result); + } + + bool scanHexInt_(ffi.Pointer result) { + return _lib._objc_msgSend_755(_id, _lib._sel_scanHexInt_1, result); + } + + bool scanHexLongLong_(ffi.Pointer result) { + return _lib._objc_msgSend_752(_id, _lib._sel_scanHexLongLong_1, result); + } + + bool scanHexFloat_(ffi.Pointer result) { + return _lib._objc_msgSend_753(_id, _lib._sel_scanHexFloat_1, result); + } + + bool scanHexDouble_(ffi.Pointer result) { + return _lib._objc_msgSend_754(_id, _lib._sel_scanHexDouble_1, result); + } + + bool scanString_intoString_( + NSString? string, ffi.Pointer> result) { + return _lib._objc_msgSend_756(_id, _lib._sel_scanString_intoString_1, + string?._id ?? ffi.nullptr, result); + } + + bool scanCharactersFromSet_intoString_( + NSCharacterSet? set, ffi.Pointer> result) { + return _lib._objc_msgSend_757( + _id, + _lib._sel_scanCharactersFromSet_intoString_1, + set?._id ?? ffi.nullptr, + result); + } + + bool scanUpToString_intoString_( + NSString? string, ffi.Pointer> result) { + return _lib._objc_msgSend_756(_id, _lib._sel_scanUpToString_intoString_1, + string?._id ?? ffi.nullptr, result); + } + + bool scanUpToCharactersFromSet_intoString_( + NSCharacterSet? set, ffi.Pointer> result) { + return _lib._objc_msgSend_757( + _id, + _lib._sel_scanUpToCharactersFromSet_intoString_1, + set?._id ?? ffi.nullptr, + result); + } + + bool get atEnd { + return _lib._objc_msgSend_12(_id, _lib._sel_isAtEnd1); + } + + static NSScanner scannerWithString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSScanner1, + _lib._sel_scannerWithString_1, string?._id ?? ffi.nullptr); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + static NSObject localizedScannerWithString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSScanner1, + _lib._sel_localizedScannerWithString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool scanDecimal_(ffi.Pointer dcm) { + return _lib._objc_msgSend_758(_id, _lib._sel_scanDecimal_1, dcm); + } + + @override + NSScanner init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSScanner._(_ret, _lib, retain: true, release: true); + } + + static NSScanner new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_new1); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static NSScanner allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSScanner1, _lib._sel_allocWithZone_1, zone); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static NSScanner alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSScanner1, _lib._sel_alloc1); + return NSScanner._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSScanner1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSScanner1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScanner1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSScanner1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSScanner1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSScanner1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSScanner1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSScanner1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSScanner1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSDecimal extends ffi.Opaque {} + +class NSException extends NSObject { + NSException._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSException] that points to the same underlying object as [other]. + static NSException castFrom(T other) { + return NSException._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSException] that wraps the given raw object pointer. + static NSException castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSException._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSException]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSException1); + } + + static NSException exceptionWithName_reason_userInfo_(SentryCocoa _lib, + NSString name, NSString? reason, NSDictionary? userInfo) { + final _ret = _lib._objc_msgSend_759( + _lib._class_NSException1, + _lib._sel_exceptionWithName_reason_userInfo_1, + name._id, + reason?._id ?? ffi.nullptr, + userInfo?._id ?? ffi.nullptr); + return NSException._(_ret, _lib, retain: true, release: true); + } + + NSException initWithName_reason_userInfo_( + NSString aName, NSString? aReason, NSDictionary? aUserInfo) { + final _ret = _lib._objc_msgSend_583( + _id, + _lib._sel_initWithName_reason_userInfo_1, + aName._id, + aReason?._id ?? ffi.nullptr, + aUserInfo?._id ?? ffi.nullptr); + return NSException._(_ret, _lib, retain: true, release: true); + } + + NSString get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get reason { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_reason1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get callStackReturnAddresses { + final _ret = + _lib._objc_msgSend_79(_id, _lib._sel_callStackReturnAddresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get callStackSymbols { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_callStackSymbols1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void raise() { + _lib._objc_msgSend_1(_id, _lib._sel_raise1); + } + + static void raise_format_(SentryCocoa _lib, NSString name, NSString? format) { + _lib._objc_msgSend_515(_lib._class_NSException1, _lib._sel_raise_format_1, + name._id, format?._id ?? ffi.nullptr); + } + + static void raise_format_arguments_(SentryCocoa _lib, NSString name, + NSString? format, ffi.Pointer<__va_list_tag> argList) { + _lib._objc_msgSend_760( + _lib._class_NSException1, + _lib._sel_raise_format_arguments_1, + name._id, + format?._id ?? ffi.nullptr, + argList); + } + + @override + NSException init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSException._(_ret, _lib, retain: true, release: true); + } + + static NSException new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_new1); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static NSException allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSException1, _lib._sel_allocWithZone_1, zone); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static NSException alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_alloc1); + return NSException._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSException1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSException1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSException1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSException1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSException1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSException1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSException1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSException1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSException1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSFileHandle extends NSObject { + NSFileHandle._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileHandle] that points to the same underlying object as [other]. + static NSFileHandle castFrom(T other) { + return NSFileHandle._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileHandle] that wraps the given raw object pointer. + static NSFileHandle castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileHandle._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileHandle]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileHandle1); + } + + NSData? get availableData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_availableData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSFileHandle initWithFileDescriptor_closeOnDealloc_(int fd, bool closeopt) { + final _ret = _lib._objc_msgSend_761( + _id, _lib._sel_initWithFileDescriptor_closeOnDealloc_1, fd, closeopt); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + NSFileHandle initWithCoder_(NSCoder? coder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, coder?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + NSData readDataToEndOfFileAndReturnError_( + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_762( + _id, _lib._sel_readDataToEndOfFileAndReturnError_1, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData readDataUpToLength_error_( + int length, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_763( + _id, _lib._sel_readDataUpToLength_error_1, length, error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + bool writeData_error_( + NSData? data, ffi.Pointer> error) { + return _lib._objc_msgSend_764( + _id, _lib._sel_writeData_error_1, data?._id ?? ffi.nullptr, error); + } + + bool getOffset_error_(ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _lib._objc_msgSend_765( + _id, _lib._sel_getOffset_error_1, offsetInFile, error); + } + + bool seekToEndReturningOffset_error_( + ffi.Pointer offsetInFile, + ffi.Pointer> error) { + return _lib._objc_msgSend_765( + _id, _lib._sel_seekToEndReturningOffset_error_1, offsetInFile, error); + } + + bool seekToOffset_error_( + int offset, ffi.Pointer> error) { + return _lib._objc_msgSend_766( + _id, _lib._sel_seekToOffset_error_1, offset, error); + } + + bool truncateAtOffset_error_( + int offset, ffi.Pointer> error) { + return _lib._objc_msgSend_766( + _id, _lib._sel_truncateAtOffset_error_1, offset, error); + } + + bool synchronizeAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_225( + _id, _lib._sel_synchronizeAndReturnError_1, error); + } + + bool closeAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_225(_id, _lib._sel_closeAndReturnError_1, error); + } + + static NSFileHandle? getFileHandleWithStandardInput(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_767( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardInput1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithStandardOutput(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_767( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardOutput1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithStandardError(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_767( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithStandardError1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle? getFileHandleWithNullDevice(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_767( + _lib._class_NSFileHandle1, _lib._sel_fileHandleWithNullDevice1); + return _ret.address == 0 + ? null + : NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForReadingAtPath_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForReadingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForWritingAtPath_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForWritingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForUpdatingAtPath_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSFileHandle1, + _lib._sel_fileHandleForUpdatingAtPath_1, path?._id ?? ffi.nullptr); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForReadingFromURL_error_(SentryCocoa _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_768( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForReadingFromURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForWritingToURL_error_(SentryCocoa _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_768( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForWritingToURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle fileHandleForUpdatingURL_error_(SentryCocoa _lib, + NSURL? url, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_768( + _lib._class_NSFileHandle1, + _lib._sel_fileHandleForUpdatingURL_error_1, + url?._id ?? ffi.nullptr, + error); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + void readInBackgroundAndNotifyForModes_(NSArray? modes) { + _lib._objc_msgSend_441(_id, _lib._sel_readInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void readInBackgroundAndNotify() { + _lib._objc_msgSend_1(_id, _lib._sel_readInBackgroundAndNotify1); + } + + void readToEndOfFileInBackgroundAndNotifyForModes_(NSArray? modes) { + _lib._objc_msgSend_441( + _id, + _lib._sel_readToEndOfFileInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void readToEndOfFileInBackgroundAndNotify() { + _lib._objc_msgSend_1(_id, _lib._sel_readToEndOfFileInBackgroundAndNotify1); + } + + void acceptConnectionInBackgroundAndNotifyForModes_(NSArray? modes) { + _lib._objc_msgSend_441( + _id, + _lib._sel_acceptConnectionInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void acceptConnectionInBackgroundAndNotify() { + _lib._objc_msgSend_1(_id, _lib._sel_acceptConnectionInBackgroundAndNotify1); + } + + void waitForDataInBackgroundAndNotifyForModes_(NSArray? modes) { + _lib._objc_msgSend_441( + _id, + _lib._sel_waitForDataInBackgroundAndNotifyForModes_1, + modes?._id ?? ffi.nullptr); + } + + void waitForDataInBackgroundAndNotify() { + _lib._objc_msgSend_1(_id, _lib._sel_waitForDataInBackgroundAndNotify1); + } + + ObjCBlock_ffiVoid_NSFileHandle get readabilityHandler { + final _ret = _lib._objc_msgSend_769(_id, _lib._sel_readabilityHandler1); + return ObjCBlock_ffiVoid_NSFileHandle._(_ret, _lib); + } + + set readabilityHandler(ObjCBlock_ffiVoid_NSFileHandle value) { + return _lib._objc_msgSend_770( + _id, _lib._sel_setReadabilityHandler_1, value._id); + } + + ObjCBlock_ffiVoid_NSFileHandle get writeabilityHandler { + final _ret = _lib._objc_msgSend_769(_id, _lib._sel_writeabilityHandler1); + return ObjCBlock_ffiVoid_NSFileHandle._(_ret, _lib); + } + + set writeabilityHandler(ObjCBlock_ffiVoid_NSFileHandle value) { + return _lib._objc_msgSend_770( + _id, _lib._sel_setWriteabilityHandler_1, value._id); + } + + NSFileHandle initWithFileDescriptor_(int fd) { + final _ret = + _lib._objc_msgSend_771(_id, _lib._sel_initWithFileDescriptor_1, fd); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + int get fileDescriptor { + return _lib._objc_msgSend_219(_id, _lib._sel_fileDescriptor1); + } + + NSData readDataToEndOfFile() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_readDataToEndOfFile1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSData readDataOfLength_(int length) { + final _ret = + _lib._objc_msgSend_330(_id, _lib._sel_readDataOfLength_1, length); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void writeData_(NSData? data) { + _lib._objc_msgSend_263( + _id, _lib._sel_writeData_1, data?._id ?? ffi.nullptr); + } + + int get offsetInFile { + return _lib._objc_msgSend_154(_id, _lib._sel_offsetInFile1); + } + + int seekToEndOfFile() { + return _lib._objc_msgSend_154(_id, _lib._sel_seekToEndOfFile1); + } + + void seekToFileOffset_(int offset) { + _lib._objc_msgSend_772(_id, _lib._sel_seekToFileOffset_1, offset); + } + + void truncateFileAtOffset_(int offset) { + _lib._objc_msgSend_772(_id, _lib._sel_truncateFileAtOffset_1, offset); + } + + void synchronizeFile() { + _lib._objc_msgSend_1(_id, _lib._sel_synchronizeFile1); + } + + void closeFile() { + _lib._objc_msgSend_1(_id, _lib._sel_closeFile1); + } + + @override + NSFileHandle init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSFileHandle._(_ret, _lib, retain: true, release: true); + } + + static NSFileHandle new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_new1); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static NSFileHandle allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSFileHandle1, _lib._sel_allocWithZone_1, zone); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static NSFileHandle alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileHandle1, _lib._sel_alloc1); + return NSFileHandle._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSFileHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSFileHandle1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileHandle1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileHandle1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileHandle1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileHandle1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSFileHandle1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSFileHandle1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileHandle1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSFileHandle_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSFileHandle_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSFileHandle_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSFileHandle_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSFileHandle_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSFileHandle_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSFileHandle_closureRegistry[block + .ref.target.address] as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSFileHandle extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSFileHandle._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSFileHandle.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSFileHandle_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSFileHandle.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSFileHandle_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSFileHandle_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSHTTPCookieStorage extends NSObject { + NSHTTPCookieStorage._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + static NSHTTPCookieStorage castFrom(T other) { + return NSHTTPCookieStorage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSHTTPCookieStorage] that wraps the given raw object pointer. + static NSHTTPCookieStorage castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHTTPCookieStorage._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSHTTPCookieStorage1); + } + + static NSHTTPCookieStorage? getSharedHTTPCookieStorage(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_773( + _lib._class_NSHTTPCookieStorage1, _lib._sel_sharedHTTPCookieStorage1); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( + SentryCocoa _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_774( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_sharedCookieStorageForGroupContainerIdentifier_1, + identifier?._id ?? ffi.nullptr); + return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + NSArray? get cookies { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_cookies1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + void setCookie_(NSHTTPCookie? cookie) { + _lib._objc_msgSend_777( + _id, _lib._sel_setCookie_1, cookie?._id ?? ffi.nullptr); + } + + void deleteCookie_(NSHTTPCookie? cookie) { + _lib._objc_msgSend_777( + _id, _lib._sel_deleteCookie_1, cookie?._id ?? ffi.nullptr); + } + + void removeCookiesSinceDate_(NSDate? date) { + _lib._objc_msgSend_504( + _id, _lib._sel_removeCookiesSinceDate_1, date?._id ?? ffi.nullptr); + } + + NSArray cookiesForURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_124( + _id, _lib._sel_cookiesForURL_1, URL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void setCookies_forURL_mainDocumentURL_( + NSArray? cookies, NSURL? URL, NSURL? mainDocumentURL) { + _lib._objc_msgSend_778( + _id, + _lib._sel_setCookies_forURL_mainDocumentURL_1, + cookies?._id ?? ffi.nullptr, + URL?._id ?? ffi.nullptr, + mainDocumentURL?._id ?? ffi.nullptr); + } + + int get cookieAcceptPolicy { + return _lib._objc_msgSend_779(_id, _lib._sel_cookieAcceptPolicy1); + } + + set cookieAcceptPolicy(int value) { + return _lib._objc_msgSend_780( + _id, _lib._sel_setCookieAcceptPolicy_1, value); + } + + NSArray sortedCookiesUsingDescriptors_(NSArray? sortOrder) { + final _ret = _lib._objc_msgSend_63( + _id, + _lib._sel_sortedCookiesUsingDescriptors_1, + sortOrder?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void storeCookies_forTask_(NSArray? cookies, NSURLSessionTask? task) { + _lib._objc_msgSend_800(_id, _lib._sel_storeCookies_forTask_1, + cookies?._id ?? ffi.nullptr, task?._id ?? ffi.nullptr); + } + + void getCookiesForTask_completionHandler_( + NSURLSessionTask? task, ObjCBlock_ffiVoid_NSArray completionHandler) { + _lib._objc_msgSend_801(_id, _lib._sel_getCookiesForTask_completionHandler_1, + task?._id ?? ffi.nullptr, completionHandler._id); + } + + @override + NSHTTPCookieStorage init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookieStorage new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookieStorage1, _lib._sel_new1); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookieStorage allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSHTTPCookieStorage1, _lib._sel_allocWithZone_1, zone); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookieStorage alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookieStorage1, _lib._sel_alloc1); + return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSHTTPCookieStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSHTTPCookieStorage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookieStorage1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSHTTPCookieStorage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSHTTPCookieStorage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookieStorage1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSHTTPCookie extends NSObject { + NSHTTPCookie._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHTTPCookie] that points to the same underlying object as [other]. + static NSHTTPCookie castFrom(T other) { + return NSHTTPCookie._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSHTTPCookie] that wraps the given raw object pointer. + static NSHTTPCookie castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHTTPCookie._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHTTPCookie]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHTTPCookie1); + } + + NSHTTPCookie initWithProperties_(NSDictionary? properties) { + final _ret = _lib._objc_msgSend_149( + _id, _lib._sel_initWithProperties_1, properties?._id ?? ffi.nullptr); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookie cookieWithProperties_( + SentryCocoa _lib, NSDictionary? properties) { + final _ret = _lib._objc_msgSend_775(_lib._class_NSHTTPCookie1, + _lib._sel_cookieWithProperties_1, properties?._id ?? ffi.nullptr); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSDictionary requestHeaderFieldsWithCookies_( + SentryCocoa _lib, NSArray? cookies) { + final _ret = _lib._objc_msgSend_475( + _lib._class_NSHTTPCookie1, + _lib._sel_requestHeaderFieldsWithCookies_1, + cookies?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSArray cookiesWithResponseHeaderFields_forURL_( + SentryCocoa _lib, NSDictionary? headerFields, NSURL? URL) { + final _ret = _lib._objc_msgSend_776( + _lib._class_NSHTTPCookie1, + _lib._sel_cookiesWithResponseHeaderFields_forURL_1, + headerFields?._id ?? ffi.nullptr, + URL?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get properties { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_properties1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get version { + return _lib._objc_msgSend_10(_id, _lib._sel_version1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get value { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_value1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDate? get expiresDate { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_expiresDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + bool get sessionOnly { + return _lib._objc_msgSend_12(_id, _lib._sel_isSessionOnly1); + } + + NSString? get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get path { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_path1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get secure { + return _lib._objc_msgSend_12(_id, _lib._sel_isSecure1); + } + + bool get HTTPOnly { + return _lib._objc_msgSend_12(_id, _lib._sel_isHTTPOnly1); + } + + NSString? get comment { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_comment1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSURL? get commentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_commentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSArray? get portList { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_portList1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString get sameSitePolicy { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sameSitePolicy1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSHTTPCookie init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSHTTPCookie._(_ret, _lib, retain: true, release: true); + } + + static NSHTTPCookie new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_new1); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookie allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSHTTPCookie1, _lib._sel_allocWithZone_1, zone); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static NSHTTPCookie alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHTTPCookie1, _lib._sel_alloc1); + return NSHTTPCookie._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSHTTPCookie1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSHTTPCookie1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookie1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHTTPCookie1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHTTPCookie1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHTTPCookie1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSHTTPCookie1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSHTTPCookie1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHTTPCookie1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSHTTPCookieAcceptPolicy { + static const int NSHTTPCookieAcceptPolicyAlways = 0; + static const int NSHTTPCookieAcceptPolicyNever = 1; + static const int NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2; +} + +class NSURLSessionTask extends NSObject { + NSURLSessionTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionTask] that points to the same underlying object as [other]. + static NSURLSessionTask castFrom(T other) { + return NSURLSessionTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionTask] that wraps the given raw object pointer. + static NSURLSessionTask castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionTask1); + } + + int get taskIdentifier { + return _lib._objc_msgSend_10(_id, _lib._sel_taskIdentifier1); + } + + NSURLRequest? get originalRequest { + final _ret = _lib._objc_msgSend_795(_id, _lib._sel_originalRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get currentRequest { + final _ret = _lib._objc_msgSend_795(_id, _lib._sel_currentRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLResponse? get response { + final _ret = _lib._objc_msgSend_797(_id, _lib._sel_response1); + return _ret.address == 0 + ? null + : NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSProgress? get progress { + final _ret = _lib._objc_msgSend_609(_id, _lib._sel_progress1); + return _ret.address == 0 + ? null + : NSProgress._(_ret, _lib, retain: true, release: true); + } + + NSDate? get earliestBeginDate { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_earliestBeginDate1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + set earliestBeginDate(NSDate? value) { + return _lib._objc_msgSend_525( + _id, _lib._sel_setEarliestBeginDate_1, value?._id ?? ffi.nullptr); + } + + int get countOfBytesClientExpectsToSend { + return _lib._objc_msgSend_616( + _id, _lib._sel_countOfBytesClientExpectsToSend1); + } + + set countOfBytesClientExpectsToSend(int value) { + return _lib._objc_msgSend_617( + _id, _lib._sel_setCountOfBytesClientExpectsToSend_1, value); + } + + int get countOfBytesClientExpectsToReceive { + return _lib._objc_msgSend_616( + _id, _lib._sel_countOfBytesClientExpectsToReceive1); + } + + set countOfBytesClientExpectsToReceive(int value) { + return _lib._objc_msgSend_617( + _id, _lib._sel_setCountOfBytesClientExpectsToReceive_1, value); + } + + int get countOfBytesSent { + return _lib._objc_msgSend_616(_id, _lib._sel_countOfBytesSent1); + } + + int get countOfBytesReceived { + return _lib._objc_msgSend_616(_id, _lib._sel_countOfBytesReceived1); + } + + int get countOfBytesExpectedToSend { + return _lib._objc_msgSend_616(_id, _lib._sel_countOfBytesExpectedToSend1); + } + + int get countOfBytesExpectedToReceive { + return _lib._objc_msgSend_616( + _id, _lib._sel_countOfBytesExpectedToReceive1); + } + + NSString? get taskDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_taskDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set taskDescription(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setTaskDescription_1, value?._id ?? ffi.nullptr); + } + + void cancel() { + _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + int get state { + return _lib._objc_msgSend_798(_id, _lib._sel_state1); + } + + NSError? get error { + final _ret = _lib._objc_msgSend_298(_id, _lib._sel_error1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + void suspend() { + _lib._objc_msgSend_1(_id, _lib._sel_suspend1); + } + + void resume() { + _lib._objc_msgSend_1(_id, _lib._sel_resume1); + } + + double get priority { + return _lib._objc_msgSend_221(_id, _lib._sel_priority1); + } + + set priority(double value) { + return _lib._objc_msgSend_799(_id, _lib._sel_setPriority_1, value); + } + + bool get prefersIncrementalDelivery { + return _lib._objc_msgSend_12(_id, _lib._sel_prefersIncrementalDelivery1); + } + + set prefersIncrementalDelivery(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setPrefersIncrementalDelivery_1, value); + } + + @override + NSURLSessionTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionTask new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_new1); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionTask allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLSessionTask1, _lib._sel_allocWithZone_1, zone); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionTask alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_alloc1); + return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLRequest extends NSObject { + NSURLRequest._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLRequest] that points to the same underlying object as [other]. + static NSURLRequest castFrom(T other) { + return NSURLRequest._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLRequest] that wraps the given raw object pointer. + static NSURLRequest castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLRequest._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLRequest]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLRequest1); + } + + static NSURLRequest requestWithURL_(SentryCocoa _lib, NSURL? URL) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSURLRequest1, + _lib._sel_requestWithURL_1, URL?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool getSupportsSecureCoding(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_supportsSecureCoding1); + } + + static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( + SentryCocoa _lib, NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_781( + _lib._class_NSURLRequest1, + _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest initWithURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithURL_1, URL?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest initWithURL_cachePolicy_timeoutInterval_( + NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_781( + _id, + _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get cachePolicy { + return _lib._objc_msgSend_782(_id, _lib._sel_cachePolicy1); + } + + double get timeoutInterval { + return _lib._objc_msgSend_155(_id, _lib._sel_timeoutInterval1); + } + + NSURL? get mainDocumentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_mainDocumentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + int get networkServiceType { + return _lib._objc_msgSend_783(_id, _lib._sel_networkServiceType1); + } + + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + bool get assumesHTTP3Capable { + return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); + } + + int get attribution { + return _lib._objc_msgSend_784(_id, _lib._sel_attribution1); + } + + bool get requiresDNSSECValidation { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresDNSSECValidation1); + } + + NSString? get HTTPMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_HTTPMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get allHTTPHeaderFields { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_allHTTPHeaderFields1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString valueForHTTPHeaderField_(NSString? field) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_valueForHTTPHeaderField_1, field?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get HTTPBody { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_HTTPBody1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSInputStream? get HTTPBodyStream { + final _ret = _lib._objc_msgSend_794(_id, _lib._sel_HTTPBodyStream1); + return _ret.address == 0 + ? null + : NSInputStream._(_ret, _lib, retain: true, release: true); + } + + bool get HTTPShouldHandleCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); + } + + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + @override + NSURLRequest init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static NSURLRequest new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_new1); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSURLRequest allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLRequest1, _lib._sel_allocWithZone_1, zone); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSURLRequest alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_alloc1); + return NSURLRequest._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLRequest1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLRequest1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLRequest1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLRequest1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLRequest1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLRequest1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLRequestCachePolicy { + static const int NSURLRequestUseProtocolCachePolicy = 0; + static const int NSURLRequestReloadIgnoringLocalCacheData = 1; + static const int NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4; + static const int NSURLRequestReloadIgnoringCacheData = 1; + static const int NSURLRequestReturnCacheDataElseLoad = 2; + static const int NSURLRequestReturnCacheDataDontLoad = 3; + static const int NSURLRequestReloadRevalidatingCacheData = 5; +} + +abstract class NSURLRequestNetworkServiceType { + static const int NSURLNetworkServiceTypeDefault = 0; + static const int NSURLNetworkServiceTypeVoIP = 1; + static const int NSURLNetworkServiceTypeVideo = 2; + static const int NSURLNetworkServiceTypeBackground = 3; + static const int NSURLNetworkServiceTypeVoice = 4; + static const int NSURLNetworkServiceTypeResponsiveData = 6; + static const int NSURLNetworkServiceTypeAVStreaming = 8; + static const int NSURLNetworkServiceTypeResponsiveAV = 9; + static const int NSURLNetworkServiceTypeCallSignaling = 11; +} + +abstract class NSURLRequestAttribution { + static const int NSURLRequestAttributionDeveloper = 0; + static const int NSURLRequestAttributionUser = 1; +} + +class NSInputStream extends NSStream { + NSInputStream._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInputStream] that points to the same underlying object as [other]. + static NSInputStream castFrom(T other) { + return NSInputStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSInputStream] that wraps the given raw object pointer. + static NSInputStream castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInputStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInputStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSInputStream1); + } + + int read_maxLength_(ffi.Pointer buffer, int len) { + return _lib._objc_msgSend_786(_id, _lib._sel_read_maxLength_1, buffer, len); + } + + bool getBuffer_length_(ffi.Pointer> buffer, + ffi.Pointer len) { + return _lib._objc_msgSend_793( + _id, _lib._sel_getBuffer_length_1, buffer, len); + } + + bool get hasBytesAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_hasBytesAvailable1); + } + + NSInputStream initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_257( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + NSInputStream initWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithURL_1, url?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + NSInputStream initWithFileAtPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithFileAtPath_1, path?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithData_(SentryCocoa _lib, NSData? data) { + final _ret = _lib._objc_msgSend_257(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithData_1, data?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithFileAtPath_( + SentryCocoa _lib, NSString? path) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithFileAtPath_1, path?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream inputStreamWithURL_(SentryCocoa _lib, NSURL? url) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSInputStream1, + _lib._sel_inputStreamWithURL_1, url?._id ?? ffi.nullptr); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + SentryCocoa _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_788( + _lib._class_NSInputStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + SentryCocoa _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_791( + _lib._class_NSInputStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + SentryCocoa _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_792( + _lib._class_NSInputStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + @override + NSInputStream init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSInputStream._(_ret, _lib, retain: true, release: true); + } + + static NSInputStream new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_new1); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static NSInputStream allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSInputStream1, _lib._sel_allocWithZone_1, zone); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static NSInputStream alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_alloc1); + return NSInputStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSInputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSInputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInputStream1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInputStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInputStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInputStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSInputStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSInputStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInputStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSStream extends NSObject { + NSStream._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSStream] that points to the same underlying object as [other]. + static NSStream castFrom(T other) { + return NSStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSStream] that wraps the given raw object pointer. + static NSStream castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSStream1); + } + + void open() { + _lib._objc_msgSend_1(_id, _lib._sel_open1); + } + + void close() { + _lib._objc_msgSend_1(_id, _lib._sel_close1); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + NSObject propertyForKey_(NSString key) { + final _ret = + _lib._objc_msgSend_30(_id, _lib._sel_propertyForKey_1, key._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool setProperty_forKey_(NSObject property, NSString key) { + return _lib._objc_msgSend_240( + _id, _lib._sel_setProperty_forKey_1, property._id, key._id); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode._id); + } + + void removeFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_removeFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode._id); + } + + int get streamStatus { + return _lib._objc_msgSend_785(_id, _lib._sel_streamStatus1); + } + + NSError? get streamError { + final _ret = _lib._objc_msgSend_298(_id, _lib._sel_streamError1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + SentryCocoa _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_788( + _lib._class_NSStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + SentryCocoa _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_791( + _lib._class_NSStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + SentryCocoa _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_792( + _lib._class_NSStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + @override + NSStream init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSStream._(_ret, _lib, retain: true, release: true); + } + + static NSStream new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_new1); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static NSStream allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSStream1, _lib._sel_allocWithZone_1, zone); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static NSStream alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_alloc1); + return NSStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSStream1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSStreamStatus { + static const int NSStreamStatusNotOpen = 0; + static const int NSStreamStatusOpening = 1; + static const int NSStreamStatusOpen = 2; + static const int NSStreamStatusReading = 3; + static const int NSStreamStatusWriting = 4; + static const int NSStreamStatusAtEnd = 5; + static const int NSStreamStatusClosed = 6; + static const int NSStreamStatusError = 7; +} + +class NSOutputStream extends NSStream { + NSOutputStream._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOutputStream] that points to the same underlying object as [other]. + static NSOutputStream castFrom(T other) { + return NSOutputStream._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOutputStream] that wraps the given raw object pointer. + static NSOutputStream castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOutputStream._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOutputStream]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSOutputStream1); + } + + int write_maxLength_(ffi.Pointer buffer, int len) { + return _lib._objc_msgSend_786( + _id, _lib._sel_write_maxLength_1, buffer, len); + } + + bool get hasSpaceAvailable { + return _lib._objc_msgSend_12(_id, _lib._sel_hasSpaceAvailable1); + } + + NSOutputStream initToMemory() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initToMemory1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initToBuffer_capacity_( + ffi.Pointer buffer, int capacity) { + final _ret = _lib._objc_msgSend_787( + _id, _lib._sel_initToBuffer_capacity_1, buffer, capacity); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initWithURL_append_(NSURL? url, bool shouldAppend) { + final _ret = _lib._objc_msgSend_246(_id, _lib._sel_initWithURL_append_1, + url?._id ?? ffi.nullptr, shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + NSOutputStream initToFileAtPath_append_(NSString? path, bool shouldAppend) { + final _ret = _lib._objc_msgSend_29(_id, _lib._sel_initToFileAtPath_append_1, + path?._id ?? ffi.nullptr, shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToMemory(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOutputStream1, _lib._sel_outputStreamToMemory1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToBuffer_capacity_( + SentryCocoa _lib, ffi.Pointer buffer, int capacity) { + final _ret = _lib._objc_msgSend_787(_lib._class_NSOutputStream1, + _lib._sel_outputStreamToBuffer_capacity_1, buffer, capacity); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamToFileAtPath_append_( + SentryCocoa _lib, NSString? path, bool shouldAppend) { + final _ret = _lib._objc_msgSend_29( + _lib._class_NSOutputStream1, + _lib._sel_outputStreamToFileAtPath_append_1, + path?._id ?? ffi.nullptr, + shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream outputStreamWithURL_append_( + SentryCocoa _lib, NSURL? url, bool shouldAppend) { + final _ret = _lib._objc_msgSend_246( + _lib._class_NSOutputStream1, + _lib._sel_outputStreamWithURL_append_1, + url?._id ?? ffi.nullptr, + shouldAppend); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static void getStreamsToHostWithName_port_inputStream_outputStream_( + SentryCocoa _lib, + NSString? hostname, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_788( + _lib._class_NSOutputStream1, + _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, + hostname?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getStreamsToHost_port_inputStream_outputStream_( + SentryCocoa _lib, + NSHost? host, + int port, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_791( + _lib._class_NSOutputStream1, + _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, + host?._id ?? ffi.nullptr, + port, + inputStream, + outputStream); + } + + static void getBoundStreamsWithBufferSize_inputStream_outputStream_( + SentryCocoa _lib, + int bufferSize, + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + _lib._objc_msgSend_792( + _lib._class_NSOutputStream1, + _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, + bufferSize, + inputStream, + outputStream); + } + + @override + NSOutputStream init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOutputStream._(_ret, _lib, retain: true, release: true); + } + + static NSOutputStream new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_new1); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static NSOutputStream allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSOutputStream1, _lib._sel_allocWithZone_1, zone); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static NSOutputStream alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_alloc1); + return NSOutputStream._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSOutputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSOutputStream1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSOutputStream1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOutputStream1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOutputStream1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOutputStream1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSOutputStream1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSOutputStream1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOutputStream1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSHost extends NSObject { + NSHost._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSHost] that points to the same underlying object as [other]. + static NSHost castFrom(T other) { + return NSHost._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSHost] that wraps the given raw object pointer. + static NSHost castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSHost._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSHost]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSHost1); + } + + static NSHost currentHost(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_currentHost1); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost hostWithName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSHost1, + _lib._sel_hostWithName_1, name?._id ?? ffi.nullptr); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost hostWithAddress_(SentryCocoa _lib, NSString? address) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSHost1, + _lib._sel_hostWithAddress_1, address?._id ?? ffi.nullptr); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + bool isEqualToHost_(NSHost? aHost) { + return _lib._objc_msgSend_789( + _id, _lib._sel_isEqualToHost_1, aHost?._id ?? ffi.nullptr); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get names { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_names1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get address { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_address1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get addresses { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_addresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get localizedName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localizedName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static void setHostCacheEnabled_(SentryCocoa _lib, bool flag) { + _lib._objc_msgSend_790( + _lib._class_NSHost1, _lib._sel_setHostCacheEnabled_1, flag); + } + + static bool isHostCacheEnabled(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_isHostCacheEnabled1); + } + + static void flushHostCache(SentryCocoa _lib) { + _lib._objc_msgSend_1(_lib._class_NSHost1, _lib._sel_flushHostCache1); + } + + @override + NSHost init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSHost._(_ret, _lib, retain: true, release: true); + } + + static NSHost new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_new1); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static NSHost allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSHost1, _lib._sel_allocWithZone_1, zone); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static NSHost alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSHost1, _lib._sel_alloc1); + return NSHost._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSHost1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSHost1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSHost1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSHost1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSHost1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSHost1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSHost1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSHost1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLResponse extends NSObject { + NSURLResponse._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLResponse] that points to the same underlying object as [other]. + static NSURLResponse castFrom(T other) { + return NSURLResponse._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLResponse] that wraps the given raw object pointer. + static NSURLResponse castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLResponse._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLResponse]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLResponse1); + } + + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + NSURL? URL, NSString? MIMEType, int length, NSString? name) { + final _ret = _lib._objc_msgSend_796( + _id, + _lib._sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1, + URL?._id ?? ffi.nullptr, + MIMEType?._id ?? ffi.nullptr, + length, + name?._id ?? ffi.nullptr); + return NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get MIMEType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_MIMEType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get expectedContentLength { + return _lib._objc_msgSend_220(_id, _lib._sel_expectedContentLength1); + } + + NSString? get textEncodingName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_textEncodingName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get suggestedFilename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_suggestedFilename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLResponse init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + static NSURLResponse new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_new1); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSURLResponse allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLResponse1, _lib._sel_allocWithZone_1, zone); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSURLResponse alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_alloc1); + return NSURLResponse._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLResponse1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLResponse1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLResponse1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLResponse1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLResponse1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLResponse1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLResponse1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLSessionTaskState { + static const int NSURLSessionTaskStateRunning = 0; + static const int NSURLSessionTaskStateSuspended = 1; + static const int NSURLSessionTaskStateCanceling = 2; + static const int NSURLSessionTaskStateCompleted = 3; +} + +void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSArray_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSArray_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSArray_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSArray_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSArray_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSArray_closureRegistry[block.ref.target.address] + as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSArray extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSArray._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSArray.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSArray.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSArray_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSArray_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSIndexPath extends NSObject { + NSIndexPath._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSIndexPath] that points to the same underlying object as [other]. + static NSIndexPath castFrom(T other) { + return NSIndexPath._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSIndexPath] that wraps the given raw object pointer. + static NSIndexPath castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSIndexPath._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSIndexPath]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSIndexPath1); + } + + static NSIndexPath indexPathWithIndex_(SentryCocoa _lib, int index) { + final _ret = _lib._objc_msgSend_60( + _lib._class_NSIndexPath1, _lib._sel_indexPathWithIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + static NSIndexPath indexPathWithIndexes_length_( + SentryCocoa _lib, ffi.Pointer indexes, int length) { + final _ret = _lib._objc_msgSend_802(_lib._class_NSIndexPath1, + _lib._sel_indexPathWithIndexes_length_1, indexes, length); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath initWithIndexes_length_( + ffi.Pointer indexes, int length) { + final _ret = _lib._objc_msgSend_802( + _id, _lib._sel_initWithIndexes_length_1, indexes, length); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath initWithIndex_(int index) { + final _ret = _lib._objc_msgSend_60(_id, _lib._sel_initWithIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath indexPathByAddingIndex_(int index) { + final _ret = + _lib._objc_msgSend_803(_id, _lib._sel_indexPathByAddingIndex_1, index); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + NSIndexPath indexPathByRemovingLastIndex() { + final _ret = + _lib._objc_msgSend_804(_id, _lib._sel_indexPathByRemovingLastIndex1); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + int indexAtPosition_(int position) { + return _lib._objc_msgSend_88(_id, _lib._sel_indexAtPosition_1, position); + } + + int get length { + return _lib._objc_msgSend_10(_id, _lib._sel_length1); + } + + void getIndexes_range_( + ffi.Pointer indexes, _NSRange positionRange) { + _lib._objc_msgSend_805( + _id, _lib._sel_getIndexes_range_1, indexes, positionRange); + } + + int compare_(NSIndexPath? otherObject) { + return _lib._objc_msgSend_806( + _id, _lib._sel_compare_1, otherObject?._id ?? ffi.nullptr); + } + + void getIndexes_(ffi.Pointer indexes) { + _lib._objc_msgSend_807(_id, _lib._sel_getIndexes_1, indexes); + } + + @override + NSIndexPath init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSIndexPath._(_ret, _lib, retain: true, release: true); + } + + static NSIndexPath new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_new1); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static NSIndexPath allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSIndexPath1, _lib._sel_allocWithZone_1, zone); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static NSIndexPath alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSIndexPath1, _lib._sel_alloc1); + return NSIndexPath._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSIndexPath1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSIndexPath1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexPath1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSIndexPath1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSIndexPath1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSIndexPath1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSIndexPath1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSIndexPath1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSIndexPath1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSInflectionRule extends NSObject { + NSInflectionRule._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSInflectionRule] that points to the same underlying object as [other]. + static NSInflectionRule castFrom(T other) { + return NSInflectionRule._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSInflectionRule] that wraps the given raw object pointer. + static NSInflectionRule castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSInflectionRule._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSInflectionRule]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSInflectionRule1); + } + + @override + NSObject init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSInflectionRule? getAutomaticRule(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_808( + _lib._class_NSInflectionRule1, _lib._sel_automaticRule1); + return _ret.address == 0 + ? null + : NSInflectionRule._(_ret, _lib, retain: true, release: true); + } + + static bool canInflectLanguage_(SentryCocoa _lib, NSString? language) { + return _lib._objc_msgSend_59(_lib._class_NSInflectionRule1, + _lib._sel_canInflectLanguage_1, language?._id ?? ffi.nullptr); + } + + static bool getCanInflectPreferredLocalization(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, + _lib._sel_canInflectPreferredLocalization1); + } + + static NSInflectionRule new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_new1); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static NSInflectionRule allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSInflectionRule1, _lib._sel_allocWithZone_1, zone); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static NSInflectionRule alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSInflectionRule1, _lib._sel_alloc1); + return NSInflectionRule._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSInflectionRule1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSInflectionRule1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSInflectionRule1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSInflectionRule1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSInflectionRule1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSInflectionRule1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSInflectionRule1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSInflectionRule1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSInflectionRule1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMorphology extends NSObject { + NSMorphology._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMorphology] that points to the same underlying object as [other]. + static NSMorphology castFrom(T other) { + return NSMorphology._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSMorphology] that wraps the given raw object pointer. + static NSMorphology castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMorphology._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMorphology]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSMorphology1); + } + + int get grammaticalGender { + return _lib._objc_msgSend_809(_id, _lib._sel_grammaticalGender1); + } + + set grammaticalGender(int value) { + return _lib._objc_msgSend_810(_id, _lib._sel_setGrammaticalGender_1, value); + } + + int get partOfSpeech { + return _lib._objc_msgSend_811(_id, _lib._sel_partOfSpeech1); + } + + set partOfSpeech(int value) { + return _lib._objc_msgSend_812(_id, _lib._sel_setPartOfSpeech_1, value); + } + + int get number { + return _lib._objc_msgSend_813(_id, _lib._sel_number1); + } + + set number(int value) { + return _lib._objc_msgSend_814(_id, _lib._sel_setNumber_1, value); + } + + NSMorphologyCustomPronoun customPronounForLanguage_(NSString? language) { + final _ret = _lib._objc_msgSend_815(_id, + _lib._sel_customPronounForLanguage_1, language?._id ?? ffi.nullptr); + return NSMorphologyCustomPronoun._(_ret, _lib, retain: true, release: true); + } + + bool setCustomPronoun_forLanguage_error_(NSMorphologyCustomPronoun? features, + NSString? language, ffi.Pointer> error) { + return _lib._objc_msgSend_816( + _id, + _lib._sel_setCustomPronoun_forLanguage_error_1, + features?._id ?? ffi.nullptr, + language?._id ?? ffi.nullptr, + error); + } + + bool get unspecified { + return _lib._objc_msgSend_12(_id, _lib._sel_isUnspecified1); + } + + static NSMorphology? getUserMorphology(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_817( + _lib._class_NSMorphology1, _lib._sel_userMorphology1); + return _ret.address == 0 + ? null + : NSMorphology._(_ret, _lib, retain: true, release: true); + } + + @override + NSMorphology init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMorphology._(_ret, _lib, retain: true, release: true); + } + + static NSMorphology new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_new1); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static NSMorphology allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMorphology1, _lib._sel_allocWithZone_1, zone); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static NSMorphology alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMorphology1, _lib._sel_alloc1); + return NSMorphology._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMorphology1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMorphology1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphology1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphology1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMorphology1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMorphology1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMorphology1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSMorphology1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphology1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSGrammaticalGender { + static const int NSGrammaticalGenderNotSet = 0; + static const int NSGrammaticalGenderFeminine = 1; + static const int NSGrammaticalGenderMasculine = 2; + static const int NSGrammaticalGenderNeuter = 3; +} + +abstract class NSGrammaticalPartOfSpeech { + static const int NSGrammaticalPartOfSpeechNotSet = 0; + static const int NSGrammaticalPartOfSpeechDeterminer = 1; + static const int NSGrammaticalPartOfSpeechPronoun = 2; + static const int NSGrammaticalPartOfSpeechLetter = 3; + static const int NSGrammaticalPartOfSpeechAdverb = 4; + static const int NSGrammaticalPartOfSpeechParticle = 5; + static const int NSGrammaticalPartOfSpeechAdjective = 6; + static const int NSGrammaticalPartOfSpeechAdposition = 7; + static const int NSGrammaticalPartOfSpeechVerb = 8; + static const int NSGrammaticalPartOfSpeechNoun = 9; + static const int NSGrammaticalPartOfSpeechConjunction = 10; + static const int NSGrammaticalPartOfSpeechNumeral = 11; + static const int NSGrammaticalPartOfSpeechInterjection = 12; + static const int NSGrammaticalPartOfSpeechPreposition = 13; + static const int NSGrammaticalPartOfSpeechAbbreviation = 14; +} + +abstract class NSGrammaticalNumber { + static const int NSGrammaticalNumberNotSet = 0; + static const int NSGrammaticalNumberSingular = 1; + static const int NSGrammaticalNumberZero = 2; + static const int NSGrammaticalNumberPlural = 3; + static const int NSGrammaticalNumberPluralTwo = 4; + static const int NSGrammaticalNumberPluralFew = 5; + static const int NSGrammaticalNumberPluralMany = 6; +} + +class NSMorphologyCustomPronoun extends NSObject { + NSMorphologyCustomPronoun._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMorphologyCustomPronoun] that points to the same underlying object as [other]. + static NSMorphologyCustomPronoun castFrom(T other) { + return NSMorphologyCustomPronoun._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMorphologyCustomPronoun] that wraps the given raw object pointer. + static NSMorphologyCustomPronoun castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMorphologyCustomPronoun._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMorphologyCustomPronoun]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMorphologyCustomPronoun1); + } + + static bool isSupportedForLanguage_(SentryCocoa _lib, NSString? language) { + return _lib._objc_msgSend_59(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_isSupportedForLanguage_1, language?._id ?? ffi.nullptr); + } + + static NSArray requiredKeysForLanguage_( + SentryCocoa _lib, NSString? language) { + final _ret = _lib._objc_msgSend_123(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_requiredKeysForLanguage_1, language?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get subjectForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_subjectForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set subjectForm(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setSubjectForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get objectForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_objectForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set objectForm(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setObjectForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get possessiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_possessiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set possessiveForm(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPossessiveForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get possessiveAdjectiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_possessiveAdjectiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set possessiveAdjectiveForm(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPossessiveAdjectiveForm_1, value?._id ?? ffi.nullptr); + } + + NSString? get reflexiveForm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_reflexiveForm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set reflexiveForm(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setReflexiveForm_1, value?._id ?? ffi.nullptr); + } + + @override + NSMorphologyCustomPronoun init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMorphologyCustomPronoun._(_ret, _lib, retain: true, release: true); + } + + static NSMorphologyCustomPronoun new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_new1); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static NSMorphologyCustomPronoun allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_allocWithZone_1, zone); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static NSMorphologyCustomPronoun alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_alloc1); + return NSMorphologyCustomPronoun._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMorphologyCustomPronoun1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMorphologyCustomPronoun1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSMorphologyCustomPronoun1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperationQueue extends NSObject { + NSOperationQueue._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOperationQueue] that points to the same underlying object as [other]. + static NSOperationQueue castFrom(T other) { + return NSOperationQueue._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSOperationQueue] that wraps the given raw object pointer. + static NSOperationQueue castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOperationQueue._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSOperationQueue1); + } + + NSProgress? get progress { + final _ret = _lib._objc_msgSend_609(_id, _lib._sel_progress1); + return _ret.address == 0 + ? null + : NSProgress._(_ret, _lib, retain: true, release: true); + } + + void addOperation_(NSOperation? op) { + _lib._objc_msgSend_818( + _id, _lib._sel_addOperation_1, op?._id ?? ffi.nullptr); + } + + void addOperations_waitUntilFinished_(NSArray? ops, bool wait) { + _lib._objc_msgSend_821(_id, _lib._sel_addOperations_waitUntilFinished_1, + ops?._id ?? ffi.nullptr, wait); + } + + void addOperationWithBlock_(ObjCBlock_ffiVoid block) { + _lib._objc_msgSend_497(_id, _lib._sel_addOperationWithBlock_1, block._id); + } + + void addBarrierBlock_(ObjCBlock_ffiVoid barrier) { + _lib._objc_msgSend_497(_id, _lib._sel_addBarrierBlock_1, barrier._id); + } + + int get maxConcurrentOperationCount { + return _lib._objc_msgSend_78(_id, _lib._sel_maxConcurrentOperationCount1); + } + + set maxConcurrentOperationCount(int value) { + return _lib._objc_msgSend_590( + _id, _lib._sel_setMaxConcurrentOperationCount_1, value); + } + + bool get suspended { + return _lib._objc_msgSend_12(_id, _lib._sel_isSuspended1); + } + + set suspended(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setSuspended_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + int get qualityOfService { + return _lib._objc_msgSend_507(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + return _lib._objc_msgSend_508(_id, _lib._sel_setQualityOfService_1, value); + } + + NSObject get underlyingQueue { + final _ret = _lib._objc_msgSend_822(_id, _lib._sel_underlyingQueue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set underlyingQueue(NSObject value) { + return _lib._objc_msgSend_823( + _id, _lib._sel_setUnderlyingQueue_1, value._id); + } + + void cancelAllOperations() { + _lib._objc_msgSend_1(_id, _lib._sel_cancelAllOperations1); + } + + void waitUntilAllOperationsAreFinished() { + _lib._objc_msgSend_1(_id, _lib._sel_waitUntilAllOperationsAreFinished1); + } + + static NSOperationQueue? getCurrentQueue(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_824( + _lib._class_NSOperationQueue1, _lib._sel_currentQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + static NSOperationQueue? getMainQueue(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_824( + _lib._class_NSOperationQueue1, _lib._sel_mainQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + NSArray? get operations { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_operations1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get operationCount { + return _lib._objc_msgSend_10(_id, _lib._sel_operationCount1); + } + + @override + NSOperationQueue init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + static NSOperationQueue new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_new1); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static NSOperationQueue allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSOperationQueue1, _lib._sel_allocWithZone_1, zone); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static NSOperationQueue alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_alloc1); + return NSOperationQueue._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSOperationQueue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSOperationQueue1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSOperationQueue1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperationQueue1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOperationQueue1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOperationQueue1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSOperationQueue1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSOperationQueue1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOperationQueue1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperation extends NSObject { + NSOperation._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSOperation] that points to the same underlying object as [other]. + static NSOperation castFrom(T other) { + return NSOperation._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSOperation] that wraps the given raw object pointer. + static NSOperation castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSOperation._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSOperation]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSOperation1); + } + + void start() { + _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void main() { + _lib._objc_msgSend_1(_id, _lib._sel_main1); + } + + bool get cancelled { + return _lib._objc_msgSend_12(_id, _lib._sel_isCancelled1); + } + + void cancel() { + _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + bool get executing { + return _lib._objc_msgSend_12(_id, _lib._sel_isExecuting1); + } + + bool get finished { + return _lib._objc_msgSend_12(_id, _lib._sel_isFinished1); + } + + bool get concurrent { + return _lib._objc_msgSend_12(_id, _lib._sel_isConcurrent1); + } + + bool get asynchronous { + return _lib._objc_msgSend_12(_id, _lib._sel_isAsynchronous1); + } + + bool get ready { + return _lib._objc_msgSend_12(_id, _lib._sel_isReady1); + } + + void addDependency_(NSOperation? op) { + _lib._objc_msgSend_818( + _id, _lib._sel_addDependency_1, op?._id ?? ffi.nullptr); + } + + void removeDependency_(NSOperation? op) { + _lib._objc_msgSend_818( + _id, _lib._sel_removeDependency_1, op?._id ?? ffi.nullptr); + } + + NSArray? get dependencies { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_dependencies1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get queuePriority { + return _lib._objc_msgSend_819(_id, _lib._sel_queuePriority1); + } + + set queuePriority(int value) { + return _lib._objc_msgSend_820(_id, _lib._sel_setQueuePriority_1, value); + } + + ObjCBlock_ffiVoid get completionBlock { + final _ret = _lib._objc_msgSend_618(_id, _lib._sel_completionBlock1); + return ObjCBlock_ffiVoid._(_ret, _lib); + } + + set completionBlock(ObjCBlock_ffiVoid value) { + return _lib._objc_msgSend_619( + _id, _lib._sel_setCompletionBlock_1, value._id); + } + + void waitUntilFinished() { + _lib._objc_msgSend_1(_id, _lib._sel_waitUntilFinished1); + } + + double get threadPriority { + return _lib._objc_msgSend_155(_id, _lib._sel_threadPriority1); + } + + set threadPriority(double value) { + return _lib._objc_msgSend_506(_id, _lib._sel_setThreadPriority_1, value); + } + + int get qualityOfService { + return _lib._objc_msgSend_507(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + return _lib._objc_msgSend_508(_id, _lib._sel_setQualityOfService_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + @override + NSOperation init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSOperation._(_ret, _lib, retain: true, release: true); + } + + static NSOperation new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_new1); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static NSOperation allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSOperation1, _lib._sel_allocWithZone_1, zone); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static NSOperation alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_alloc1); + return NSOperation._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSOperation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSOperation1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperation1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSOperation1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSOperation1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSOperation1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSOperation1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSOperation1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSOperation1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSOperationQueuePriority { + static const int NSOperationQueuePriorityVeryLow = -8; + static const int NSOperationQueuePriorityLow = -4; + static const int NSOperationQueuePriorityNormal = 0; + static const int NSOperationQueuePriorityHigh = 4; + static const int NSOperationQueuePriorityVeryHigh = 8; +} + +class NSPointerArray extends NSObject { + NSPointerArray._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPointerArray] that points to the same underlying object as [other]. + static NSPointerArray castFrom(T other) { + return NSPointerArray._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSPointerArray] that wraps the given raw object pointer. + static NSPointerArray castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPointerArray._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPointerArray]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPointerArray1); + } + + NSPointerArray initWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_825(_id, _lib._sel_initWithOptions_1, options); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSPointerArray initWithPointerFunctions_(NSPointerFunctions? functions) { + final _ret = _lib._objc_msgSend_839(_id, + _lib._sel_initWithPointerFunctions_1, functions?._id ?? ffi.nullptr); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray pointerArrayWithOptions_( + SentryCocoa _lib, int options) { + final _ret = _lib._objc_msgSend_840(_lib._class_NSPointerArray1, + _lib._sel_pointerArrayWithOptions_1, options); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray pointerArrayWithPointerFunctions_( + SentryCocoa _lib, NSPointerFunctions? functions) { + final _ret = _lib._objc_msgSend_841( + _lib._class_NSPointerArray1, + _lib._sel_pointerArrayWithPointerFunctions_1, + functions?._id ?? ffi.nullptr); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSPointerFunctions? get pointerFunctions { + final _ret = _lib._objc_msgSend_842(_id, _lib._sel_pointerFunctions1); + return _ret.address == 0 + ? null + : NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer pointerAtIndex_(int index) { + return _lib._objc_msgSend_843(_id, _lib._sel_pointerAtIndex_1, index); + } + + void addPointer_(ffi.Pointer pointer) { + _lib._objc_msgSend_47(_id, _lib._sel_addPointer_1, pointer); + } + + void removePointerAtIndex_(int index) { + _lib._objc_msgSend_439(_id, _lib._sel_removePointerAtIndex_1, index); + } + + void insertPointer_atIndex_(ffi.Pointer item, int index) { + _lib._objc_msgSend_21(_id, _lib._sel_insertPointer_atIndex_1, item, index); + } + + void replacePointerAtIndex_withPointer_( + int index, ffi.Pointer item) { + _lib._objc_msgSend_844( + _id, _lib._sel_replacePointerAtIndex_withPointer_1, index, item); + } + + void compact() { + _lib._objc_msgSend_1(_id, _lib._sel_compact1); + } + + int get count { + return _lib._objc_msgSend_10(_id, _lib._sel_count1); + } + + set count(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setCount_1, value); + } + + static NSObject pointerArrayWithStrongObjects(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithStrongObjects1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject pointerArrayWithWeakObjects(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_pointerArrayWithWeakObjects1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray strongObjectsPointerArray(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_845( + _lib._class_NSPointerArray1, _lib._sel_strongObjectsPointerArray1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray weakObjectsPointerArray(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_845( + _lib._class_NSPointerArray1, _lib._sel_weakObjectsPointerArray1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + NSArray? get allObjects { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_allObjects1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + @override + NSPointerArray init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSPointerArray._(_ret, _lib, retain: true, release: true); + } + + static NSPointerArray new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_new1); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static NSPointerArray allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSPointerArray1, _lib._sel_allocWithZone_1, zone); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static NSPointerArray alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerArray1, _lib._sel_alloc1); + return NSPointerArray._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSPointerArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSPointerArray1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPointerArray1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPointerArray1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPointerArray1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPointerArray1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSPointerArray1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSPointerArray1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerArray1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSPointerFunctionsOptions { + static const int NSPointerFunctionsStrongMemory = 0; + static const int NSPointerFunctionsZeroingWeakMemory = 1; + static const int NSPointerFunctionsOpaqueMemory = 2; + static const int NSPointerFunctionsMallocMemory = 3; + static const int NSPointerFunctionsMachVirtualMemory = 4; + static const int NSPointerFunctionsWeakMemory = 5; + static const int NSPointerFunctionsObjectPersonality = 0; + static const int NSPointerFunctionsOpaquePersonality = 256; + static const int NSPointerFunctionsObjectPointerPersonality = 512; + static const int NSPointerFunctionsCStringPersonality = 768; + static const int NSPointerFunctionsStructPersonality = 1024; + static const int NSPointerFunctionsIntegerPersonality = 1280; + static const int NSPointerFunctionsCopyIn = 65536; +} + +class NSPointerFunctions extends NSObject { + NSPointerFunctions._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSPointerFunctions] that points to the same underlying object as [other]. + static NSPointerFunctions castFrom(T other) { + return NSPointerFunctions._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSPointerFunctions] that wraps the given raw object pointer. + static NSPointerFunctions castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSPointerFunctions._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSPointerFunctions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSPointerFunctions1); + } + + NSPointerFunctions initWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_825(_id, _lib._sel_initWithOptions_1, options); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + static NSPointerFunctions pointerFunctionsWithOptions_( + SentryCocoa _lib, int options) { + final _ret = _lib._objc_msgSend_826(_lib._class_NSPointerFunctions1, + _lib._sel_pointerFunctionsWithOptions_1, options); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + get hashFunction { + return _lib._objc_msgSend_827(_id, _lib._sel_hashFunction1); + } + + set hashFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value) { + return _lib._objc_msgSend_828(_id, _lib._sel_setHashFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + get isEqualFunction { + return _lib._objc_msgSend_829(_id, _lib._sel_isEqualFunction1); + } + + set isEqualFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value) { + return _lib._objc_msgSend_830(_id, _lib._sel_setIsEqualFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction)>> + get sizeFunction { + return _lib._objc_msgSend_831(_id, _lib._sel_sizeFunction1); + } + + set sizeFunction( + ffi.Pointer< + ffi + .NativeFunction)>> + value) { + return _lib._objc_msgSend_832(_id, _lib._sel_setSizeFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + get descriptionFunction { + return _lib._objc_msgSend_833(_id, _lib._sel_descriptionFunction1); + } + + set descriptionFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> + value) { + return _lib._objc_msgSend_834( + _id, _lib._sel_setDescriptionFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>)>> + get relinquishFunction { + return _lib._objc_msgSend_835(_id, _lib._sel_relinquishFunction1); + } + + set relinquishFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>)>> + value) { + return _lib._objc_msgSend_836( + _id, _lib._sel_setRelinquishFunction_1, value); + } + + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer)>>, + ffi.Bool)>> get acquireFunction { + return _lib._objc_msgSend_837(_id, _lib._sel_acquireFunction1); + } + + set acquireFunction( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer)>>, + ffi.Bool)>> + value) { + return _lib._objc_msgSend_838(_id, _lib._sel_setAcquireFunction_1, value); + } + + bool get usesStrongWriteBarrier { + return _lib._objc_msgSend_12(_id, _lib._sel_usesStrongWriteBarrier1); + } + + set usesStrongWriteBarrier(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setUsesStrongWriteBarrier_1, value); + } + + bool get usesWeakReadAndWriteBarriers { + return _lib._objc_msgSend_12(_id, _lib._sel_usesWeakReadAndWriteBarriers1); + } + + set usesWeakReadAndWriteBarriers(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setUsesWeakReadAndWriteBarriers_1, value); + } + + @override + NSPointerFunctions init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSPointerFunctions._(_ret, _lib, retain: true, release: true); + } + + static NSPointerFunctions new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_new1); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static NSPointerFunctions allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSPointerFunctions1, _lib._sel_allocWithZone_1, zone); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static NSPointerFunctions alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSPointerFunctions1, _lib._sel_alloc1); + return NSPointerFunctions._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSPointerFunctions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSPointerFunctions1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSPointerFunctions1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSPointerFunctions1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSPointerFunctions1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSPointerFunctions1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSPointerFunctions1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSPointerFunctions1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSPointerFunctions1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSProcessInfo extends NSObject { + NSProcessInfo._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProcessInfo] that points to the same underlying object as [other]. + static NSProcessInfo castFrom(T other) { + return NSProcessInfo._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSProcessInfo] that wraps the given raw object pointer. + static NSProcessInfo castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProcessInfo._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProcessInfo]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSProcessInfo1); + } + + static NSProcessInfo? getProcessInfo(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_846( + _lib._class_NSProcessInfo1, _lib._sel_processInfo1); + return _ret.address == 0 + ? null + : NSProcessInfo._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get environment { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_environment1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSArray? get arguments { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSString? get hostName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_hostName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get processName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_processName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set processName(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setProcessName_1, value?._id ?? ffi.nullptr); + } + + int get processIdentifier { + return _lib._objc_msgSend_219(_id, _lib._sel_processIdentifier1); + } + + NSString? get globallyUniqueString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_globallyUniqueString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int operatingSystem() { + return _lib._objc_msgSend_10(_id, _lib._sel_operatingSystem1); + } + + NSString operatingSystemName() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_operatingSystemName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get operatingSystemVersionString { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_operatingSystemVersionString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + void getOperatingSystemVersion(ffi.Pointer stret) { + _lib._objc_msgSend_847(stret, _id, _lib._sel_operatingSystemVersion1); + } + + int get processorCount { + return _lib._objc_msgSend_10(_id, _lib._sel_processorCount1); + } + + int get activeProcessorCount { + return _lib._objc_msgSend_10(_id, _lib._sel_activeProcessorCount1); + } + + int get physicalMemory { + return _lib._objc_msgSend_154(_id, _lib._sel_physicalMemory1); + } + + bool isOperatingSystemAtLeastVersion_(NSOperatingSystemVersion version) { + return _lib._objc_msgSend_848( + _id, _lib._sel_isOperatingSystemAtLeastVersion_1, version); + } + + double get systemUptime { + return _lib._objc_msgSend_155(_id, _lib._sel_systemUptime1); + } + + void disableSuddenTermination() { + _lib._objc_msgSend_1(_id, _lib._sel_disableSuddenTermination1); + } + + void enableSuddenTermination() { + _lib._objc_msgSend_1(_id, _lib._sel_enableSuddenTermination1); + } + + void disableAutomaticTermination_(NSString? reason) { + _lib._objc_msgSend_192(_id, _lib._sel_disableAutomaticTermination_1, + reason?._id ?? ffi.nullptr); + } + + void enableAutomaticTermination_(NSString? reason) { + _lib._objc_msgSend_192(_id, _lib._sel_enableAutomaticTermination_1, + reason?._id ?? ffi.nullptr); + } + + bool get automaticTerminationSupportEnabled { + return _lib._objc_msgSend_12( + _id, _lib._sel_automaticTerminationSupportEnabled1); + } + + set automaticTerminationSupportEnabled(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAutomaticTerminationSupportEnabled_1, value); + } + + NSObject beginActivityWithOptions_reason_(int options, NSString? reason) { + final _ret = _lib._objc_msgSend_849( + _id, + _lib._sel_beginActivityWithOptions_reason_1, + options, + reason?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + void endActivity_(NSObject? activity) { + _lib._objc_msgSend_15( + _id, _lib._sel_endActivity_1, activity?._id ?? ffi.nullptr); + } + + void performActivityWithOptions_reason_usingBlock_( + int options, NSString? reason, ObjCBlock_ffiVoid block) { + _lib._objc_msgSend_850( + _id, + _lib._sel_performActivityWithOptions_reason_usingBlock_1, + options, + reason?._id ?? ffi.nullptr, + block._id); + } + + void performExpiringActivityWithReason_usingBlock_( + NSString? reason, ObjCBlock_ffiVoid_bool block) { + _lib._objc_msgSend_851( + _id, + _lib._sel_performExpiringActivityWithReason_usingBlock_1, + reason?._id ?? ffi.nullptr, + block._id); + } + + NSString? get userName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_userName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get fullUserName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_fullUserName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get thermalState { + return _lib._objc_msgSend_852(_id, _lib._sel_thermalState1); + } + + bool get lowPowerModeEnabled { + return _lib._objc_msgSend_12(_id, _lib._sel_isLowPowerModeEnabled1); + } + + bool get macCatalystApp { + return _lib._objc_msgSend_12(_id, _lib._sel_isMacCatalystApp1); + } + + bool get iOSAppOnMac { + return _lib._objc_msgSend_12(_id, _lib._sel_isiOSAppOnMac1); + } + + @override + NSProcessInfo init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSProcessInfo._(_ret, _lib, retain: true, release: true); + } + + static NSProcessInfo new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_new1); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static NSProcessInfo allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSProcessInfo1, _lib._sel_allocWithZone_1, zone); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static NSProcessInfo alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProcessInfo1, _lib._sel_alloc1); + return NSProcessInfo._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSProcessInfo1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSProcessInfo1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProcessInfo1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSProcessInfo1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSProcessInfo1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSProcessInfo1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSProcessInfo1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSProcessInfo1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSProcessInfo1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSOperatingSystemVersion extends ffi.Struct { + @ffi.Long() + external int majorVersion; + + @ffi.Long() + external int minorVersion; + + @ffi.Long() + external int patchVersion; +} + +abstract class NSActivityOptions { + static const int NSActivityIdleDisplaySleepDisabled = 1099511627776; + static const int NSActivityIdleSystemSleepDisabled = 1048576; + static const int NSActivitySuddenTerminationDisabled = 16384; + static const int NSActivityAutomaticTerminationDisabled = 32768; + static const int NSActivityAnimationTrackingEnabled = 35184372088832; + static const int NSActivityTrackingEnabled = 70368744177664; + static const int NSActivityUserInitiated = 16777215; + static const int NSActivityUserInitiatedAllowingIdleSystemSleep = 15728639; + static const int NSActivityBackground = 255; + static const int NSActivityLatencyCritical = 1095216660480; + static const int NSActivityUserInteractive = 1095233437695; +} + +void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, bool arg0) { + return block.ref.target + .cast>() + .asFunction()(arg0); +} + +final _ObjCBlock_ffiVoid_bool_closureRegistry = {}; +int _ObjCBlock_ffiVoid_bool_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_bool_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_bool_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, bool arg0) { + return (_ObjCBlock_ffiVoid_bool_closureRegistry[block.ref.target.address] + as void Function(bool))(arg0); +} + +class ObjCBlock_ffiVoid_bool extends _ObjCBlockBase { + ObjCBlock_ffiVoid_bool._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_bool.fromFunctionPointer(SentryCocoa lib, + ffi.Pointer> ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>( + _ObjCBlock_ffiVoid_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_bool.fromFunction( + SentryCocoa lib, void Function(bool arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>( + _ObjCBlock_ffiVoid_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_bool_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(bool arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, bool arg0)>()(_id, arg0); + } +} + +abstract class NSProcessInfoThermalState { + static const int NSProcessInfoThermalStateNominal = 0; + static const int NSProcessInfoThermalStateFair = 1; + static const int NSProcessInfoThermalStateSerious = 2; + static const int NSProcessInfoThermalStateCritical = 3; +} + +class NSTextCheckingResult extends NSObject { + NSTextCheckingResult._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTextCheckingResult] that points to the same underlying object as [other]. + static NSTextCheckingResult castFrom(T other) { + return NSTextCheckingResult._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSTextCheckingResult] that wraps the given raw object pointer. + static NSTextCheckingResult castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTextCheckingResult._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTextCheckingResult]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSTextCheckingResult1); + } + + int get resultType { + return _lib._objc_msgSend_853(_id, _lib._sel_resultType1); + } + + void getRange(ffi.Pointer<_NSRange> stret) { + _lib._objc_msgSend_49(stret, _id, _lib._sel_range1); + } + + NSOrthography? get orthography { + final _ret = _lib._objc_msgSend_854(_id, _lib._sel_orthography1); + return _ret.address == 0 + ? null + : NSOrthography._(_ret, _lib, retain: true, release: true); + } + + NSArray? get grammarDetails { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_grammarDetails1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSDate? get date { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_date1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + NSTimeZone? get timeZone { + final _ret = _lib._objc_msgSend_168(_id, _lib._sel_timeZone1); + return _ret.address == 0 + ? null + : NSTimeZone._(_ret, _lib, retain: true, release: true); + } + + double get duration { + return _lib._objc_msgSend_155(_id, _lib._sel_duration1); + } + + NSDictionary? get components { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_components1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSString? get replacementString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_replacementString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get alternativeStrings { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_alternativeStrings1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSRegularExpression? get regularExpression { + final _ret = _lib._objc_msgSend_866(_id, _lib._sel_regularExpression1); + return _ret.address == 0 + ? null + : NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSString? get phoneNumber { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_phoneNumber1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get numberOfRanges { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfRanges1); + } + + void rangeAtIndex_(ffi.Pointer<_NSRange> stret, int idx) { + _lib._objc_msgSend_323(stret, _id, _lib._sel_rangeAtIndex_1, idx); + } + + void rangeWithName_(ffi.Pointer<_NSRange> stret, NSString? name) { + _lib._objc_msgSend_316( + stret, _id, _lib._sel_rangeWithName_1, name?._id ?? ffi.nullptr); + } + + NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { + final _ret = _lib._objc_msgSend_867( + _id, _lib._sel_resultByAdjustingRangesWithOffset_1, offset); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get addressComponents { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_addressComponents1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult orthographyCheckingResultWithRange_orthography_( + SentryCocoa _lib, _NSRange range, NSOrthography? orthography) { + final _ret = _lib._objc_msgSend_868( + _lib._class_NSTextCheckingResult1, + _lib._sel_orthographyCheckingResultWithRange_orthography_1, + range, + orthography?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult spellCheckingResultWithRange_( + SentryCocoa _lib, _NSRange range) { + final _ret = _lib._objc_msgSend_869(_lib._class_NSTextCheckingResult1, + _lib._sel_spellCheckingResultWithRange_1, range); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult grammarCheckingResultWithRange_details_( + SentryCocoa _lib, _NSRange range, NSArray? details) { + final _ret = _lib._objc_msgSend_870( + _lib._class_NSTextCheckingResult1, + _lib._sel_grammarCheckingResultWithRange_details_1, + range, + details?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult dateCheckingResultWithRange_date_( + SentryCocoa _lib, _NSRange range, NSDate? date) { + final _ret = _lib._objc_msgSend_871( + _lib._class_NSTextCheckingResult1, + _lib._sel_dateCheckingResultWithRange_date_1, + range, + date?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + dateCheckingResultWithRange_date_timeZone_duration_(SentryCocoa _lib, + _NSRange range, NSDate? date, NSTimeZone? timeZone, double duration) { + final _ret = _lib._objc_msgSend_872( + _lib._class_NSTextCheckingResult1, + _lib._sel_dateCheckingResultWithRange_date_timeZone_duration_1, + range, + date?._id ?? ffi.nullptr, + timeZone?._id ?? ffi.nullptr, + duration); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult addressCheckingResultWithRange_components_( + SentryCocoa _lib, _NSRange range, NSDictionary? components) { + final _ret = _lib._objc_msgSend_873( + _lib._class_NSTextCheckingResult1, + _lib._sel_addressCheckingResultWithRange_components_1, + range, + components?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult linkCheckingResultWithRange_URL_( + SentryCocoa _lib, _NSRange range, NSURL? url) { + final _ret = _lib._objc_msgSend_874( + _lib._class_NSTextCheckingResult1, + _lib._sel_linkCheckingResultWithRange_URL_1, + range, + url?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult quoteCheckingResultWithRange_replacementString_( + SentryCocoa _lib, _NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_875( + _lib._class_NSTextCheckingResult1, + _lib._sel_quoteCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult dashCheckingResultWithRange_replacementString_( + SentryCocoa _lib, _NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_875( + _lib._class_NSTextCheckingResult1, + _lib._sel_dashCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + replacementCheckingResultWithRange_replacementString_( + SentryCocoa _lib, _NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_875( + _lib._class_NSTextCheckingResult1, + _lib._sel_replacementCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_( + SentryCocoa _lib, _NSRange range, NSString? replacementString) { + final _ret = _lib._objc_msgSend_875( + _lib._class_NSTextCheckingResult1, + _lib._sel_correctionCheckingResultWithRange_replacementString_1, + range, + replacementString?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + correctionCheckingResultWithRange_replacementString_alternativeStrings_( + SentryCocoa _lib, + _NSRange range, + NSString? replacementString, + NSArray? alternativeStrings) { + final _ret = _lib._objc_msgSend_876( + _lib._class_NSTextCheckingResult1, + _lib._sel_correctionCheckingResultWithRange_replacementString_alternativeStrings_1, + range, + replacementString?._id ?? ffi.nullptr, + alternativeStrings?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + regularExpressionCheckingResultWithRanges_count_regularExpression_( + SentryCocoa _lib, + ffi.Pointer<_NSRange> ranges, + int count, + NSRegularExpression? regularExpression) { + final _ret = _lib._objc_msgSend_877( + _lib._class_NSTextCheckingResult1, + _lib._sel_regularExpressionCheckingResultWithRanges_count_regularExpression_1, + ranges, + count, + regularExpression?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult phoneNumberCheckingResultWithRange_phoneNumber_( + SentryCocoa _lib, _NSRange range, NSString? phoneNumber) { + final _ret = _lib._objc_msgSend_875( + _lib._class_NSTextCheckingResult1, + _lib._sel_phoneNumberCheckingResultWithRange_phoneNumber_1, + range, + phoneNumber?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult + transitInformationCheckingResultWithRange_components_( + SentryCocoa _lib, _NSRange range, NSDictionary? components) { + final _ret = _lib._objc_msgSend_873( + _lib._class_NSTextCheckingResult1, + _lib._sel_transitInformationCheckingResultWithRange_components_1, + range, + components?._id ?? ffi.nullptr); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + @override + NSTextCheckingResult init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + static NSTextCheckingResult new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSTextCheckingResult1, _lib._sel_new1); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static NSTextCheckingResult allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSTextCheckingResult1, _lib._sel_allocWithZone_1, zone); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static NSTextCheckingResult alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTextCheckingResult1, _lib._sel_alloc1); + return NSTextCheckingResult._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSTextCheckingResult1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSTextCheckingResult1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSTextCheckingResult1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTextCheckingResult1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTextCheckingResult1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTextCheckingResult1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSTextCheckingResult1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSTextCheckingResult1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTextCheckingResult1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTextCheckingType { + static const int NSTextCheckingTypeOrthography = 1; + static const int NSTextCheckingTypeSpelling = 2; + static const int NSTextCheckingTypeGrammar = 4; + static const int NSTextCheckingTypeDate = 8; + static const int NSTextCheckingTypeAddress = 16; + static const int NSTextCheckingTypeLink = 32; + static const int NSTextCheckingTypeQuote = 64; + static const int NSTextCheckingTypeDash = 128; + static const int NSTextCheckingTypeReplacement = 256; + static const int NSTextCheckingTypeCorrection = 512; + static const int NSTextCheckingTypeRegularExpression = 1024; + static const int NSTextCheckingTypePhoneNumber = 2048; + static const int NSTextCheckingTypeTransitInformation = 4096; +} + +class NSRegularExpression extends NSObject { + NSRegularExpression._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSRegularExpression] that points to the same underlying object as [other]. + static NSRegularExpression castFrom(T other) { + return NSRegularExpression._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSRegularExpression] that wraps the given raw object pointer. + static NSRegularExpression castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSRegularExpression._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSRegularExpression]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSRegularExpression1); + } + + static NSRegularExpression regularExpressionWithPattern_options_error_( + SentryCocoa _lib, + NSString? pattern, + int options, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_855( + _lib._class_NSRegularExpression1, + _lib._sel_regularExpressionWithPattern_options_error_1, + pattern?._id ?? ffi.nullptr, + options, + error); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSRegularExpression initWithPattern_options_error_(NSString? pattern, + int options, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_856( + _id, + _lib._sel_initWithPattern_options_error_1, + pattern?._id ?? ffi.nullptr, + options, + error); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + NSString? get pattern { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_pattern1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get options { + return _lib._objc_msgSend_857(_id, _lib._sel_options1); + } + + int get numberOfCaptureGroups { + return _lib._objc_msgSend_10(_id, _lib._sel_numberOfCaptureGroups1); + } + + static NSString escapedPatternForString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSRegularExpression1, + _lib._sel_escapedPatternForString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void enumerateMatchesInString_options_range_usingBlock_( + NSString? string, + int options, + _NSRange range, + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool block) { + _lib._objc_msgSend_858( + _id, + _lib._sel_enumerateMatchesInString_options_range_usingBlock_1, + string?._id ?? ffi.nullptr, + options, + range, + block._id); + } + + NSArray matchesInString_options_range_( + NSString? string, int options, _NSRange range) { + final _ret = _lib._objc_msgSend_859( + _id, + _lib._sel_matchesInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + int numberOfMatchesInString_options_range_( + NSString? string, int options, _NSRange range) { + return _lib._objc_msgSend_860( + _id, + _lib._sel_numberOfMatchesInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + } + + NSTextCheckingResult firstMatchInString_options_range_( + NSString? string, int options, _NSRange range) { + final _ret = _lib._objc_msgSend_861( + _id, + _lib._sel_firstMatchInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + return NSTextCheckingResult._(_ret, _lib, retain: true, release: true); + } + + void rangeOfFirstMatchInString_options_range_(ffi.Pointer<_NSRange> stret, + NSString? string, int options, _NSRange range) { + _lib._objc_msgSend_862( + stret, + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string?._id ?? ffi.nullptr, + options, + range); + } + + NSString stringByReplacingMatchesInString_options_range_withTemplate_( + NSString? string, int options, _NSRange range, NSString? templ) { + final _ret = _lib._objc_msgSend_863( + _id, + _lib._sel_stringByReplacingMatchesInString_options_range_withTemplate_1, + string?._id ?? ffi.nullptr, + options, + range, + templ?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + int replaceMatchesInString_options_range_withTemplate_( + NSMutableString? string, int options, _NSRange range, NSString? templ) { + return _lib._objc_msgSend_864( + _id, + _lib._sel_replaceMatchesInString_options_range_withTemplate_1, + string?._id ?? ffi.nullptr, + options, + range, + templ?._id ?? ffi.nullptr); + } + + NSString replacementStringForResult_inString_offset_template_( + NSTextCheckingResult? result, + NSString? string, + int offset, + NSString? templ) { + final _ret = _lib._objc_msgSend_865( + _id, + _lib._sel_replacementStringForResult_inString_offset_template_1, + result?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr, + offset, + templ?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString escapedTemplateForString_( + SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSRegularExpression1, + _lib._sel_escapedTemplateForString_1, string?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSRegularExpression init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSRegularExpression._(_ret, _lib, retain: true, release: true); + } + + static NSRegularExpression new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSRegularExpression1, _lib._sel_new1); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static NSRegularExpression allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSRegularExpression1, _lib._sel_allocWithZone_1, zone); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static NSRegularExpression alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRegularExpression1, _lib._sel_alloc1); + return NSRegularExpression._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSRegularExpression1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSRegularExpression1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSRegularExpression1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSRegularExpression1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSRegularExpression1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSRegularExpression1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSRegularExpression1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSRegularExpression1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSRegularExpression1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSRegularExpressionOptions { + static const int NSRegularExpressionCaseInsensitive = 1; + static const int NSRegularExpressionAllowCommentsAndWhitespace = 2; + static const int NSRegularExpressionIgnoreMetacharacters = 4; + static const int NSRegularExpressionDotMatchesLineSeparators = 8; + static const int NSRegularExpressionAnchorsMatchLines = 16; + static const int NSRegularExpressionUseUnixLineSeparators = 32; + static const int NSRegularExpressionUseUnicodeWordBoundaries = 64; +} + +abstract class NSMatchingOptions { + static const int NSMatchingReportProgress = 1; + static const int NSMatchingReportCompletion = 2; + static const int NSMatchingAnchored = 4; + static const int NSMatchingWithTransparentBounds = 8; + static const int NSMatchingWithoutAnchoringBounds = 16; +} + +void + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Int32 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistryIndex = + 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistry[ + id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, int, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool + extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Int32 arg1, ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSTextCheckingResult_NSMatchingFlags_bool_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, int arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Int32 arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +abstract class NSMatchingFlags { + static const int NSMatchingProgress = 1; + static const int NSMatchingCompleted = 2; + static const int NSMatchingHitEnd = 4; + static const int NSMatchingRequiredEnd = 8; + static const int NSMatchingInternalError = 16; +} + +class NSURLCache extends NSObject { + NSURLCache._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCache] that points to the same underlying object as [other]. + static NSURLCache castFrom(T other) { + return NSURLCache._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLCache] that wraps the given raw object pointer. + static NSURLCache castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCache._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLCache1); + } + + static NSURLCache? getSharedURLCache(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_878( + _lib._class_NSURLCache1, _lib._sel_sharedURLCache1); + return _ret.address == 0 + ? null + : NSURLCache._(_ret, _lib, retain: true, release: true); + } + + static void setSharedURLCache(SentryCocoa _lib, NSURLCache? value) { + return _lib._objc_msgSend_879(_lib._class_NSURLCache1, + _lib._sel_setSharedURLCache_1, value?._id ?? ffi.nullptr); + } + + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + int memoryCapacity, int diskCapacity, NSString? path) { + final _ret = _lib._objc_msgSend_880( + _id, + _lib._sel_initWithMemoryCapacity_diskCapacity_diskPath_1, + memoryCapacity, + diskCapacity, + path?._id ?? ffi.nullptr); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + int memoryCapacity, int diskCapacity, NSURL? directoryURL) { + final _ret = _lib._objc_msgSend_881( + _id, + _lib._sel_initWithMemoryCapacity_diskCapacity_directoryURL_1, + memoryCapacity, + diskCapacity, + directoryURL?._id ?? ffi.nullptr); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse cachedResponseForRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_885( + _id, _lib._sel_cachedResponseForRequest_1, request?._id ?? ffi.nullptr); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + void storeCachedResponse_forRequest_( + NSCachedURLResponse? cachedResponse, NSURLRequest? request) { + _lib._objc_msgSend_886(_id, _lib._sel_storeCachedResponse_forRequest_1, + cachedResponse?._id ?? ffi.nullptr, request?._id ?? ffi.nullptr); + } + + void removeCachedResponseForRequest_(NSURLRequest? request) { + _lib._objc_msgSend_887(_id, _lib._sel_removeCachedResponseForRequest_1, + request?._id ?? ffi.nullptr); + } + + void removeAllCachedResponses() { + _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResponses1); + } + + void removeCachedResponsesSinceDate_(NSDate? date) { + _lib._objc_msgSend_504(_id, _lib._sel_removeCachedResponsesSinceDate_1, + date?._id ?? ffi.nullptr); + } + + int get memoryCapacity { + return _lib._objc_msgSend_10(_id, _lib._sel_memoryCapacity1); + } + + set memoryCapacity(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setMemoryCapacity_1, value); + } + + int get diskCapacity { + return _lib._objc_msgSend_10(_id, _lib._sel_diskCapacity1); + } + + set diskCapacity(int value) { + return _lib._objc_msgSend_483(_id, _lib._sel_setDiskCapacity_1, value); + } + + int get currentMemoryUsage { + return _lib._objc_msgSend_10(_id, _lib._sel_currentMemoryUsage1); + } + + int get currentDiskUsage { + return _lib._objc_msgSend_10(_id, _lib._sel_currentDiskUsage1); + } + + void storeCachedResponse_forDataTask_( + NSCachedURLResponse? cachedResponse, NSURLSessionDataTask? dataTask) { + _lib._objc_msgSend_888(_id, _lib._sel_storeCachedResponse_forDataTask_1, + cachedResponse?._id ?? ffi.nullptr, dataTask?._id ?? ffi.nullptr); + } + + void getCachedResponseForDataTask_completionHandler_( + NSURLSessionDataTask? dataTask, + ObjCBlock_ffiVoid_NSCachedURLResponse completionHandler) { + _lib._objc_msgSend_889( + _id, + _lib._sel_getCachedResponseForDataTask_completionHandler_1, + dataTask?._id ?? ffi.nullptr, + completionHandler._id); + } + + void removeCachedResponseForDataTask_(NSURLSessionDataTask? dataTask) { + _lib._objc_msgSend_890(_id, _lib._sel_removeCachedResponseForDataTask_1, + dataTask?._id ?? ffi.nullptr); + } + + @override + NSURLCache init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLCache._(_ret, _lib, retain: true, release: true); + } + + static NSURLCache new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_new1); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static NSURLCache allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLCache1, _lib._sel_allocWithZone_1, zone); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static NSURLCache alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_alloc1); + return NSURLCache._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLCache1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLCache1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCache1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCache1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCache1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCache1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLCache1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLCache1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCache1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSCachedURLResponse extends NSObject { + NSCachedURLResponse._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSCachedURLResponse] that points to the same underlying object as [other]. + static NSCachedURLResponse castFrom(T other) { + return NSCachedURLResponse._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSCachedURLResponse] that wraps the given raw object pointer. + static NSCachedURLResponse castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSCachedURLResponse._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSCachedURLResponse]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSCachedURLResponse1); + } + + NSCachedURLResponse initWithResponse_data_( + NSURLResponse? response, NSData? data) { + final _ret = _lib._objc_msgSend_882(_id, _lib._sel_initWithResponse_data_1, + response?._id ?? ffi.nullptr, data?._id ?? ffi.nullptr); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( + NSURLResponse? response, + NSData? data, + NSDictionary? userInfo, + int storagePolicy) { + final _ret = _lib._objc_msgSend_883( + _id, + _lib._sel_initWithResponse_data_userInfo_storagePolicy_1, + response?._id ?? ffi.nullptr, + data?._id ?? ffi.nullptr, + userInfo?._id ?? ffi.nullptr, + storagePolicy); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSURLResponse? get response { + final _ret = _lib._objc_msgSend_797(_id, _lib._sel_response1); + return _ret.address == 0 + ? null + : NSURLResponse._(_ret, _lib, retain: true, release: true); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get userInfo { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_userInfo1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + int get storagePolicy { + return _lib._objc_msgSend_884(_id, _lib._sel_storagePolicy1); + } + + @override + NSCachedURLResponse init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + static NSCachedURLResponse new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSCachedURLResponse1, _lib._sel_new1); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSCachedURLResponse allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSCachedURLResponse1, _lib._sel_allocWithZone_1, zone); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static NSCachedURLResponse alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCachedURLResponse1, _lib._sel_alloc1); + return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSCachedURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSCachedURLResponse1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSCachedURLResponse1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSCachedURLResponse1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSCachedURLResponse1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSCachedURLResponse1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSCachedURLResponse1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSCachedURLResponse1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSCachedURLResponse1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLCacheStoragePolicy { + static const int NSURLCacheStorageAllowed = 0; + static const int NSURLCacheStorageAllowedInMemoryOnly = 1; + static const int NSURLCacheStorageNotAllowed = 2; +} + +class NSURLSessionDataTask extends NSURLSessionTask { + NSURLSessionDataTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionDataTask] that points to the same underlying object as [other]. + static NSURLSessionDataTask castFrom(T other) { + return NSURLSessionDataTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionDataTask] that wraps the given raw object pointer. + static NSURLSessionDataTask castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionDataTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionDataTask1); + } + + @override + NSURLSessionDataTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionDataTask new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSessionDataTask1, _lib._sel_new1); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDataTask allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLSessionDataTask1, _lib._sel_allocWithZone_1, zone); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDataTask alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDataTask1, _lib._sel_alloc1); + return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionDataTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionDataTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionDataTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionDataTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionDataTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionDataTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionDataTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionDataTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDataTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry[block + .ref.target.address] as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSCachedURLResponse extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSCachedURLResponse._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSURLConnection extends NSObject { + NSURLConnection._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLConnection] that points to the same underlying object as [other]. + static NSURLConnection castFrom(T other) { + return NSURLConnection._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLConnection] that wraps the given raw object pointer. + static NSURLConnection castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLConnection._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLConnection]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLConnection1); + } + + NSURLConnection initWithRequest_delegate_startImmediately_( + NSURLRequest? request, NSObject delegate, bool startImmediately) { + final _ret = _lib._objc_msgSend_891( + _id, + _lib._sel_initWithRequest_delegate_startImmediately_1, + request?._id ?? ffi.nullptr, + delegate._id, + startImmediately); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + NSURLConnection initWithRequest_delegate_( + NSURLRequest? request, NSObject delegate) { + final _ret = _lib._objc_msgSend_892( + _id, + _lib._sel_initWithRequest_delegate_1, + request?._id ?? ffi.nullptr, + delegate._id); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + static NSURLConnection connectionWithRequest_delegate_( + SentryCocoa _lib, NSURLRequest? request, NSObject delegate) { + final _ret = _lib._objc_msgSend_893( + _lib._class_NSURLConnection1, + _lib._sel_connectionWithRequest_delegate_1, + request?._id ?? ffi.nullptr, + delegate._id); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get originalRequest { + final _ret = _lib._objc_msgSend_795(_id, _lib._sel_originalRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get currentRequest { + final _ret = _lib._objc_msgSend_795(_id, _lib._sel_currentRequest1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + void start() { + _lib._objc_msgSend_1(_id, _lib._sel_start1); + } + + void cancel() { + _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode._id); + } + + void unscheduleFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_unscheduleFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode._id); + } + + void setDelegateQueue_(NSOperationQueue? queue) { + _lib._objc_msgSend_894( + _id, _lib._sel_setDelegateQueue_1, queue?._id ?? ffi.nullptr); + } + + static bool canHandleRequest_(SentryCocoa _lib, NSURLRequest? request) { + return _lib._objc_msgSend_895(_lib._class_NSURLConnection1, + _lib._sel_canHandleRequest_1, request?._id ?? ffi.nullptr); + } + + static NSData sendSynchronousRequest_returningResponse_error_( + SentryCocoa _lib, + NSURLRequest? request, + ffi.Pointer> response, + ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_896( + _lib._class_NSURLConnection1, + _lib._sel_sendSynchronousRequest_returningResponse_error_1, + request?._id ?? ffi.nullptr, + response, + error); + return NSData._(_ret, _lib, retain: true, release: true); + } + + static void sendAsynchronousRequest_queue_completionHandler_( + SentryCocoa _lib, + NSURLRequest? request, + NSOperationQueue? queue, + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError handler) { + _lib._objc_msgSend_897( + _lib._class_NSURLConnection1, + _lib._sel_sendAsynchronousRequest_queue_completionHandler_1, + request?._id ?? ffi.nullptr, + queue?._id ?? ffi.nullptr, + handler._id); + } + + @override + NSURLConnection init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLConnection._(_ret, _lib, retain: true, release: true); + } + + static NSURLConnection new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_new1); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static NSURLConnection allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLConnection1, _lib._sel_allocWithZone_1, zone); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static NSURLConnection alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLConnection1, _lib._sel_alloc1); + return NSURLConnection._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLConnection1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLConnection1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLConnection1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLConnection1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLConnection1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLConnection1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLConnection1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLConnection1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSURLResponse_NSData_NSError_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSURLCredential extends NSObject { + NSURLCredential._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCredential] that points to the same underlying object as [other]. + static NSURLCredential castFrom(T other) { + return NSURLCredential._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLCredential] that wraps the given raw object pointer. + static NSURLCredential castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCredential._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCredential]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLCredential1); + } + + int get persistence { + return _lib._objc_msgSend_898(_id, _lib._sel_persistence1); + } + + NSURLCredential initWithUser_password_persistence_( + NSString? user, NSString? password, int persistence) { + final _ret = _lib._objc_msgSend_899( + _id, + _lib._sel_initWithUser_password_persistence_1, + user?._id ?? ffi.nullptr, + password?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialWithUser_password_persistence_( + SentryCocoa _lib, NSString? user, NSString? password, int persistence) { + final _ret = _lib._objc_msgSend_900( + _lib._class_NSURLCredential1, + _lib._sel_credentialWithUser_password_persistence_1, + user?._id ?? ffi.nullptr, + password?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + NSString? get user { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_user1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get password { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_password1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get hasPassword { + return _lib._objc_msgSend_12(_id, _lib._sel_hasPassword1); + } + + NSURLCredential initWithIdentity_certificates_persistence_( + ffi.Pointer<__SecIdentity> identity, + NSArray? certArray, + int persistence) { + final _ret = _lib._objc_msgSend_901( + _id, + _lib._sel_initWithIdentity_certificates_persistence_1, + identity, + certArray?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialWithIdentity_certificates_persistence_( + SentryCocoa _lib, + ffi.Pointer<__SecIdentity> identity, + NSArray? certArray, + int persistence) { + final _ret = _lib._objc_msgSend_902( + _lib._class_NSURLCredential1, + _lib._sel_credentialWithIdentity_certificates_persistence_1, + identity, + certArray?._id ?? ffi.nullptr, + persistence); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer<__SecIdentity> get identity { + return _lib._objc_msgSend_903(_id, _lib._sel_identity1); + } + + NSArray? get certificates { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_certificates1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSURLCredential initWithTrust_(ffi.Pointer<__SecTrust> trust) { + final _ret = _lib._objc_msgSend_904(_id, _lib._sel_initWithTrust_1, trust); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential credentialForTrust_( + SentryCocoa _lib, ffi.Pointer<__SecTrust> trust) { + final _ret = _lib._objc_msgSend_905( + _lib._class_NSURLCredential1, _lib._sel_credentialForTrust_1, trust); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLCredential init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredential new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_new1); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredential allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLCredential1, _lib._sel_allocWithZone_1, zone); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredential alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLCredential1, _lib._sel_alloc1); + return NSURLCredential._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLCredential1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLCredential1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLCredential1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCredential1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCredential1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCredential1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLCredential1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLCredential1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredential1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLCredentialPersistence { + static const int NSURLCredentialPersistenceNone = 0; + static const int NSURLCredentialPersistenceForSession = 1; + static const int NSURLCredentialPersistencePermanent = 2; + static const int NSURLCredentialPersistenceSynchronizable = 3; +} + +class __SecIdentity extends ffi.Opaque {} + +class __SecTrust extends ffi.Opaque {} + +class NSURLProtectionSpace extends NSObject { + NSURLProtectionSpace._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLProtectionSpace] that points to the same underlying object as [other]. + static NSURLProtectionSpace castFrom(T other) { + return NSURLProtectionSpace._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLProtectionSpace] that wraps the given raw object pointer. + static NSURLProtectionSpace castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLProtectionSpace._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLProtectionSpace]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLProtectionSpace1); + } + + NSURLProtectionSpace initWithHost_port_protocol_realm_authenticationMethod_( + NSString? host, + int port, + NSString? protocol, + NSString? realm, + NSString? authenticationMethod) { + final _ret = _lib._objc_msgSend_906( + _id, + _lib._sel_initWithHost_port_protocol_realm_authenticationMethod_1, + host?._id ?? ffi.nullptr, + port, + protocol?._id ?? ffi.nullptr, + realm?._id ?? ffi.nullptr, + authenticationMethod?._id ?? ffi.nullptr); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + NSURLProtectionSpace initWithProxyHost_port_type_realm_authenticationMethod_( + NSString? host, + int port, + NSString? type, + NSString? realm, + NSString? authenticationMethod) { + final _ret = _lib._objc_msgSend_906( + _id, + _lib._sel_initWithProxyHost_port_type_realm_authenticationMethod_1, + host?._id ?? ffi.nullptr, + port, + type?._id ?? ffi.nullptr, + realm?._id ?? ffi.nullptr, + authenticationMethod?._id ?? ffi.nullptr); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + NSString? get realm { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_realm1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + bool get receivesCredentialSecurely { + return _lib._objc_msgSend_12(_id, _lib._sel_receivesCredentialSecurely1); + } + + bool get isProxy { + return _lib._objc_msgSend_12(_id, _lib._sel_isProxy1); + } + + NSString? get host { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_host1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get port { + return _lib._objc_msgSend_78(_id, _lib._sel_port1); + } + + NSString? get proxyType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_proxyType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get protocol { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_protocol1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get authenticationMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_authenticationMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get distinguishedNames { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_distinguishedNames1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + ffi.Pointer<__SecTrust> get serverTrust { + return _lib._objc_msgSend_907(_id, _lib._sel_serverTrust1); + } + + @override + NSURLProtectionSpace init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLProtectionSpace._(_ret, _lib, retain: true, release: true); + } + + static NSURLProtectionSpace new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtectionSpace1, _lib._sel_new1); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtectionSpace allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLProtectionSpace1, _lib._sel_allocWithZone_1, zone); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtectionSpace alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtectionSpace1, _lib._sel_alloc1); + return NSURLProtectionSpace._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLProtectionSpace1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLProtectionSpace1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLProtectionSpace1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtectionSpace1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLProtectionSpace1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLProtectionSpace1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLProtectionSpace1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLProtectionSpace1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtectionSpace1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLCredentialStorage extends NSObject { + NSURLCredentialStorage._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLCredentialStorage] that points to the same underlying object as [other]. + static NSURLCredentialStorage castFrom(T other) { + return NSURLCredentialStorage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLCredentialStorage] that wraps the given raw object pointer. + static NSURLCredentialStorage castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLCredentialStorage._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLCredentialStorage1); + } + + static NSURLCredentialStorage? getSharedCredentialStorage(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_908(_lib._class_NSURLCredentialStorage1, + _lib._sel_sharedCredentialStorage1); + return _ret.address == 0 + ? null + : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + NSDictionary credentialsForProtectionSpace_(NSURLProtectionSpace? space) { + final _ret = _lib._objc_msgSend_909(_id, + _lib._sel_credentialsForProtectionSpace_1, space?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSDictionary? get allCredentials { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_allCredentials1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + void setCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + _lib._objc_msgSend_910(_id, _lib._sel_setCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, space?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + _lib._objc_msgSend_910(_id, _lib._sel_removeCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, space?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_options_(NSURLCredential? credential, + NSURLProtectionSpace? space, NSDictionary? options) { + _lib._objc_msgSend_911( + _id, + _lib._sel_removeCredential_forProtectionSpace_options_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr); + } + + NSURLCredential defaultCredentialForProtectionSpace_( + NSURLProtectionSpace? space) { + final _ret = _lib._objc_msgSend_912( + _id, + _lib._sel_defaultCredentialForProtectionSpace_1, + space?._id ?? ffi.nullptr); + return NSURLCredential._(_ret, _lib, retain: true, release: true); + } + + void setDefaultCredential_forProtectionSpace_( + NSURLCredential? credential, NSURLProtectionSpace? space) { + _lib._objc_msgSend_910( + _id, + _lib._sel_setDefaultCredential_forProtectionSpace_1, + credential?._id ?? ffi.nullptr, + space?._id ?? ffi.nullptr); + } + + void getCredentialsForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace? protectionSpace, + NSURLSessionTask? task, + ObjCBlock_ffiVoid_NSDictionary completionHandler) { + _lib._objc_msgSend_913( + _id, + _lib._sel_getCredentialsForProtectionSpace_task_completionHandler_1, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr, + completionHandler._id); + } + + void setCredential_forProtectionSpace_task_(NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, NSURLSessionTask? task) { + _lib._objc_msgSend_914( + _id, + _lib._sel_setCredential_forProtectionSpace_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + void removeCredential_forProtectionSpace_options_task_( + NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, + NSDictionary? options, + NSURLSessionTask? task) { + _lib._objc_msgSend_915( + _id, + _lib._sel_removeCredential_forProtectionSpace_options_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + options?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + void getDefaultCredentialForProtectionSpace_task_completionHandler_( + NSURLProtectionSpace? space, + NSURLSessionTask? task, + ObjCBlock_ffiVoid_NSURLCredential completionHandler) { + _lib._objc_msgSend_916( + _id, + _lib._sel_getDefaultCredentialForProtectionSpace_task_completionHandler_1, + space?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr, + completionHandler._id); + } + + void setDefaultCredential_forProtectionSpace_task_( + NSURLCredential? credential, + NSURLProtectionSpace? protectionSpace, + NSURLSessionTask? task) { + _lib._objc_msgSend_914( + _id, + _lib._sel_setDefaultCredential_forProtectionSpace_task_1, + credential?._id ?? ffi.nullptr, + protectionSpace?._id ?? ffi.nullptr, + task?._id ?? ffi.nullptr); + } + + @override + NSURLCredentialStorage init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + static NSURLCredentialStorage new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredentialStorage1, _lib._sel_new1); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredentialStorage allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLCredentialStorage1, _lib._sel_allocWithZone_1, zone); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static NSURLCredentialStorage alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLCredentialStorage1, _lib._sel_alloc1); + return NSURLCredentialStorage._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLCredentialStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLCredentialStorage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLCredentialStorage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLCredentialStorage1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLCredentialStorage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLCredentialStorage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLCredentialStorage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLCredentialStorage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCredentialStorage1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSDictionary_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSDictionary_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSDictionary_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSDictionary_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSDictionary_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSDictionary_closureRegistry[block + .ref.target.address] as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSDictionary extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSDictionary._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSDictionary.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSDictionary_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSDictionary.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSDictionary_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSDictionary_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +void _ObjCBlock_ffiVoid_NSURLCredential_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSURLCredential_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSURLCredential_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSURLCredential_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSURLCredential_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSURLCredential_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSURLCredential_closureRegistry[block + .ref.target.address] as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSURLCredential extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSURLCredential._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSURLCredential.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSURLCredential_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSURLCredential.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSURLCredential_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSURLCredential_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSURLProtocol extends NSObject { + NSURLProtocol._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLProtocol] that points to the same underlying object as [other]. + static NSURLProtocol castFrom(T other) { + return NSURLProtocol._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLProtocol] that wraps the given raw object pointer. + static NSURLProtocol castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLProtocol._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLProtocol]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLProtocol1); + } + + NSURLProtocol initWithRequest_cachedResponse_client_(NSURLRequest? request, + NSCachedURLResponse? cachedResponse, NSObject? client) { + final _ret = _lib._objc_msgSend_917( + _id, + _lib._sel_initWithRequest_cachedResponse_client_1, + request?._id ?? ffi.nullptr, + cachedResponse?._id ?? ffi.nullptr, + client?._id ?? ffi.nullptr); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + NSObject? get client { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_client1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSURLRequest? get request { + final _ret = _lib._objc_msgSend_795(_id, _lib._sel_request1); + return _ret.address == 0 + ? null + : NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + NSCachedURLResponse? get cachedResponse { + final _ret = _lib._objc_msgSend_918(_id, _lib._sel_cachedResponse1); + return _ret.address == 0 + ? null + : NSCachedURLResponse._(_ret, _lib, retain: true, release: true); + } + + static bool canInitWithRequest_(SentryCocoa _lib, NSURLRequest? request) { + return _lib._objc_msgSend_895(_lib._class_NSURLProtocol1, + _lib._sel_canInitWithRequest_1, request?._id ?? ffi.nullptr); + } + + static NSURLRequest canonicalRequestForRequest_( + SentryCocoa _lib, NSURLRequest? request) { + final _ret = _lib._objc_msgSend_919(_lib._class_NSURLProtocol1, + _lib._sel_canonicalRequestForRequest_1, request?._id ?? ffi.nullptr); + return NSURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool requestIsCacheEquivalent_toRequest_( + SentryCocoa _lib, NSURLRequest? a, NSURLRequest? b) { + return _lib._objc_msgSend_920( + _lib._class_NSURLProtocol1, + _lib._sel_requestIsCacheEquivalent_toRequest_1, + a?._id ?? ffi.nullptr, + b?._id ?? ffi.nullptr); + } + + void startLoading() { + _lib._objc_msgSend_1(_id, _lib._sel_startLoading1); + } + + void stopLoading() { + _lib._objc_msgSend_1(_id, _lib._sel_stopLoading1); + } + + static NSObject propertyForKey_inRequest_( + SentryCocoa _lib, NSString? key, NSURLRequest? request) { + final _ret = _lib._objc_msgSend_921( + _lib._class_NSURLProtocol1, + _lib._sel_propertyForKey_inRequest_1, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static void setProperty_forKey_inRequest_(SentryCocoa _lib, NSObject value, + NSString? key, NSMutableURLRequest? request) { + _lib._objc_msgSend_927( + _lib._class_NSURLProtocol1, + _lib._sel_setProperty_forKey_inRequest_1, + value._id, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + static void removePropertyForKey_inRequest_( + SentryCocoa _lib, NSString? key, NSMutableURLRequest? request) { + _lib._objc_msgSend_928( + _lib._class_NSURLProtocol1, + _lib._sel_removePropertyForKey_inRequest_1, + key?._id ?? ffi.nullptr, + request?._id ?? ffi.nullptr); + } + + static bool registerClass_(SentryCocoa _lib, NSObject protocolClass) { + return _lib._objc_msgSend_0(_lib._class_NSURLProtocol1, + _lib._sel_registerClass_1, protocolClass._id); + } + + static void unregisterClass_(SentryCocoa _lib, NSObject protocolClass) { + _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, + _lib._sel_unregisterClass_1, protocolClass._id); + } + + static bool canInitWithTask_(SentryCocoa _lib, NSURLSessionTask? task) { + return _lib._objc_msgSend_929(_lib._class_NSURLProtocol1, + _lib._sel_canInitWithTask_1, task?._id ?? ffi.nullptr); + } + + NSURLProtocol initWithTask_cachedResponse_client_(NSURLSessionTask? task, + NSCachedURLResponse? cachedResponse, NSObject? client) { + final _ret = _lib._objc_msgSend_930( + _id, + _lib._sel_initWithTask_cachedResponse_client_1, + task?._id ?? ffi.nullptr, + cachedResponse?._id ?? ffi.nullptr, + client?._id ?? ffi.nullptr); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionTask? get task { + final _ret = _lib._objc_msgSend_931(_id, _lib._sel_task1); + return _ret.address == 0 + ? null + : NSURLSessionTask._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLProtocol init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLProtocol._(_ret, _lib, retain: true, release: true); + } + + static NSURLProtocol new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_new1); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtocol allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLProtocol1, _lib._sel_allocWithZone_1, zone); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static NSURLProtocol alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLProtocol1, _lib._sel_alloc1); + return NSURLProtocol._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLProtocol1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLProtocol1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtocol1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLProtocol1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLProtocol1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLProtocol1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLProtocol1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLProtocol1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLProtocol1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSMutableURLRequest] that points to the same underlying object as [other]. + static NSMutableURLRequest castFrom(T other) { + return NSMutableURLRequest._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSMutableURLRequest] that wraps the given raw object pointer. + static NSMutableURLRequest castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSMutableURLRequest._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSMutableURLRequest1); + } + + @override + NSURL? get URL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_URL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set URL(NSURL? value) { + return _lib._objc_msgSend_621( + _id, _lib._sel_setURL_1, value?._id ?? ffi.nullptr); + } + + @override + int get cachePolicy { + return _lib._objc_msgSend_782(_id, _lib._sel_cachePolicy1); + } + + set cachePolicy(int value) { + return _lib._objc_msgSend_922(_id, _lib._sel_setCachePolicy_1, value); + } + + @override + double get timeoutInterval { + return _lib._objc_msgSend_155(_id, _lib._sel_timeoutInterval1); + } + + set timeoutInterval(double value) { + return _lib._objc_msgSend_506(_id, _lib._sel_setTimeoutInterval_1, value); + } + + @override + NSURL? get mainDocumentURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_mainDocumentURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set mainDocumentURL(NSURL? value) { + return _lib._objc_msgSend_621( + _id, _lib._sel_setMainDocumentURL_1, value?._id ?? ffi.nullptr); + } + + @override + int get networkServiceType { + return _lib._objc_msgSend_783(_id, _lib._sel_networkServiceType1); + } + + set networkServiceType(int value) { + return _lib._objc_msgSend_923( + _id, _lib._sel_setNetworkServiceType_1, value); + } + + @override + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + set allowsCellularAccess(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsCellularAccess_1, value); + } + + @override + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + set allowsExpensiveNetworkAccess(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); + } + + @override + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + set allowsConstrainedNetworkAccess(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + } + + @override + bool get assumesHTTP3Capable { + return _lib._objc_msgSend_12(_id, _lib._sel_assumesHTTP3Capable1); + } + + set assumesHTTP3Capable(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAssumesHTTP3Capable_1, value); + } + + @override + int get attribution { + return _lib._objc_msgSend_784(_id, _lib._sel_attribution1); + } + + set attribution(int value) { + return _lib._objc_msgSend_924(_id, _lib._sel_setAttribution_1, value); + } + + @override + bool get requiresDNSSECValidation { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresDNSSECValidation1); + } + + set requiresDNSSECValidation(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setRequiresDNSSECValidation_1, value); + } + + @override + NSString? get HTTPMethod { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_HTTPMethod1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set HTTPMethod(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setHTTPMethod_1, value?._id ?? ffi.nullptr); + } + + @override + NSDictionary? get allHTTPHeaderFields { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_allHTTPHeaderFields1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set allHTTPHeaderFields(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setAllHTTPHeaderFields_1, value?._id ?? ffi.nullptr); + } + + void setValue_forHTTPHeaderField_(NSString? value, NSString? field) { + _lib._objc_msgSend_515(_id, _lib._sel_setValue_forHTTPHeaderField_1, + value?._id ?? ffi.nullptr, field?._id ?? ffi.nullptr); + } + + void addValue_forHTTPHeaderField_(NSString? value, NSString? field) { + _lib._objc_msgSend_515(_id, _lib._sel_addValue_forHTTPHeaderField_1, + value?._id ?? ffi.nullptr, field?._id ?? ffi.nullptr); + } + + @override + NSData? get HTTPBody { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_HTTPBody1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + set HTTPBody(NSData? value) { + return _lib._objc_msgSend_925( + _id, _lib._sel_setHTTPBody_1, value?._id ?? ffi.nullptr); + } + + @override + NSInputStream? get HTTPBodyStream { + final _ret = _lib._objc_msgSend_794(_id, _lib._sel_HTTPBodyStream1); + return _ret.address == 0 + ? null + : NSInputStream._(_ret, _lib, retain: true, release: true); + } + + set HTTPBodyStream(NSInputStream? value) { + return _lib._objc_msgSend_926( + _id, _lib._sel_setHTTPBodyStream_1, value?._id ?? ffi.nullptr); + } + + @override + bool get HTTPShouldHandleCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldHandleCookies1); + } + + set HTTPShouldHandleCookies(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setHTTPShouldHandleCookies_1, value); + } + + @override + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + set HTTPShouldUsePipelining(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setHTTPShouldUsePipelining_1, value); + } + + static NSMutableURLRequest requestWithURL_(SentryCocoa _lib, NSURL? URL) { + final _ret = _lib._objc_msgSend_241(_lib._class_NSMutableURLRequest1, + _lib._sel_requestWithURL_1, URL?._id ?? ffi.nullptr); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + static bool getSupportsSecureCoding(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableURLRequest1, _lib._sel_supportsSecureCoding1); + } + + static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( + SentryCocoa _lib, NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_781( + _lib._class_NSMutableURLRequest1, + _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableURLRequest initWithURL_(NSURL? URL) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithURL_1, URL?._id ?? ffi.nullptr); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_( + NSURL? URL, int cachePolicy, double timeoutInterval) { + final _ret = _lib._objc_msgSend_781( + _id, + _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, + URL?._id ?? ffi.nullptr, + cachePolicy, + timeoutInterval); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + @override + NSMutableURLRequest init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + } + + static NSMutableURLRequest new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSMutableURLRequest1, _lib._sel_new1); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSMutableURLRequest allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSMutableURLRequest1, _lib._sel_allocWithZone_1, zone); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static NSMutableURLRequest alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableURLRequest1, _lib._sel_alloc1); + return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSMutableURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSMutableURLRequest1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSMutableURLRequest1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSMutableURLRequest1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSMutableURLRequest1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSMutableURLRequest1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSMutableURLRequest1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSMutableURLRequest1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSMutableURLRequest1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLParser extends NSObject { + NSXMLParser._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLParser] that points to the same underlying object as [other]. + static NSXMLParser castFrom(T other) { + return NSXMLParser._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLParser] that wraps the given raw object pointer. + static NSXMLParser castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLParser._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLParser]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLParser1); + } + + NSXMLParser initWithContentsOfURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, _lib._sel_initWithContentsOfURL_1, url?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSXMLParser initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_257( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSXMLParser initWithStream_(NSInputStream? stream) { + final _ret = _lib._objc_msgSend_932( + _id, _lib._sel_initWithStream_1, stream?._id ?? ffi.nullptr); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get shouldProcessNamespaces { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldProcessNamespaces1); + } + + set shouldProcessNamespaces(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setShouldProcessNamespaces_1, value); + } + + bool get shouldReportNamespacePrefixes { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldReportNamespacePrefixes1); + } + + set shouldReportNamespacePrefixes(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setShouldReportNamespacePrefixes_1, value); + } + + int get externalEntityResolvingPolicy { + return _lib._objc_msgSend_933( + _id, _lib._sel_externalEntityResolvingPolicy1); + } + + set externalEntityResolvingPolicy(int value) { + return _lib._objc_msgSend_934( + _id, _lib._sel_setExternalEntityResolvingPolicy_1, value); + } + + NSSet? get allowedExternalEntityURLs { + final _ret = + _lib._objc_msgSend_295(_id, _lib._sel_allowedExternalEntityURLs1); + return _ret.address == 0 + ? null + : NSSet._(_ret, _lib, retain: true, release: true); + } + + set allowedExternalEntityURLs(NSSet? value) { + return _lib._objc_msgSend_935(_id, _lib._sel_setAllowedExternalEntityURLs_1, + value?._id ?? ffi.nullptr); + } + + bool parse() { + return _lib._objc_msgSend_12(_id, _lib._sel_parse1); + } + + void abortParsing() { + _lib._objc_msgSend_1(_id, _lib._sel_abortParsing1); + } + + NSError? get parserError { + final _ret = _lib._objc_msgSend_298(_id, _lib._sel_parserError1); + return _ret.address == 0 + ? null + : NSError._(_ret, _lib, retain: true, release: true); + } + + bool get shouldResolveExternalEntities { + return _lib._objc_msgSend_12(_id, _lib._sel_shouldResolveExternalEntities1); + } + + set shouldResolveExternalEntities(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setShouldResolveExternalEntities_1, value); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get lineNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_lineNumber1); + } + + int get columnNumber { + return _lib._objc_msgSend_78(_id, _lib._sel_columnNumber1); + } + + @override + NSXMLParser init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLParser._(_ret, _lib, retain: true, release: true); + } + + static NSXMLParser new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_new1); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static NSXMLParser allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSXMLParser1, _lib._sel_allocWithZone_1, zone); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static NSXMLParser alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLParser1, _lib._sel_alloc1); + return NSXMLParser._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSXMLParser1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSXMLParser1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLParser1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLParser1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLParser1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLParser1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSXMLParser1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSXMLParser1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLParser1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLParserExternalEntityResolvingPolicy { + static const int NSXMLParserResolveExternalEntitiesNever = 0; + static const int NSXMLParserResolveExternalEntitiesNoNetwork = 1; + static const int NSXMLParserResolveExternalEntitiesSameOriginOnly = 2; + static const int NSXMLParserResolveExternalEntitiesAlways = 3; +} + +class NSFileWrapper extends NSObject { + NSFileWrapper._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSFileWrapper] that points to the same underlying object as [other]. + static NSFileWrapper castFrom(T other) { + return NSFileWrapper._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSFileWrapper] that wraps the given raw object pointer. + static NSFileWrapper castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSFileWrapper._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSFileWrapper]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSFileWrapper1); + } + + NSFileWrapper initWithURL_options_error_( + NSURL? url, int options, ffi.Pointer> outError) { + final _ret = _lib._objc_msgSend_936( + _id, + _lib._sel_initWithURL_options_error_1, + url?._id ?? ffi.nullptr, + options, + outError); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initDirectoryWithFileWrappers_( + NSDictionary? childrenByPreferredName) { + final _ret = _lib._objc_msgSend_149( + _id, + _lib._sel_initDirectoryWithFileWrappers_1, + childrenByPreferredName?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initRegularFileWithContents_(NSData? contents) { + final _ret = _lib._objc_msgSend_257(_id, + _lib._sel_initRegularFileWithContents_1, contents?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initSymbolicLinkWithDestinationURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_241( + _id, + _lib._sel_initSymbolicLinkWithDestinationURL_1, + url?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initWithSerializedRepresentation_( + NSData? serializeRepresentation) { + final _ret = _lib._objc_msgSend_257( + _id, + _lib._sel_initWithSerializedRepresentation_1, + serializeRepresentation?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + NSFileWrapper initWithCoder_(NSCoder? inCoder) { + final _ret = _lib._objc_msgSend_42( + _id, _lib._sel_initWithCoder_1, inCoder?._id ?? ffi.nullptr); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + bool get directory { + return _lib._objc_msgSend_12(_id, _lib._sel_isDirectory1); + } + + bool get regularFile { + return _lib._objc_msgSend_12(_id, _lib._sel_isRegularFile1); + } + + bool get symbolicLink { + return _lib._objc_msgSend_12(_id, _lib._sel_isSymbolicLink1); + } + + NSString? get preferredFilename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_preferredFilename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set preferredFilename(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPreferredFilename_1, value?._id ?? ffi.nullptr); + } + + NSString? get filename { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_filename1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set filename(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setFilename_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get fileAttributes { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_fileAttributes1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set fileAttributes(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setFileAttributes_1, value?._id ?? ffi.nullptr); + } + + bool matchesContentsOfURL_(NSURL? url) { + return _lib._objc_msgSend_244( + _id, _lib._sel_matchesContentsOfURL_1, url?._id ?? ffi.nullptr); + } + + bool readFromURL_options_error_( + NSURL? url, int options, ffi.Pointer> outError) { + return _lib._objc_msgSend_937(_id, _lib._sel_readFromURL_options_error_1, + url?._id ?? ffi.nullptr, options, outError); + } + + bool writeToURL_options_originalContentsURL_error_( + NSURL? url, + int options, + NSURL? originalContentsURL, + ffi.Pointer> outError) { + return _lib._objc_msgSend_938( + _id, + _lib._sel_writeToURL_options_originalContentsURL_error_1, + url?._id ?? ffi.nullptr, + options, + originalContentsURL?._id ?? ffi.nullptr, + outError); + } + + NSData? get serializedRepresentation { + final _ret = + _lib._objc_msgSend_39(_id, _lib._sel_serializedRepresentation1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString addFileWrapper_(NSFileWrapper? child) { + final _ret = _lib._objc_msgSend_939( + _id, _lib._sel_addFileWrapper_1, child?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString addRegularFileWithContents_preferredFilename_( + NSData? data, NSString? fileName) { + final _ret = _lib._objc_msgSend_940( + _id, + _lib._sel_addRegularFileWithContents_preferredFilename_1, + data?._id ?? ffi.nullptr, + fileName?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void removeFileWrapper_(NSFileWrapper? child) { + _lib._objc_msgSend_941( + _id, _lib._sel_removeFileWrapper_1, child?._id ?? ffi.nullptr); + } + + NSDictionary? get fileWrappers { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_fileWrappers1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + NSString keyForFileWrapper_(NSFileWrapper? child) { + final _ret = _lib._objc_msgSend_939( + _id, _lib._sel_keyForFileWrapper_1, child?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSData? get regularFileContents { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_regularFileContents1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSURL? get symbolicLinkDestinationURL { + final _ret = + _lib._objc_msgSend_40(_id, _lib._sel_symbolicLinkDestinationURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + NSObject initWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithPath_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject initSymbolicLinkWithDestination_(NSString? path) { + final _ret = _lib._objc_msgSend_30(_id, + _lib._sel_initSymbolicLinkWithDestination_1, path?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool needsToBeUpdatedFromPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_needsToBeUpdatedFromPath_1, path?._id ?? ffi.nullptr); + } + + bool updateFromPath_(NSString? path) { + return _lib._objc_msgSend_59( + _id, _lib._sel_updateFromPath_1, path?._id ?? ffi.nullptr); + } + + bool writeToFile_atomically_updateFilenames_( + NSString? path, bool atomicFlag, bool updateFilenamesFlag) { + return _lib._objc_msgSend_942( + _id, + _lib._sel_writeToFile_atomically_updateFilenames_1, + path?._id ?? ffi.nullptr, + atomicFlag, + updateFilenamesFlag); + } + + NSString addFileWithPath_(NSString? path) { + final _ret = _lib._objc_msgSend_64( + _id, _lib._sel_addFileWithPath_1, path?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString addSymbolicLinkWithDestination_preferredFilename_( + NSString? path, NSString? filename) { + final _ret = _lib._objc_msgSend_339( + _id, + _lib._sel_addSymbolicLinkWithDestination_preferredFilename_1, + path?._id ?? ffi.nullptr, + filename?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString symbolicLinkDestination() { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_symbolicLinkDestination1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSFileWrapper init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSFileWrapper._(_ret, _lib, retain: true, release: true); + } + + static NSFileWrapper new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_new1); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static NSFileWrapper allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSFileWrapper1, _lib._sel_allocWithZone_1, zone); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static NSFileWrapper alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSFileWrapper1, _lib._sel_alloc1); + return NSFileWrapper._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSFileWrapper1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSFileWrapper1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileWrapper1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSFileWrapper1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSFileWrapper1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSFileWrapper1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSFileWrapper1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSFileWrapper1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSFileWrapper1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSFileWrapperReadingOptions { + static const int NSFileWrapperReadingImmediate = 1; + static const int NSFileWrapperReadingWithoutMapping = 2; +} + +abstract class NSFileWrapperWritingOptions { + static const int NSFileWrapperWritingAtomic = 1; + static const int NSFileWrapperWritingWithNameUpdating = 2; +} + +class NSURLSession extends NSObject { + NSURLSession._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSession] that points to the same underlying object as [other]. + static NSURLSession castFrom(T other) { + return NSURLSession._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSURLSession] that wraps the given raw object pointer. + static NSURLSession castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSession._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSession]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSURLSession1); + } + + static NSURLSession? getSharedSession(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_943( + _lib._class_NSURLSession1, _lib._sel_sharedSession1); + return _ret.address == 0 + ? null + : NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession sessionWithConfiguration_( + SentryCocoa _lib, NSURLSessionConfiguration? configuration) { + final _ret = _lib._objc_msgSend_954( + _lib._class_NSURLSession1, + _lib._sel_sessionWithConfiguration_1, + configuration?._id ?? ffi.nullptr); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( + SentryCocoa _lib, + NSURLSessionConfiguration? configuration, + NSObject? delegate, + NSOperationQueue? queue) { + final _ret = _lib._objc_msgSend_955( + _lib._class_NSURLSession1, + _lib._sel_sessionWithConfiguration_delegate_delegateQueue_1, + configuration?._id ?? ffi.nullptr, + delegate?._id ?? ffi.nullptr, + queue?._id ?? ffi.nullptr); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + NSOperationQueue? get delegateQueue { + final _ret = _lib._objc_msgSend_824(_id, _lib._sel_delegateQueue1); + return _ret.address == 0 + ? null + : NSOperationQueue._(_ret, _lib, retain: true, release: true); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionConfiguration? get configuration { + final _ret = _lib._objc_msgSend_944(_id, _lib._sel_configuration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + NSString? get sessionDescription { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sessionDescription1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set sessionDescription(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setSessionDescription_1, value?._id ?? ffi.nullptr); + } + + void finishTasksAndInvalidate() { + _lib._objc_msgSend_1(_id, _lib._sel_finishTasksAndInvalidate1); + } + + void invalidateAndCancel() { + _lib._objc_msgSend_1(_id, _lib._sel_invalidateAndCancel1); + } + + void resetWithCompletionHandler_(ObjCBlock_ffiVoid completionHandler) { + _lib._objc_msgSend_497( + _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._id); + } + + void flushWithCompletionHandler_(ObjCBlock_ffiVoid completionHandler) { + _lib._objc_msgSend_497( + _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._id); + } + + void getTasksWithCompletionHandler_( + ObjCBlock_ffiVoid_NSArray_NSArray_NSArray completionHandler) { + _lib._objc_msgSend_956( + _id, _lib._sel_getTasksWithCompletionHandler_1, completionHandler._id); + } + + void getAllTasksWithCompletionHandler_( + ObjCBlock_ffiVoid_NSArray completionHandler) { + _lib._objc_msgSend_957(_id, _lib._sel_getAllTasksWithCompletionHandler_1, + completionHandler._id); + } + + NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_958( + _id, _lib._sel_dataTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDataTask dataTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_959( + _id, _lib._sel_dataTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( + NSURLRequest? request, NSURL? fileURL) { + final _ret = _lib._objc_msgSend_960( + _id, + _lib._sel_uploadTaskWithRequest_fromFile_1, + request?._id ?? ffi.nullptr, + fileURL?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromData_( + NSURLRequest? request, NSData? bodyData) { + final _ret = _lib._objc_msgSend_961( + _id, + _lib._sel_uploadTaskWithRequest_fromData_1, + request?._id ?? ffi.nullptr, + bodyData?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_962(_id, + _lib._sel_uploadTaskWithStreamedRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_964( + _id, _lib._sel_downloadTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_965( + _id, _lib._sel_downloadTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithResumeData_(NSData? resumeData) { + final _ret = _lib._objc_msgSend_966(_id, + _lib._sel_downloadTaskWithResumeData_1, resumeData?._id ?? ffi.nullptr); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionStreamTask streamTaskWithHostName_port_( + NSString? hostname, int port) { + final _ret = _lib._objc_msgSend_969( + _id, + _lib._sel_streamTaskWithHostName_port_1, + hostname?._id ?? ffi.nullptr, + port); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionStreamTask streamTaskWithNetService_(NSNetService? service) { + final _ret = _lib._objc_msgSend_975( + _id, _lib._sel_streamTaskWithNetService_1, service?._id ?? ffi.nullptr); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithURL_(NSURL? url) { + final _ret = _lib._objc_msgSend_982( + _id, _lib._sel_webSocketTaskWithURL_1, url?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( + NSURL? url, NSArray? protocols) { + final _ret = _lib._objc_msgSend_983( + _id, + _lib._sel_webSocketTaskWithURL_protocols_1, + url?._id ?? ffi.nullptr, + protocols?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest? request) { + final _ret = _lib._objc_msgSend_984( + _id, _lib._sel_webSocketTaskWithRequest_1, request?._id ?? ffi.nullptr); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSession init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSession._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_new1); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + NSURLSessionDataTask dataTaskWithRequest_completionHandler_( + NSURLRequest? request, + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_985( + _id, + _lib._sel_dataTaskWithRequest_completionHandler_1, + request?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDataTask dataTaskWithURL_completionHandler_(NSURL? url, + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_986( + _id, + _lib._sel_dataTaskWithURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( + NSURLRequest? request, + NSURL? fileURL, + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_987( + _id, + _lib._sel_uploadTaskWithRequest_fromFile_completionHandler_1, + request?._id ?? ffi.nullptr, + fileURL?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( + NSURLRequest? request, + NSData? bodyData, + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_988( + _id, + _lib._sel_uploadTaskWithRequest_fromData_completionHandler_1, + request?._id ?? ffi.nullptr, + bodyData?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( + NSURLRequest? request, + ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_989( + _id, + _lib._sel_downloadTaskWithRequest_completionHandler_1, + request?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_(NSURL? url, + ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_990( + _id, + _lib._sel_downloadTaskWithURL_completionHandler_1, + url?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( + NSData? resumeData, + ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { + final _ret = _lib._objc_msgSend_991( + _id, + _lib._sel_downloadTaskWithResumeData_completionHandler_1, + resumeData?._id ?? ffi.nullptr, + completionHandler._id); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSession allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLSession1, _lib._sel_allocWithZone_1, zone); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + static NSURLSession alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_alloc1); + return NSURLSession._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSession1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSession1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSession1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSession1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSession1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSession1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLSession1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSession1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionConfiguration extends NSObject { + NSURLSessionConfiguration._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionConfiguration] that points to the same underlying object as [other]. + static NSURLSessionConfiguration castFrom(T other) { + return NSURLSessionConfiguration._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionConfiguration] that wraps the given raw object pointer. + static NSURLSessionConfiguration castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionConfiguration._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionConfiguration1); + } + + static NSURLSessionConfiguration? getDefaultSessionConfiguration( + SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_944(_lib._class_NSURLSessionConfiguration1, + _lib._sel_defaultSessionConfiguration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration? getEphemeralSessionConfiguration( + SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_944(_lib._class_NSURLSessionConfiguration1, + _lib._sel_ephemeralSessionConfiguration1); + return _ret.address == 0 + ? null + : NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration + backgroundSessionConfigurationWithIdentifier_( + SentryCocoa _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_945( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_backgroundSessionConfigurationWithIdentifier_1, + identifier?._id ?? ffi.nullptr); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + NSString? get identifier { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_identifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + int get requestCachePolicy { + return _lib._objc_msgSend_782(_id, _lib._sel_requestCachePolicy1); + } + + set requestCachePolicy(int value) { + return _lib._objc_msgSend_922( + _id, _lib._sel_setRequestCachePolicy_1, value); + } + + double get timeoutIntervalForRequest { + return _lib._objc_msgSend_155(_id, _lib._sel_timeoutIntervalForRequest1); + } + + set timeoutIntervalForRequest(double value) { + return _lib._objc_msgSend_506( + _id, _lib._sel_setTimeoutIntervalForRequest_1, value); + } + + double get timeoutIntervalForResource { + return _lib._objc_msgSend_155(_id, _lib._sel_timeoutIntervalForResource1); + } + + set timeoutIntervalForResource(double value) { + return _lib._objc_msgSend_506( + _id, _lib._sel_setTimeoutIntervalForResource_1, value); + } + + int get networkServiceType { + return _lib._objc_msgSend_783(_id, _lib._sel_networkServiceType1); + } + + set networkServiceType(int value) { + return _lib._objc_msgSend_923( + _id, _lib._sel_setNetworkServiceType_1, value); + } + + bool get allowsCellularAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsCellularAccess1); + } + + set allowsCellularAccess(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsCellularAccess_1, value); + } + + bool get allowsExpensiveNetworkAccess { + return _lib._objc_msgSend_12(_id, _lib._sel_allowsExpensiveNetworkAccess1); + } + + set allowsExpensiveNetworkAccess(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); + } + + bool get allowsConstrainedNetworkAccess { + return _lib._objc_msgSend_12( + _id, _lib._sel_allowsConstrainedNetworkAccess1); + } + + set allowsConstrainedNetworkAccess(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + } + + bool get requiresDNSSECValidation { + return _lib._objc_msgSend_12(_id, _lib._sel_requiresDNSSECValidation1); + } + + set requiresDNSSECValidation(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setRequiresDNSSECValidation_1, value); + } + + bool get waitsForConnectivity { + return _lib._objc_msgSend_12(_id, _lib._sel_waitsForConnectivity1); + } + + set waitsForConnectivity(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setWaitsForConnectivity_1, value); + } + + bool get discretionary { + return _lib._objc_msgSend_12(_id, _lib._sel_isDiscretionary1); + } + + set discretionary(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setDiscretionary_1, value); + } + + NSString? get sharedContainerIdentifier { + final _ret = + _lib._objc_msgSend_20(_id, _lib._sel_sharedContainerIdentifier1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set sharedContainerIdentifier(NSString? value) { + return _lib._objc_msgSend_509(_id, _lib._sel_setSharedContainerIdentifier_1, + value?._id ?? ffi.nullptr); + } + + bool get sessionSendsLaunchEvents { + return _lib._objc_msgSend_12(_id, _lib._sel_sessionSendsLaunchEvents1); + } + + set sessionSendsLaunchEvents(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setSessionSendsLaunchEvents_1, value); + } + + NSDictionary? get connectionProxyDictionary { + final _ret = + _lib._objc_msgSend_170(_id, _lib._sel_connectionProxyDictionary1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set connectionProxyDictionary(NSDictionary? value) { + return _lib._objc_msgSend_171(_id, _lib._sel_setConnectionProxyDictionary_1, + value?._id ?? ffi.nullptr); + } + + int get TLSMinimumSupportedProtocol { + return _lib._objc_msgSend_946(_id, _lib._sel_TLSMinimumSupportedProtocol1); + } + + set TLSMinimumSupportedProtocol(int value) { + return _lib._objc_msgSend_947( + _id, _lib._sel_setTLSMinimumSupportedProtocol_1, value); + } + + int get TLSMaximumSupportedProtocol { + return _lib._objc_msgSend_946(_id, _lib._sel_TLSMaximumSupportedProtocol1); + } + + set TLSMaximumSupportedProtocol(int value) { + return _lib._objc_msgSend_947( + _id, _lib._sel_setTLSMaximumSupportedProtocol_1, value); + } + + int get TLSMinimumSupportedProtocolVersion { + return _lib._objc_msgSend_948( + _id, _lib._sel_TLSMinimumSupportedProtocolVersion1); + } + + set TLSMinimumSupportedProtocolVersion(int value) { + return _lib._objc_msgSend_949( + _id, _lib._sel_setTLSMinimumSupportedProtocolVersion_1, value); + } + + int get TLSMaximumSupportedProtocolVersion { + return _lib._objc_msgSend_948( + _id, _lib._sel_TLSMaximumSupportedProtocolVersion1); + } + + set TLSMaximumSupportedProtocolVersion(int value) { + return _lib._objc_msgSend_949( + _id, _lib._sel_setTLSMaximumSupportedProtocolVersion_1, value); + } + + bool get HTTPShouldUsePipelining { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldUsePipelining1); + } + + set HTTPShouldUsePipelining(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setHTTPShouldUsePipelining_1, value); + } + + bool get HTTPShouldSetCookies { + return _lib._objc_msgSend_12(_id, _lib._sel_HTTPShouldSetCookies1); + } + + set HTTPShouldSetCookies(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setHTTPShouldSetCookies_1, value); + } + + int get HTTPCookieAcceptPolicy { + return _lib._objc_msgSend_779(_id, _lib._sel_HTTPCookieAcceptPolicy1); + } + + set HTTPCookieAcceptPolicy(int value) { + return _lib._objc_msgSend_780( + _id, _lib._sel_setHTTPCookieAcceptPolicy_1, value); + } + + NSDictionary? get HTTPAdditionalHeaders { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_HTTPAdditionalHeaders1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set HTTPAdditionalHeaders(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setHTTPAdditionalHeaders_1, value?._id ?? ffi.nullptr); + } + + int get HTTPMaximumConnectionsPerHost { + return _lib._objc_msgSend_78(_id, _lib._sel_HTTPMaximumConnectionsPerHost1); + } + + set HTTPMaximumConnectionsPerHost(int value) { + return _lib._objc_msgSend_590( + _id, _lib._sel_setHTTPMaximumConnectionsPerHost_1, value); + } + + NSHTTPCookieStorage? get HTTPCookieStorage { + final _ret = _lib._objc_msgSend_773(_id, _lib._sel_HTTPCookieStorage1); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + } + + set HTTPCookieStorage(NSHTTPCookieStorage? value) { + return _lib._objc_msgSend_950( + _id, _lib._sel_setHTTPCookieStorage_1, value?._id ?? ffi.nullptr); + } + + NSURLCredentialStorage? get URLCredentialStorage { + final _ret = _lib._objc_msgSend_908(_id, _lib._sel_URLCredentialStorage1); + return _ret.address == 0 + ? null + : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); + } + + set URLCredentialStorage(NSURLCredentialStorage? value) { + return _lib._objc_msgSend_951( + _id, _lib._sel_setURLCredentialStorage_1, value?._id ?? ffi.nullptr); + } + + NSURLCache? get URLCache { + final _ret = _lib._objc_msgSend_878(_id, _lib._sel_URLCache1); + return _ret.address == 0 + ? null + : NSURLCache._(_ret, _lib, retain: true, release: true); + } + + set URLCache(NSURLCache? value) { + return _lib._objc_msgSend_879( + _id, _lib._sel_setURLCache_1, value?._id ?? ffi.nullptr); + } + + bool get shouldUseExtendedBackgroundIdleMode { + return _lib._objc_msgSend_12( + _id, _lib._sel_shouldUseExtendedBackgroundIdleMode1); + } + + set shouldUseExtendedBackgroundIdleMode(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setShouldUseExtendedBackgroundIdleMode_1, value); + } + + NSArray? get protocolClasses { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_protocolClasses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set protocolClasses(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setProtocolClasses_1, value?._id ?? ffi.nullptr); + } + + int get multipathServiceType { + return _lib._objc_msgSend_952(_id, _lib._sel_multipathServiceType1); + } + + set multipathServiceType(int value) { + return _lib._objc_msgSend_953( + _id, _lib._sel_setMultipathServiceType_1, value); + } + + @override + NSURLSessionConfiguration init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionConfiguration1, _lib._sel_new1); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionConfiguration backgroundSessionConfiguration_( + SentryCocoa _lib, NSString? identifier) { + final _ret = _lib._objc_msgSend_945( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_backgroundSessionConfiguration_1, + identifier?._id ?? ffi.nullptr); + return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionConfiguration allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionConfiguration1, + _lib._sel_allocWithZone_1, zone); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionConfiguration alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionConfiguration1, _lib._sel_alloc1); + return NSURLSessionConfiguration._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionConfiguration1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionConfiguration1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionConfiguration1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionConfiguration1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionConfiguration1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionConfiguration1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class SSLProtocol { + static const int kSSLProtocolUnknown = 0; + static const int kTLSProtocol1 = 4; + static const int kTLSProtocol11 = 7; + static const int kTLSProtocol12 = 8; + static const int kDTLSProtocol1 = 9; + static const int kTLSProtocol13 = 10; + static const int kDTLSProtocol12 = 11; + static const int kTLSProtocolMaxSupported = 999; + static const int kSSLProtocol2 = 1; + static const int kSSLProtocol3 = 2; + static const int kSSLProtocol3Only = 3; + static const int kTLSProtocol1Only = 5; + static const int kSSLProtocolAll = 6; +} + +abstract class tls_protocol_version_t { + static const int tls_protocol_version_TLSv10 = 769; + static const int tls_protocol_version_TLSv11 = 770; + static const int tls_protocol_version_TLSv12 = 771; + static const int tls_protocol_version_TLSv13 = 772; + static const int tls_protocol_version_DTLSv10 = -257; + static const int tls_protocol_version_DTLSv12 = -259; +} + +abstract class NSURLSessionMultipathServiceType { + static const int NSURLSessionMultipathServiceTypeNone = 0; + static const int NSURLSessionMultipathServiceTypeHandover = 1; + static const int NSURLSessionMultipathServiceTypeInteractive = 2; + static const int NSURLSessionMultipathServiceTypeAggregate = 3; +} + +void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSArray_NSArray_NSArray._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSURLSessionUploadTask extends NSURLSessionDataTask { + NSURLSessionUploadTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionUploadTask] that points to the same underlying object as [other]. + static NSURLSessionUploadTask castFrom(T other) { + return NSURLSessionUploadTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionUploadTask] that wraps the given raw object pointer. + static NSURLSessionUploadTask castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionUploadTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionUploadTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionUploadTask1); + } + + @override + NSURLSessionUploadTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionUploadTask new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionUploadTask1, _lib._sel_new1); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionUploadTask allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLSessionUploadTask1, _lib._sel_allocWithZone_1, zone); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionUploadTask alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionUploadTask1, _lib._sel_alloc1); + return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionUploadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionUploadTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionUploadTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionUploadTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionUploadTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionUploadTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionDownloadTask extends NSURLSessionTask { + NSURLSessionDownloadTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. + static NSURLSessionDownloadTask castFrom(T other) { + return NSURLSessionDownloadTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionDownloadTask] that wraps the given raw object pointer. + static NSURLSessionDownloadTask castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionDownloadTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionDownloadTask1); + } + + void cancelByProducingResumeData_( + ObjCBlock_ffiVoid_NSData completionHandler) { + _lib._objc_msgSend_963( + _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._id); + } + + @override + NSURLSessionDownloadTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionDownloadTask new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_new1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDownloadTask allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_allocWithZone_1, zone); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionDownloadTask alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_alloc1); + return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionDownloadTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionDownloadTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionDownloadTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSData_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSData_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSData_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSData_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSData_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSData_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSData_closureRegistry[block.ref.target.address] + as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSData extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSData._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSData.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSData.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSData_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSData_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSURLSessionStreamTask extends NSURLSessionTask { + NSURLSessionStreamTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionStreamTask] that points to the same underlying object as [other]. + static NSURLSessionStreamTask castFrom(T other) { + return NSURLSessionStreamTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionStreamTask] that wraps the given raw object pointer. + static NSURLSessionStreamTask castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionStreamTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionStreamTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionStreamTask1); + } + + void readDataOfMinLength_maxLength_timeout_completionHandler_( + int minBytes, + int maxBytes, + double timeout, + ObjCBlock_ffiVoid_NSData_bool_NSError completionHandler) { + _lib._objc_msgSend_967( + _id, + _lib._sel_readDataOfMinLength_maxLength_timeout_completionHandler_1, + minBytes, + maxBytes, + timeout, + completionHandler._id); + } + + void writeData_timeout_completionHandler_(NSData? data, double timeout, + ObjCBlock_ffiVoid_NSError completionHandler) { + _lib._objc_msgSend_968(_id, _lib._sel_writeData_timeout_completionHandler_1, + data?._id ?? ffi.nullptr, timeout, completionHandler._id); + } + + void captureStreams() { + _lib._objc_msgSend_1(_id, _lib._sel_captureStreams1); + } + + void closeWrite() { + _lib._objc_msgSend_1(_id, _lib._sel_closeWrite1); + } + + void closeRead() { + _lib._objc_msgSend_1(_id, _lib._sel_closeRead1); + } + + void startSecureConnection() { + _lib._objc_msgSend_1(_id, _lib._sel_startSecureConnection1); + } + + void stopSecureConnection() { + _lib._objc_msgSend_1(_id, _lib._sel_stopSecureConnection1); + } + + @override + NSURLSessionStreamTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionStreamTask new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionStreamTask1, _lib._sel_new1); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionStreamTask allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSURLSessionStreamTask1, _lib._sel_allocWithZone_1, zone); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static NSURLSessionStreamTask alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionStreamTask1, _lib._sel_alloc1); + return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionStreamTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionStreamTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionStreamTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionStreamTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionStreamTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionStreamTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( + Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, bool, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSData_bool_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSData_bool_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSData_bool_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSData_bool_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call( + ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSNetService extends NSObject { + NSNetService._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSNetService] that points to the same underlying object as [other]. + static NSNetService castFrom(T other) { + return NSNetService._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSNetService] that wraps the given raw object pointer. + static NSNetService castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSNetService._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSNetService]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSNetService1); + } + + NSNetService initWithDomain_type_name_port_( + NSString? domain, NSString? type, NSString? name, int port) { + final _ret = _lib._objc_msgSend_970( + _id, + _lib._sel_initWithDomain_type_name_port_1, + domain?._id ?? ffi.nullptr, + type?._id ?? ffi.nullptr, + name?._id ?? ffi.nullptr, + port); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + NSNetService initWithDomain_type_name_( + NSString? domain, NSString? type, NSString? name) { + final _ret = _lib._objc_msgSend_26( + _id, + _lib._sel_initWithDomain_type_name_1, + domain?._id ?? ffi.nullptr, + type?._id ?? ffi.nullptr, + name?._id ?? ffi.nullptr); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + void scheduleInRunLoop_forMode_(NSRunLoop? aRunLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_scheduleInRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode._id); + } + + void removeFromRunLoop_forMode_(NSRunLoop? aRunLoop, NSString mode) { + _lib._objc_msgSend_533(_id, _lib._sel_removeFromRunLoop_forMode_1, + aRunLoop?._id ?? ffi.nullptr, mode._id); + } + + NSObject? get delegate { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_delegate1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + set delegate(NSObject? value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); + } + + bool get includesPeerToPeer { + return _lib._objc_msgSend_12(_id, _lib._sel_includesPeerToPeer1); + } + + set includesPeerToPeer(bool value) { + return _lib._objc_msgSend_492( + _id, _lib._sel_setIncludesPeerToPeer_1, value); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get type { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_type1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get domain { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_domain1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get hostName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_hostName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray? get addresses { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_addresses1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + int get port { + return _lib._objc_msgSend_78(_id, _lib._sel_port1); + } + + void publish() { + _lib._objc_msgSend_1(_id, _lib._sel_publish1); + } + + void publishWithOptions_(int options) { + _lib._objc_msgSend_971(_id, _lib._sel_publishWithOptions_1, options); + } + + void resolve() { + _lib._objc_msgSend_1(_id, _lib._sel_resolve1); + } + + void stop() { + _lib._objc_msgSend_1(_id, _lib._sel_stop1); + } + + static NSDictionary dictionaryFromTXTRecordData_( + SentryCocoa _lib, NSData? txtData) { + final _ret = _lib._objc_msgSend_972(_lib._class_NSNetService1, + _lib._sel_dictionaryFromTXTRecordData_1, txtData?._id ?? ffi.nullptr); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + static NSData dataFromTXTRecordDictionary_( + SentryCocoa _lib, NSDictionary? txtDictionary) { + final _ret = _lib._objc_msgSend_973( + _lib._class_NSNetService1, + _lib._sel_dataFromTXTRecordDictionary_1, + txtDictionary?._id ?? ffi.nullptr); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void resolveWithTimeout_(double timeout) { + _lib._objc_msgSend_505(_id, _lib._sel_resolveWithTimeout_1, timeout); + } + + bool getInputStream_outputStream_( + ffi.Pointer> inputStream, + ffi.Pointer> outputStream) { + return _lib._objc_msgSend_974(_id, _lib._sel_getInputStream_outputStream_1, + inputStream, outputStream); + } + + bool setTXTRecordData_(NSData? recordData) { + return _lib._objc_msgSend_23( + _id, _lib._sel_setTXTRecordData_1, recordData?._id ?? ffi.nullptr); + } + + NSData TXTRecordData() { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_TXTRecordData1); + return NSData._(_ret, _lib, retain: true, release: true); + } + + void startMonitoring() { + _lib._objc_msgSend_1(_id, _lib._sel_startMonitoring1); + } + + void stopMonitoring() { + _lib._objc_msgSend_1(_id, _lib._sel_stopMonitoring1); + } + + @override + NSNetService init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSNetService._(_ret, _lib, retain: true, release: true); + } + + static NSNetService new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_new1); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static NSNetService allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSNetService1, _lib._sel_allocWithZone_1, zone); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static NSNetService alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSNetService1, _lib._sel_alloc1); + return NSNetService._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSNetService1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSNetService1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNetService1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSNetService1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSNetService1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSNetService1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSNetService1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSNetService1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSNetService1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSNetServiceOptions { + static const int NSNetServiceNoAutoRename = 1; + static const int NSNetServiceListenForConnections = 2; +} + +class NSURLSessionWebSocketTask extends NSURLSessionTask { + NSURLSessionWebSocketTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. + static NSURLSessionWebSocketTask castFrom(T other) { + return NSURLSessionWebSocketTask._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. + static NSURLSessionWebSocketTask castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionWebSocketTask._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionWebSocketTask1); + } + + void sendMessage_completionHandler_(NSURLSessionWebSocketMessage? message, + ObjCBlock_ffiVoid_NSError completionHandler) { + _lib._objc_msgSend_977(_id, _lib._sel_sendMessage_completionHandler_1, + message?._id ?? ffi.nullptr, completionHandler._id); + } + + void receiveMessageWithCompletionHandler_( + ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError + completionHandler) { + _lib._objc_msgSend_978(_id, _lib._sel_receiveMessageWithCompletionHandler_1, + completionHandler._id); + } + + void sendPingWithPongReceiveHandler_( + ObjCBlock_ffiVoid_NSError pongReceiveHandler) { + _lib._objc_msgSend_979(_id, _lib._sel_sendPingWithPongReceiveHandler_1, + pongReceiveHandler._id); + } + + void cancelWithCloseCode_reason_(int closeCode, NSData? reason) { + _lib._objc_msgSend_980(_id, _lib._sel_cancelWithCloseCode_reason_1, + closeCode, reason?._id ?? ffi.nullptr); + } + + int get maximumMessageSize { + return _lib._objc_msgSend_78(_id, _lib._sel_maximumMessageSize1); + } + + set maximumMessageSize(int value) { + return _lib._objc_msgSend_590( + _id, _lib._sel_setMaximumMessageSize_1, value); + } + + int get closeCode { + return _lib._objc_msgSend_981(_id, _lib._sel_closeCode1); + } + + NSData? get closeReason { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_closeReason1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSessionWebSocketTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); + } + + static NSURLSessionWebSocketTask new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_new1); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketTask allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_allocWithZone_1, zone); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketTask alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_alloc1); + return NSURLSessionWebSocketTask._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSURLSessionWebSocketTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionWebSocketTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketTask1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSURLSessionWebSocketMessage extends NSObject { + NSURLSessionWebSocketMessage._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. + static NSURLSessionWebSocketMessage castFrom( + T other) { + return NSURLSessionWebSocketMessage._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. + static NSURLSessionWebSocketMessage castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSURLSessionWebSocketMessage._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSURLSessionWebSocketMessage1); + } + + NSURLSessionWebSocketMessage initWithData_(NSData? data) { + final _ret = _lib._objc_msgSend_257( + _id, _lib._sel_initWithData_1, data?._id ?? ffi.nullptr); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + NSURLSessionWebSocketMessage initWithString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithString_1, string?._id ?? ffi.nullptr); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + int get type { + return _lib._objc_msgSend_976(_id, _lib._sel_type1); + } + + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSString? get string { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_string1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + @override + NSURLSessionWebSocketMessage init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: true, release: true); + } + + static NSURLSessionWebSocketMessage new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_new1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketMessage allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_allocWithZone_1, zone); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static NSURLSessionWebSocketMessage alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_alloc1); + return NSURLSessionWebSocketMessage._(_ret, _lib, + retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSURLSessionWebSocketMessage1, + _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSURLSessionWebSocketMessageType { + static const int NSURLSessionWebSocketMessageTypeData = 0; + static const int NSURLSessionWebSocketMessageTypeString = 1; +} + +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>()(arg0, arg1); +} + +final _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistryIndex = + 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry[id] = + fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + return (_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry[ + block.ref.target.address] + as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +} + +class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError + extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1)>()(_id, arg0, arg1); + } +} + +abstract class NSURLSessionWebSocketCloseCode { + static const int NSURLSessionWebSocketCloseCodeInvalid = 0; + static const int NSURLSessionWebSocketCloseCodeNormalClosure = 1000; + static const int NSURLSessionWebSocketCloseCodeGoingAway = 1001; + static const int NSURLSessionWebSocketCloseCodeProtocolError = 1002; + static const int NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; + static const int NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; + static const int NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; + static const int NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; + static const int NSURLSessionWebSocketCloseCodePolicyViolation = 1008; + static const int NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; + static const int NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = + 1010; + static const int NSURLSessionWebSocketCloseCodeInternalServerError = 1011; + static const int NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; +} + +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(arg0, arg1, arg2); +} + +final _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure( + Function fn) { + final id = + ++_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + return (_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry[ + block.ref.target.address] + as void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +} + +class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.fromFunction( + SentryCocoa lib, + void Function(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) + fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>()(_id, arg0, arg1, arg2); + } +} + +class NSProtocolChecker extends NSProxy { + NSProtocolChecker._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSProtocolChecker] that points to the same underlying object as [other]. + static NSProtocolChecker castFrom(T other) { + return NSProtocolChecker._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [NSProtocolChecker] that wraps the given raw object pointer. + static NSProtocolChecker castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSProtocolChecker._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSProtocolChecker]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_NSProtocolChecker1); + } + + Protocol? get protocol { + final _ret = _lib._objc_msgSend_992(_id, _lib._sel_protocol1); + return _ret.address == 0 + ? null + : Protocol._(_ret, _lib, retain: true, release: true); + } + + NSObject? get target { + final _ret = _lib._objc_msgSend_822(_id, _lib._sel_target1); + return _ret.address == 0 + ? null + : NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSProtocolChecker protocolCheckerWithTarget_protocol_( + SentryCocoa _lib, NSObject? anObject, Protocol? aProtocol) { + final _ret = _lib._objc_msgSend_993( + _lib._class_NSProtocolChecker1, + _lib._sel_protocolCheckerWithTarget_protocol_1, + anObject?._id ?? ffi.nullptr, + aProtocol?._id ?? ffi.nullptr); + return NSProtocolChecker._(_ret, _lib, retain: true, release: true); + } + + NSProtocolChecker initWithTarget_protocol_( + NSObject? anObject, Protocol? aProtocol) { + final _ret = _lib._objc_msgSend_993( + _id, + _lib._sel_initWithTarget_protocol_1, + anObject?._id ?? ffi.nullptr, + aProtocol?._id ?? ffi.nullptr); + return NSProtocolChecker._(_ret, _lib, retain: true, release: true); + } + + static NSObject alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSProtocolChecker1, _lib._sel_alloc1); + return NSObject._(_ret, _lib, retain: false, release: true); + } + + static bool respondsToSelector_( + SentryCocoa _lib, ffi.Pointer aSelector) { + return _lib._objc_msgSend_4(_lib._class_NSProtocolChecker1, + _lib._sel_respondsToSelector_1, aSelector); + } +} + +class NSTask extends NSObject { + NSTask._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSTask] that points to the same underlying object as [other]. + static NSTask castFrom(T other) { + return NSTask._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSTask] that wraps the given raw object pointer. + static NSTask castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSTask._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSTask]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSTask1); + } + + @override + NSTask init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + NSURL? get executableURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_executableURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set executableURL(NSURL? value) { + return _lib._objc_msgSend_621( + _id, _lib._sel_setExecutableURL_1, value?._id ?? ffi.nullptr); + } + + NSArray? get arguments { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_arguments1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set arguments(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setArguments_1, value?._id ?? ffi.nullptr); + } + + NSDictionary? get environment { + final _ret = _lib._objc_msgSend_170(_id, _lib._sel_environment1); + return _ret.address == 0 + ? null + : NSDictionary._(_ret, _lib, retain: true, release: true); + } + + set environment(NSDictionary? value) { + return _lib._objc_msgSend_171( + _id, _lib._sel_setEnvironment_1, value?._id ?? ffi.nullptr); + } + + NSURL? get currentDirectoryURL { + final _ret = _lib._objc_msgSend_40(_id, _lib._sel_currentDirectoryURL1); + return _ret.address == 0 + ? null + : NSURL._(_ret, _lib, retain: true, release: true); + } + + set currentDirectoryURL(NSURL? value) { + return _lib._objc_msgSend_621( + _id, _lib._sel_setCurrentDirectoryURL_1, value?._id ?? ffi.nullptr); + } + + NSObject get standardInput { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardInput1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardInput(NSObject value) { + return _lib._objc_msgSend_387(_id, _lib._sel_setStandardInput_1, value._id); + } + + NSObject get standardOutput { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardOutput1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardOutput(NSObject value) { + return _lib._objc_msgSend_387( + _id, _lib._sel_setStandardOutput_1, value._id); + } + + NSObject get standardError { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_standardError1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set standardError(NSObject value) { + return _lib._objc_msgSend_387(_id, _lib._sel_setStandardError_1, value._id); + } + + bool launchAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_225(_id, _lib._sel_launchAndReturnError_1, error); + } + + void interrupt() { + _lib._objc_msgSend_1(_id, _lib._sel_interrupt1); + } + + void terminate() { + _lib._objc_msgSend_1(_id, _lib._sel_terminate1); + } + + bool suspend() { + return _lib._objc_msgSend_12(_id, _lib._sel_suspend1); + } + + bool resume() { + return _lib._objc_msgSend_12(_id, _lib._sel_resume1); + } + + int get processIdentifier { + return _lib._objc_msgSend_219(_id, _lib._sel_processIdentifier1); + } + + bool get running { + return _lib._objc_msgSend_12(_id, _lib._sel_isRunning1); + } + + int get terminationStatus { + return _lib._objc_msgSend_219(_id, _lib._sel_terminationStatus1); + } + + int get terminationReason { + return _lib._objc_msgSend_994(_id, _lib._sel_terminationReason1); + } + + ObjCBlock_ffiVoid_NSTask get terminationHandler { + final _ret = _lib._objc_msgSend_995(_id, _lib._sel_terminationHandler1); + return ObjCBlock_ffiVoid_NSTask._(_ret, _lib); + } + + set terminationHandler(ObjCBlock_ffiVoid_NSTask value) { + return _lib._objc_msgSend_996( + _id, _lib._sel_setTerminationHandler_1, value._id); + } + + int get qualityOfService { + return _lib._objc_msgSend_507(_id, _lib._sel_qualityOfService1); + } + + set qualityOfService(int value) { + return _lib._objc_msgSend_508(_id, _lib._sel_setQualityOfService_1, value); + } + + static NSTask + launchedTaskWithExecutableURL_arguments_error_terminationHandler_( + SentryCocoa _lib, + NSURL? url, + NSArray? arguments, + ffi.Pointer> error, + ObjCBlock_ffiVoid_NSTask terminationHandler) { + final _ret = _lib._objc_msgSend_997( + _lib._class_NSTask1, + _lib._sel_launchedTaskWithExecutableURL_arguments_error_terminationHandler_1, + url?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error, + terminationHandler._id); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + void waitUntilExit() { + _lib._objc_msgSend_1(_id, _lib._sel_waitUntilExit1); + } + + NSString? get launchPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_launchPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set launchPath(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setLaunchPath_1, value?._id ?? ffi.nullptr); + } + + NSString? get currentDirectoryPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_currentDirectoryPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set currentDirectoryPath(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setCurrentDirectoryPath_1, value?._id ?? ffi.nullptr); + } + + void launch() { + _lib._objc_msgSend_1(_id, _lib._sel_launch1); + } + + static NSTask launchedTaskWithLaunchPath_arguments_( + SentryCocoa _lib, NSString? path, NSArray? arguments) { + final _ret = _lib._objc_msgSend_998( + _lib._class_NSTask1, + _lib._sel_launchedTaskWithLaunchPath_arguments_1, + path?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr); + return NSTask._(_ret, _lib, retain: true, release: true); + } + + static NSTask new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_new1); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static NSTask allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSTask1, _lib._sel_allocWithZone_1, zone); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static NSTask alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSTask1, _lib._sel_alloc1); + return NSTask._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSTask1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTask1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSTask1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSTask1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSTask1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSTask1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSTask1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSTask1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSTaskTerminationReason { + static const int NSTaskTerminationReasonExit = 1; + static const int NSTaskTerminationReasonUncaughtSignal = 2; +} + +void _ObjCBlock_ffiVoid_NSTask_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_NSTask_closureRegistry = {}; +int _ObjCBlock_ffiVoid_NSTask_closureRegistryIndex = 0; +ffi.Pointer _ObjCBlock_ffiVoid_NSTask_registerClosure(Function fn) { + final id = ++_ObjCBlock_ffiVoid_NSTask_closureRegistryIndex; + _ObjCBlock_ffiVoid_NSTask_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_NSTask_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_NSTask_closureRegistry[block.ref.target.address] + as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_NSTask extends _ObjCBlockBase { + ObjCBlock_ffiVoid_NSTask._(ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_NSTask.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSTask_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_NSTask.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_NSTask_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_NSTask_registerClosure(fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class NSXMLElement extends NSXMLNode { + NSXMLElement._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLElement] that points to the same underlying object as [other]. + static NSXMLElement castFrom(T other) { + return NSXMLElement._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLElement] that wraps the given raw object pointer. + static NSXMLElement castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLElement._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLElement]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLElement1); + } + + NSXMLElement initWithName_(NSString? name) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithName_1, name?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithName_URI_(NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_165(_id, _lib._sel_initWithName_URI_1, + name?._id ?? ffi.nullptr, URI?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithName_stringValue_(NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_165( + _id, + _lib._sel_initWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSXMLElement initWithXMLString_error_( + NSString? string, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_279(_id, + _lib._sel_initWithXMLString_error_1, string?._id ?? ffi.nullptr, error); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLElement initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_1000( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + NSArray elementsForName_(NSString? name) { + final _ret = _lib._objc_msgSend_123( + _id, _lib._sel_elementsForName_1, name?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray elementsForLocalName_URI_(NSString? localName, NSString? URI) { + final _ret = _lib._objc_msgSend_652( + _id, + _lib._sel_elementsForLocalName_URI_1, + localName?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + void addAttribute_(NSXMLNode? attribute) { + _lib._objc_msgSend_1012( + _id, _lib._sel_addAttribute_1, attribute?._id ?? ffi.nullptr); + } + + void removeAttributeForName_(NSString? name) { + _lib._objc_msgSend_192( + _id, _lib._sel_removeAttributeForName_1, name?._id ?? ffi.nullptr); + } + + NSArray? get attributes { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_attributes1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set attributes(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setAttributes_1, value?._id ?? ffi.nullptr); + } + + void setAttributesWithDictionary_(NSDictionary? attributes) { + _lib._objc_msgSend_476(_id, _lib._sel_setAttributesWithDictionary_1, + attributes?._id ?? ffi.nullptr); + } + + NSXMLNode attributeForName_(NSString? name) { + final _ret = _lib._objc_msgSend_1016( + _id, _lib._sel_attributeForName_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode attributeForLocalName_URI_(NSString? localName, NSString? URI) { + final _ret = _lib._objc_msgSend_1033( + _id, + _lib._sel_attributeForLocalName_URI_1, + localName?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + void addNamespace_(NSXMLNode? aNamespace) { + _lib._objc_msgSend_1012( + _id, _lib._sel_addNamespace_1, aNamespace?._id ?? ffi.nullptr); + } + + void removeNamespaceForPrefix_(NSString? name) { + _lib._objc_msgSend_192( + _id, _lib._sel_removeNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + } + + NSArray? get namespaces { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_namespaces1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + set namespaces(NSArray? value) { + return _lib._objc_msgSend_731( + _id, _lib._sel_setNamespaces_1, value?._id ?? ffi.nullptr); + } + + NSXMLNode namespaceForPrefix_(NSString? name) { + final _ret = _lib._objc_msgSend_1016( + _id, _lib._sel_namespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode resolveNamespaceForName_(NSString? name) { + final _ret = _lib._objc_msgSend_1016( + _id, _lib._sel_resolveNamespaceForName_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSString resolvePrefixForNamespaceURI_(NSString? namespaceURI) { + final _ret = _lib._objc_msgSend_64( + _id, + _lib._sel_resolvePrefixForNamespaceURI_1, + namespaceURI?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + _lib._objc_msgSend_1010( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + _lib._objc_msgSend_1011(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + _lib._objc_msgSend_439(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + _lib._objc_msgSend_441( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + _lib._objc_msgSend_1012( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + _lib._objc_msgSend_1013(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + void normalizeAdjacentTextNodesPreservingCDATA_(bool preserve) { + _lib._objc_msgSend_790( + _id, _lib._sel_normalizeAdjacentTextNodesPreservingCDATA_1, preserve); + } + + void setAttributesAsDictionary_(NSDictionary? attributes) { + _lib._objc_msgSend_476(_id, _lib._sel_setAttributesAsDictionary_1, + attributes?._id ?? ffi.nullptr); + } + + @override + NSXMLElement init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLElement initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_999(_id, _lib._sel_initWithKind_1, kind); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SentryCocoa _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_1001(_lib._class_NSXMLElement1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SentryCocoa _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SentryCocoa _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_1002( + _lib._class_NSXMLElement1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLElement1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SentryCocoa _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLElement1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLElement1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLElement1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLElement1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLElement1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLElement1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_1016(_lib._class_NSXMLElement1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLElement new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_new1); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static NSXMLElement allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSXMLElement1, _lib._sel_allocWithZone_1, zone); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static NSXMLElement alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLElement1, _lib._sel_alloc1); + return NSXMLElement._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSXMLElement1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSXMLElement1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLElement1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLElement1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLElement1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLElement1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSXMLElement1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSXMLElement1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLElement1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLNode extends NSObject { + NSXMLNode._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLNode] that points to the same underlying object as [other]. + static NSXMLNode castFrom(T other) { + return NSXMLNode._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLNode] that wraps the given raw object pointer. + static NSXMLNode castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLNode._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLNode]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLNode1); + } + + @override + NSXMLNode init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_999(_id, _lib._sel_initWithKind_1, kind); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_1000( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SentryCocoa _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_1001(_lib._class_NSXMLNode1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SentryCocoa _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SentryCocoa _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_1002( + _lib._class_NSXMLNode1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLNode1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SentryCocoa _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLNode1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLNode1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLNode1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLNode1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + int get kind { + return _lib._objc_msgSend_1003(_id, _lib._sel_kind1); + } + + NSString? get name { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_name1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set name(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); + } + + NSObject get objectValue { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_objectValue1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + set objectValue(NSObject value) { + return _lib._objc_msgSend_387(_id, _lib._sel_setObjectValue_1, value._id); + } + + NSString? get stringValue { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_stringValue1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set stringValue(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setStringValue_1, value?._id ?? ffi.nullptr); + } + + void setStringValue_resolvingEntities_(NSString? string, bool resolve) { + _lib._objc_msgSend_1004(_id, _lib._sel_setStringValue_resolvingEntities_1, + string?._id ?? ffi.nullptr, resolve); + } + + int get index { + return _lib._objc_msgSend_10(_id, _lib._sel_index1); + } + + int get level { + return _lib._objc_msgSend_10(_id, _lib._sel_level1); + } + + NSXMLDocument? get rootDocument { + final _ret = _lib._objc_msgSend_1027(_id, _lib._sel_rootDocument1); + return _ret.address == 0 + ? null + : NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get parent { + final _ret = _lib._objc_msgSend_1028(_id, _lib._sel_parent1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + int get childCount { + return _lib._objc_msgSend_10(_id, _lib._sel_childCount1); + } + + NSArray? get children { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_children1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode childAtIndex_(int index) { + final _ret = _lib._objc_msgSend_1029(_id, _lib._sel_childAtIndex_1, index); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get previousSibling { + final _ret = _lib._objc_msgSend_1028(_id, _lib._sel_previousSibling1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get nextSibling { + final _ret = _lib._objc_msgSend_1028(_id, _lib._sel_nextSibling1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get previousNode { + final _ret = _lib._objc_msgSend_1028(_id, _lib._sel_previousNode1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLNode? get nextNode { + final _ret = _lib._objc_msgSend_1028(_id, _lib._sel_nextNode1); + return _ret.address == 0 + ? null + : NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + void detach() { + _lib._objc_msgSend_1(_id, _lib._sel_detach1); + } + + NSString? get XPath { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_XPath1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get localName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_localName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get prefix { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_prefix1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get URI { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_URI1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set URI(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setURI_1, value?._id ?? ffi.nullptr); + } + + static NSString localNameForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLNode1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLNode1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_1016(_lib._class_NSXMLNode1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + NSString? get description { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_description1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString? get XMLString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_XMLString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + NSString XMLStringWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_1030(_id, _lib._sel_XMLStringWithOptions_1, options); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSString canonicalXMLStringPreservingComments_(bool comments) { + final _ret = _lib._objc_msgSend_1031( + _id, _lib._sel_canonicalXMLStringPreservingComments_1, comments); + return NSString._(_ret, _lib, retain: true, release: true); + } + + NSArray nodesForXPath_error_( + NSString? xpath, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_414( + _id, _lib._sel_nodesForXPath_error_1, xpath?._id ?? ffi.nullptr, error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForXQuery_constants_error_(NSString? xquery, + NSDictionary? constants, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1032( + _id, + _lib._sel_objectsForXQuery_constants_error_1, + xquery?._id ?? ffi.nullptr, + constants?._id ?? ffi.nullptr, + error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + NSArray objectsForXQuery_error_( + NSString? xquery, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_414(_id, _lib._sel_objectsForXQuery_error_1, + xquery?._id ?? ffi.nullptr, error); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_new1); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLNode allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSXMLNode1, _lib._sel_allocWithZone_1, zone); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLNode alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLNode1, _lib._sel_alloc1); + return NSXMLNode._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSXMLNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSXMLNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLNode1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLNode1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLNode1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLNode1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSXMLNode1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSXMLNode1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLNode1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLNodeKind { + static const int NSXMLInvalidKind = 0; + static const int NSXMLDocumentKind = 1; + static const int NSXMLElementKind = 2; + static const int NSXMLAttributeKind = 3; + static const int NSXMLNamespaceKind = 4; + static const int NSXMLProcessingInstructionKind = 5; + static const int NSXMLCommentKind = 6; + static const int NSXMLTextKind = 7; + static const int NSXMLDTDKind = 8; + static const int NSXMLEntityDeclarationKind = 9; + static const int NSXMLAttributeDeclarationKind = 10; + static const int NSXMLElementDeclarationKind = 11; + static const int NSXMLNotationDeclarationKind = 12; +} + +abstract class NSXMLNodeOptions { + static const int NSXMLNodeOptionsNone = 0; + static const int NSXMLNodeIsCDATA = 1; + static const int NSXMLNodeExpandEmptyElement = 2; + static const int NSXMLNodeCompactEmptyElement = 4; + static const int NSXMLNodeUseSingleQuotes = 8; + static const int NSXMLNodeUseDoubleQuotes = 16; + static const int NSXMLNodeNeverEscapeContents = 32; + static const int NSXMLDocumentTidyHTML = 512; + static const int NSXMLDocumentTidyXML = 1024; + static const int NSXMLDocumentValidate = 8192; + static const int NSXMLNodeLoadExternalEntitiesAlways = 16384; + static const int NSXMLNodeLoadExternalEntitiesSameOriginOnly = 32768; + static const int NSXMLNodeLoadExternalEntitiesNever = 524288; + static const int NSXMLDocumentXInclude = 65536; + static const int NSXMLNodePrettyPrint = 131072; + static const int NSXMLDocumentIncludeContentTypeDeclaration = 262144; + static const int NSXMLNodePreserveNamespaceOrder = 1048576; + static const int NSXMLNodePreserveAttributeOrder = 2097152; + static const int NSXMLNodePreserveEntities = 4194304; + static const int NSXMLNodePreservePrefixes = 8388608; + static const int NSXMLNodePreserveCDATA = 16777216; + static const int NSXMLNodePreserveWhitespace = 33554432; + static const int NSXMLNodePreserveDTD = 67108864; + static const int NSXMLNodePreserveCharacterReferences = 134217728; + static const int NSXMLNodePromoteSignificantWhitespace = 268435456; + static const int NSXMLNodePreserveEmptyElements = 6; + static const int NSXMLNodePreserveQuotes = 24; + static const int NSXMLNodePreserveAll = 4293918750; +} + +class NSXMLDocument extends NSXMLNode { + NSXMLDocument._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDocument] that points to the same underlying object as [other]. + static NSXMLDocument castFrom(T other) { + return NSXMLDocument._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDocument] that wraps the given raw object pointer. + static NSXMLDocument castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDocument._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDocument]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDocument1); + } + + @override + NSXMLDocument init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithXMLString_options_error_( + NSString? string, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1005( + _id, + _lib._sel_initWithXMLString_options_error_1, + string?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithContentsOfURL_options_error_( + NSURL? url, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1006( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithData_options_error_( + NSData? data, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1007( + _id, + _lib._sel_initWithData_options_error_1, + data?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + NSXMLDocument initWithRootElement_(NSXMLElement? element) { + final _ret = _lib._objc_msgSend_1001( + _id, _lib._sel_initWithRootElement_1, element?._id ?? ffi.nullptr); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + static NSObject replacementClassForClass_(SentryCocoa _lib, NSObject cls) { + final _ret = _lib._objc_msgSend_16(_lib._class_NSXMLDocument1, + _lib._sel_replacementClassForClass_1, cls._id); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSString? get characterEncoding { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_characterEncoding1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set characterEncoding(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setCharacterEncoding_1, value?._id ?? ffi.nullptr); + } + + NSString? get version { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_version1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set version(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setVersion_1, value?._id ?? ffi.nullptr); + } + + bool get standalone { + return _lib._objc_msgSend_12(_id, _lib._sel_isStandalone1); + } + + set standalone(bool value) { + return _lib._objc_msgSend_492(_id, _lib._sel_setStandalone_1, value); + } + + int get documentContentKind { + return _lib._objc_msgSend_1008(_id, _lib._sel_documentContentKind1); + } + + set documentContentKind(int value) { + return _lib._objc_msgSend_1009( + _id, _lib._sel_setDocumentContentKind_1, value); + } + + NSString? get MIMEType { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_MIMEType1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set MIMEType(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setMIMEType_1, value?._id ?? ffi.nullptr); + } + + NSXMLDTD? get DTD { + final _ret = _lib._objc_msgSend_1019(_id, _lib._sel_DTD1); + return _ret.address == 0 + ? null + : NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + set DTD(NSXMLDTD? value) { + return _lib._objc_msgSend_1020( + _id, _lib._sel_setDTD_1, value?._id ?? ffi.nullptr); + } + + void setRootElement_(NSXMLElement? root) { + _lib._objc_msgSend_1021( + _id, _lib._sel_setRootElement_1, root?._id ?? ffi.nullptr); + } + + NSXMLElement rootElement() { + final _ret = _lib._objc_msgSend_1022(_id, _lib._sel_rootElement1); + return NSXMLElement._(_ret, _lib, retain: true, release: true); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + _lib._objc_msgSend_1010( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + _lib._objc_msgSend_1011(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + _lib._objc_msgSend_439(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + _lib._objc_msgSend_441( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + _lib._objc_msgSend_1012( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + _lib._objc_msgSend_1013(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + NSData? get XMLData { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_XMLData1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + NSData XMLDataWithOptions_(int options) { + final _ret = + _lib._objc_msgSend_1023(_id, _lib._sel_XMLDataWithOptions_1, options); + return NSData._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLT_arguments_error_(NSData? xslt, + NSDictionary? arguments, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1024( + _id, + _lib._sel_objectByApplyingXSLT_arguments_error_1, + xslt?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLTString_arguments_error_(NSString? xslt, + NSDictionary? arguments, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1025( + _id, + _lib._sel_objectByApplyingXSLTString_arguments_error_1, + xslt?._id ?? ffi.nullptr, + arguments?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + NSObject objectByApplyingXSLTAtURL_arguments_error_(NSURL? xsltURL, + NSDictionary? argument, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1026( + _id, + _lib._sel_objectByApplyingXSLTAtURL_arguments_error_1, + xsltURL?._id ?? ffi.nullptr, + argument?._id ?? ffi.nullptr, + error); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + bool validateAndReturnError_(ffi.Pointer> error) { + return _lib._objc_msgSend_225( + _id, _lib._sel_validateAndReturnError_1, error); + } + + @override + NSXMLDocument initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_999(_id, _lib._sel_initWithKind_1, kind); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDocument initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_1000( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDocument._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SentryCocoa _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_1001(_lib._class_NSXMLDocument1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SentryCocoa _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SentryCocoa _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_1002( + _lib._class_NSXMLDocument1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDocument1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SentryCocoa _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDocument1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDocument1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDocument1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDocument1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDocument1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDocument1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_1016(_lib._class_NSXMLDocument1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDocument new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_new1); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDocument allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSXMLDocument1, _lib._sel_allocWithZone_1, zone); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDocument alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDocument1, _lib._sel_alloc1); + return NSXMLDocument._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSXMLDocument1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSXMLDocument1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDocument1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDocument1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDocument1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDocument1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSXMLDocument1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSXMLDocument1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDocument1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLDocumentContentKind { + static const int NSXMLDocumentXMLKind = 0; + static const int NSXMLDocumentXHTMLKind = 1; + static const int NSXMLDocumentHTMLKind = 2; + static const int NSXMLDocumentTextKind = 3; +} + +class NSXMLDTD extends NSXMLNode { + NSXMLDTD._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDTD] that points to the same underlying object as [other]. + static NSXMLDTD castFrom(T other) { + return NSXMLDTD._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDTD] that wraps the given raw object pointer. + static NSXMLDTD castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDTD._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDTD]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTD1); + } + + @override + NSXMLDTD init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTD initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_1000( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTD initWithContentsOfURL_options_error_( + NSURL? url, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1006( + _id, + _lib._sel_initWithContentsOfURL_options_error_1, + url?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTD initWithData_options_error_( + NSData? data, int mask, ffi.Pointer> error) { + final _ret = _lib._objc_msgSend_1007( + _id, + _lib._sel_initWithData_options_error_1, + data?._id ?? ffi.nullptr, + mask, + error); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set publicID(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set systemID(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); + } + + void insertChild_atIndex_(NSXMLNode? child, int index) { + _lib._objc_msgSend_1010( + _id, _lib._sel_insertChild_atIndex_1, child?._id ?? ffi.nullptr, index); + } + + void insertChildren_atIndex_(NSArray? children, int index) { + _lib._objc_msgSend_1011(_id, _lib._sel_insertChildren_atIndex_1, + children?._id ?? ffi.nullptr, index); + } + + void removeChildAtIndex_(int index) { + _lib._objc_msgSend_439(_id, _lib._sel_removeChildAtIndex_1, index); + } + + void setChildren_(NSArray? children) { + _lib._objc_msgSend_441( + _id, _lib._sel_setChildren_1, children?._id ?? ffi.nullptr); + } + + void addChild_(NSXMLNode? child) { + _lib._objc_msgSend_1012( + _id, _lib._sel_addChild_1, child?._id ?? ffi.nullptr); + } + + void replaceChildAtIndex_withNode_(int index, NSXMLNode? node) { + _lib._objc_msgSend_1013(_id, _lib._sel_replaceChildAtIndex_withNode_1, + index, node?._id ?? ffi.nullptr); + } + + NSXMLDTDNode entityDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_1017( + _id, _lib._sel_entityDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode notationDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_1017( + _id, _lib._sel_notationDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode elementDeclarationForName_(NSString? name) { + final _ret = _lib._objc_msgSend_1017( + _id, _lib._sel_elementDeclarationForName_1, name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + NSXMLDTDNode attributeDeclarationForName_elementName_( + NSString? name, NSString? elementName) { + final _ret = _lib._objc_msgSend_1018( + _id, + _lib._sel_attributeDeclarationForName_elementName_1, + name?._id ?? ffi.nullptr, + elementName?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTDNode predefinedEntityDeclarationForName_( + SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_1017( + _lib._class_NSXMLDTD1, + _lib._sel_predefinedEntityDeclarationForName_1, + name?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTD initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_999(_id, _lib._sel_initWithKind_1, kind); + return NSXMLDTD._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SentryCocoa _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_1001(_lib._class_NSXMLDTD1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SentryCocoa _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SentryCocoa _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_1002( + _lib._class_NSXMLDTD1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTD1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SentryCocoa _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDTD1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTD1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTD1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTD1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTD1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTD1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_1016(_lib._class_NSXMLDTD1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTD new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_new1); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTD allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSXMLDTD1, _lib._sel_allocWithZone_1, zone); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTD alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSXMLDTD1, _lib._sel_alloc1); + return NSXMLDTD._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSXMLDTD1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSXMLDTD1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTD1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTD1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDTD1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDTD1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSXMLDTD1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSXMLDTD1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDTD1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSXMLDTDNode extends NSXMLNode { + NSXMLDTDNode._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSXMLDTDNode] that points to the same underlying object as [other]. + static NSXMLDTDNode castFrom(T other) { + return NSXMLDTDNode._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSXMLDTDNode] that wraps the given raw object pointer. + static NSXMLDTDNode castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSXMLDTDNode._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSXMLDTDNode]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSXMLDTDNode1); + } + + NSXMLDTDNode initWithXMLString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithXMLString_1, string?._id ?? ffi.nullptr); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTDNode initWithKind_options_(int kind, int options) { + final _ret = _lib._objc_msgSend_1000( + _id, _lib._sel_initWithKind_options_1, kind, options); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + @override + NSXMLDTDNode init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + int get DTDKind { + return _lib._objc_msgSend_1014(_id, _lib._sel_DTDKind1); + } + + set DTDKind(int value) { + return _lib._objc_msgSend_1015(_id, _lib._sel_setDTDKind_1, value); + } + + bool get external1 { + return _lib._objc_msgSend_12(_id, _lib._sel_isExternal1); + } + + NSString? get publicID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_publicID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set publicID(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setPublicID_1, value?._id ?? ffi.nullptr); + } + + NSString? get systemID { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_systemID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set systemID(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setSystemID_1, value?._id ?? ffi.nullptr); + } + + NSString? get notationName { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_notationName1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + set notationName(NSString? value) { + return _lib._objc_msgSend_509( + _id, _lib._sel_setNotationName_1, value?._id ?? ffi.nullptr); + } + + @override + NSXMLDTDNode initWithKind_(int kind) { + final _ret = _lib._objc_msgSend_999(_id, _lib._sel_initWithKind_1, kind); + return NSXMLDTDNode._(_ret, _lib, retain: true, release: true); + } + + static NSObject document(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_document1); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject documentWithRootElement_( + SentryCocoa _lib, NSXMLElement? element) { + final _ret = _lib._objc_msgSend_1001(_lib._class_NSXMLDTDNode1, + _lib._sel_documentWithRootElement_1, element?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_1, name?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_URI_( + SentryCocoa _lib, NSString? name, NSString? URI) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_URI_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? string) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_stringValue_1, + name?._id ?? ffi.nullptr, + string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject elementWithName_children_attributes_(SentryCocoa _lib, + NSString? name, NSArray? children, NSArray? attributes) { + final _ret = _lib._objc_msgSend_1002( + _lib._class_NSXMLDTDNode1, + _lib._sel_elementWithName_children_attributes_1, + name?._id ?? ffi.nullptr, + children?._id ?? ffi.nullptr, + attributes?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTDNode1, + _lib._sel_attributeWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject attributeWithName_URI_stringValue_( + SentryCocoa _lib, NSString? name, NSString? URI, NSString? stringValue) { + final _ret = _lib._objc_msgSend_26( + _lib._class_NSXMLDTDNode1, + _lib._sel_attributeWithName_URI_stringValue_1, + name?._id ?? ffi.nullptr, + URI?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject namespaceWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTDNode1, + _lib._sel_namespaceWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject processingInstructionWithName_stringValue_( + SentryCocoa _lib, NSString? name, NSString? stringValue) { + final _ret = _lib._objc_msgSend_165( + _lib._class_NSXMLDTDNode1, + _lib._sel_processingInstructionWithName_stringValue_1, + name?._id ?? ffi.nullptr, + stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject commentWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_commentWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject textWithStringValue_( + SentryCocoa _lib, NSString? stringValue) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_textWithStringValue_1, stringValue?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSObject DTDNodeWithXMLString_(SentryCocoa _lib, NSString? string) { + final _ret = _lib._objc_msgSend_30(_lib._class_NSXMLDTDNode1, + _lib._sel_DTDNodeWithXMLString_1, string?._id ?? ffi.nullptr); + return NSObject._(_ret, _lib, retain: true, release: true); + } + + static NSString localNameForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTDNode1, + _lib._sel_localNameForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSString prefixForName_(SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_64(_lib._class_NSXMLDTDNode1, + _lib._sel_prefixForName_1, name?._id ?? ffi.nullptr); + return NSString._(_ret, _lib, retain: true, release: true); + } + + static NSXMLNode predefinedNamespaceForPrefix_( + SentryCocoa _lib, NSString? name) { + final _ret = _lib._objc_msgSend_1016(_lib._class_NSXMLDTDNode1, + _lib._sel_predefinedNamespaceForPrefix_1, name?._id ?? ffi.nullptr); + return NSXMLNode._(_ret, _lib, retain: true, release: true); + } + + static NSXMLDTDNode new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_new1); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTDNode allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSXMLDTDNode1, _lib._sel_allocWithZone_1, zone); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static NSXMLDTDNode alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_NSXMLDTDNode1, _lib._sel_alloc1); + return NSXMLDTDNode._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSXMLDTDNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSXMLDTDNode1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTDNode1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSXMLDTDNode1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSXMLDTDNode1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSXMLDTDNode1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSXMLDTDNode1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSXMLDTDNode1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSXMLDTDNode1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +abstract class NSXMLDTDNodeKind { + static const int NSXMLEntityGeneralKind = 1; + static const int NSXMLEntityParsedKind = 2; + static const int NSXMLEntityUnparsedKind = 3; + static const int NSXMLEntityParameterKind = 4; + static const int NSXMLEntityPredefined = 5; + static const int NSXMLAttributeCDATAKind = 6; + static const int NSXMLAttributeIDKind = 7; + static const int NSXMLAttributeIDRefKind = 8; + static const int NSXMLAttributeIDRefsKind = 9; + static const int NSXMLAttributeEntityKind = 10; + static const int NSXMLAttributeEntitiesKind = 11; + static const int NSXMLAttributeNMTokenKind = 12; + static const int NSXMLAttributeNMTokensKind = 13; + static const int NSXMLAttributeEnumerationKind = 14; + static const int NSXMLAttributeNotationKind = 15; + static const int NSXMLElementDeclarationUndefinedKind = 16; + static const int NSXMLElementDeclarationEmptyKind = 17; + static const int NSXMLElementDeclarationAnyKind = 18; + static const int NSXMLElementDeclarationMixedKind = 19; + static const int NSXMLElementDeclarationElementKind = 20; +} + +/// @warning This class is reserved for hybrid SDKs. Methods may be changed, renamed or removed +/// without notice. If you want to use one of these methods here please open up an issue and let us +/// know. +/// @note The name of this class is supposed to be a bit weird and ugly. The name starts with private +/// on purpose so users don't see it in code completion when typing Sentry. We also add only at the +/// end to make it more obvious you shouldn't use it. +class PrivateSentrySDKOnly extends NSObject { + PrivateSentrySDKOnly._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [PrivateSentrySDKOnly] that points to the same underlying object as [other]. + static PrivateSentrySDKOnly castFrom(T other) { + return PrivateSentrySDKOnly._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [PrivateSentrySDKOnly] that wraps the given raw object pointer. + static PrivateSentrySDKOnly castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return PrivateSentrySDKOnly._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [PrivateSentrySDKOnly]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_PrivateSentrySDKOnly1); + } + + /// For storing an envelope synchronously to disk. + static void storeEnvelope_(SentryCocoa _lib, SentryEnvelope? envelope) { + _lib._objc_msgSend_1055(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_storeEnvelope_1, envelope?._id ?? ffi.nullptr); + } + + static void captureEnvelope_(SentryCocoa _lib, SentryEnvelope? envelope) { + _lib._objc_msgSend_1055(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_captureEnvelope_1, envelope?._id ?? ffi.nullptr); + } + + /// Create an envelope from @c NSData. Needed for example by Flutter. + static SentryEnvelope envelopeWithData_(SentryCocoa _lib, NSData? data) { + final _ret = _lib._objc_msgSend_1056(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_envelopeWithData_1, data?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + /// Returns the current list of debug images. Be aware that the @c SentryDebugMeta is actually + /// describing a debug image. + /// @warning This assumes a crash has occurred and attempts to read the crash information from each + /// image's data segment, which may not be present or be invalid if a crash has not actually + /// occurred. To avoid this, use the new @c +[getDebugImagesCrashed:] instead. + static NSArray getDebugImages(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_getDebugImages1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + /// Returns the current list of debug images. Be aware that the @c SentryDebugMeta is actually + /// describing a debug image. + /// @param isCrash @c YES if we're collecting binary images for a crash report, @c NO if we're + /// gathering them for other backtrace information, like a performance transaction. If this is for a + /// crash, each image's data section crash info is also included. + static NSArray getDebugImagesCrashed_(SentryCocoa _lib, bool isCrash) { + final _ret = _lib._objc_msgSend_1057(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_getDebugImagesCrashed_1, isCrash); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + /// Override SDK information. + static void setSdkName_andVersionString_( + SentryCocoa _lib, NSString? sdkName, NSString? versionString) { + _lib._objc_msgSend_515( + _lib._class_PrivateSentrySDKOnly1, + _lib._sel_setSdkName_andVersionString_1, + sdkName?._id ?? ffi.nullptr, + versionString?._id ?? ffi.nullptr); + } + + /// Override SDK information. + static void setSdkName_(SentryCocoa _lib, NSString? sdkName) { + _lib._objc_msgSend_192(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_setSdkName_1, sdkName?._id ?? ffi.nullptr); + } + + /// Retrieves the SDK name + static NSString getSdkName(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_getSdkName1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + /// Retrieves the SDK version string + static NSString getSdkVersionString(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_getSdkVersionString1); + return NSString._(_ret, _lib, retain: true, release: true); + } + + /// Retrieves extra context + static NSDictionary getExtraContext(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_170( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_getExtraContext1); + return NSDictionary._(_ret, _lib, retain: true, release: true); + } + + /// Start a profiler session associated with the given @c SentryId. + /// @return The system time when the profiler session started. + static int startProfilerForTrace_(SentryCocoa _lib, SentryId? traceId) { + return _lib._objc_msgSend_1058(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_startProfilerForTrace_1, traceId?._id ?? ffi.nullptr); + } + + /// Collect a profiler session data associated with the given @c SentryId. + /// This also discards the profiler. + static NSMutableDictionary collectProfileBetween_and_forTrace_( + SentryCocoa _lib, + int startSystemTime, + int endSystemTime, + SentryId? traceId) { + final _ret = _lib._objc_msgSend_1059( + _lib._class_PrivateSentrySDKOnly1, + _lib._sel_collectProfileBetween_and_forTrace_1, + startSystemTime, + endSystemTime, + traceId?._id ?? ffi.nullptr); + return NSMutableDictionary._(_ret, _lib, retain: true, release: true); + } + + /// Discard profiler session data associated with the given @c SentryId. + /// This only needs to be called in case you haven't collected the profile (and don't intend to). + static void discardProfilerForTrace_(SentryCocoa _lib, SentryId? traceId) { + _lib._objc_msgSend_1060(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_discardProfilerForTrace_1, traceId?._id ?? ffi.nullptr); + } + + static ObjCBlock_ffiVoid_SentryAppStartMeasurement + getOnAppStartMeasurementAvailable(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_1061(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_onAppStartMeasurementAvailable1); + return ObjCBlock_ffiVoid_SentryAppStartMeasurement._(_ret, _lib); + } + + static void setOnAppStartMeasurementAvailable( + SentryCocoa _lib, ObjCBlock_ffiVoid_SentryAppStartMeasurement value) { + return _lib._objc_msgSend_1062(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_setOnAppStartMeasurementAvailable_1, value._id); + } + + static SentryAppStartMeasurement? getAppStartMeasurement(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_1063( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_appStartMeasurement1); + return _ret.address == 0 + ? null + : SentryAppStartMeasurement._(_ret, _lib, retain: true, release: true); + } + + static NSString? getInstallationID(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_20( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_installationID1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static SentryOptions? getOptions(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_1064( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_options1); + return _ret.address == 0 + ? null + : SentryOptions._(_ret, _lib, retain: true, release: true); + } + + /// If enabled, the SDK won't send the app start measurement with the first transaction. Instead, if + /// @c enableAutoPerformanceTracing is enabled, the SDK measures the app start and then calls + /// @c onAppStartMeasurementAvailable. Furthermore, the SDK doesn't set all values for the app start + /// measurement because the HybridSDKs initialize the Cocoa SDK too late to receive all + /// notifications. Instead, the SDK sets the @c appStartDuration to @c 0 and the + /// @c didFinishLaunchingTimestamp to @c timeIntervalSinceReferenceDate. + /// @note Default is @c NO. + static bool getAppStartMeasurementHybridSDKMode(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_appStartMeasurementHybridSDKMode1); + } + + /// If enabled, the SDK won't send the app start measurement with the first transaction. Instead, if + /// @c enableAutoPerformanceTracing is enabled, the SDK measures the app start and then calls + /// @c onAppStartMeasurementAvailable. Furthermore, the SDK doesn't set all values for the app start + /// measurement because the HybridSDKs initialize the Cocoa SDK too late to receive all + /// notifications. Instead, the SDK sets the @c appStartDuration to @c 0 and the + /// @c didFinishLaunchingTimestamp to @c timeIntervalSinceReferenceDate. + /// @note Default is @c NO. + static void setAppStartMeasurementHybridSDKMode( + SentryCocoa _lib, bool value) { + return _lib._objc_msgSend_492(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_setAppStartMeasurementHybridSDKMode_1, value); + } + + static SentryUser userWithDictionary_( + SentryCocoa _lib, NSDictionary? dictionary) { + final _ret = _lib._objc_msgSend_1065(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_userWithDictionary_1, dictionary?._id ?? ffi.nullptr); + return SentryUser._(_ret, _lib, retain: true, release: true); + } + + static SentryBreadcrumb breadcrumbWithDictionary_( + SentryCocoa _lib, NSDictionary? dictionary) { + final _ret = _lib._objc_msgSend_1066(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_breadcrumbWithDictionary_1, dictionary?._id ?? ffi.nullptr); + return SentryBreadcrumb._(_ret, _lib, retain: true, release: true); + } + + @override + PrivateSentrySDKOnly init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return PrivateSentrySDKOnly._(_ret, _lib, retain: true, release: true); + } + + static PrivateSentrySDKOnly new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_PrivateSentrySDKOnly1, _lib._sel_new1); + return PrivateSentrySDKOnly._(_ret, _lib, retain: false, release: true); + } + + static PrivateSentrySDKOnly allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_allocWithZone_1, zone); + return PrivateSentrySDKOnly._(_ret, _lib, retain: false, release: true); + } + + static PrivateSentrySDKOnly alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_alloc1); + return PrivateSentrySDKOnly._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_PrivateSentrySDKOnly1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_PrivateSentrySDKOnly1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_PrivateSentrySDKOnly1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_PrivateSentrySDKOnly1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_PrivateSentrySDKOnly1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_PrivateSentrySDKOnly1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class SentryEnvelope extends NSObject { + SentryEnvelope._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryEnvelope] that points to the same underlying object as [other]. + static SentryEnvelope castFrom(T other) { + return SentryEnvelope._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentryEnvelope] that wraps the given raw object pointer. + static SentryEnvelope castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryEnvelope._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryEnvelope]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryEnvelope1); + } + + @override + SentryEnvelope init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + static SentryEnvelope new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_SentryEnvelope1, _lib._sel_new1); + return SentryEnvelope._(_ret, _lib, retain: false, release: true); + } + + SentryEnvelope initWithId_singleItem_( + SentryId? id, SentryEnvelopeItem? item) { + final _ret = _lib._objc_msgSend_1045(_id, _lib._sel_initWithId_singleItem_1, + id?._id ?? ffi.nullptr, item?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelope initWithHeader_singleItem_( + SentryEnvelopeHeader? header, SentryEnvelopeItem? item) { + final _ret = _lib._objc_msgSend_1051( + _id, + _lib._sel_initWithHeader_singleItem_1, + header?._id ?? ffi.nullptr, + item?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelope initWithId_items_(SentryId? id, NSArray? items) { + final _ret = _lib._objc_msgSend_1052(_id, _lib._sel_initWithId_items_1, + id?._id ?? ffi.nullptr, items?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + /// Initializes a @c SentryEnvelope with a single session. + /// @param session to init the envelope with. + SentryEnvelope initWithSession_(SentrySession? session) { + final _ret = _lib._objc_msgSend_1040( + _id, _lib._sel_initWithSession_1, session?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + /// Initializes a @c SentryEnvelope with a list of sessions. + /// Can be used when an operation that starts a session closes an ongoing session. + /// @param sessions to init the envelope with. + SentryEnvelope initWithSessions_(NSArray? sessions) { + final _ret = _lib._objc_msgSend_67( + _id, _lib._sel_initWithSessions_1, sessions?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelope initWithHeader_items_( + SentryEnvelopeHeader? header, NSArray? items) { + final _ret = _lib._objc_msgSend_1053(_id, _lib._sel_initWithHeader_items_1, + header?._id ?? ffi.nullptr, items?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + /// Convenience init for a single event. + SentryEnvelope initWithEvent_(SentryEvent? event) { + final _ret = _lib._objc_msgSend_1039( + _id, _lib._sel_initWithEvent_1, event?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelope initWithUserFeedback_(SentryUserFeedback? userFeedback) { + final _ret = _lib._objc_msgSend_1041(_id, _lib._sel_initWithUserFeedback_1, + userFeedback?._id ?? ffi.nullptr); + return SentryEnvelope._(_ret, _lib, retain: true, release: true); + } + + /// The envelope header. + SentryEnvelopeHeader? get header { + final _ret = _lib._objc_msgSend_1054(_id, _lib._sel_header1); + return _ret.address == 0 + ? null + : SentryEnvelopeHeader._(_ret, _lib, retain: true, release: true); + } + + /// The envelope items. + NSArray? get items { + final _ret = _lib._objc_msgSend_79(_id, _lib._sel_items1); + return _ret.address == 0 + ? null + : NSArray._(_ret, _lib, retain: true, release: true); + } + + static SentryEnvelope allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_SentryEnvelope1, _lib._sel_allocWithZone_1, zone); + return SentryEnvelope._(_ret, _lib, retain: false, release: true); + } + + static SentryEnvelope alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_SentryEnvelope1, _lib._sel_alloc1); + return SentryEnvelope._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_SentryEnvelope1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_SentryEnvelope1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_SentryEnvelope1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_SentryEnvelope1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_SentryEnvelope1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_SentryEnvelope1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_SentryEnvelope1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_SentryEnvelope1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_SentryEnvelope1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class SentryId extends NSObject { + SentryId._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryId] that points to the same underlying object as [other]. + static SentryId castFrom(T other) { + return SentryId._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentryId] that wraps the given raw object pointer. + static SentryId castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryId._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryId]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SentryId1); + } + + /// Creates a @c SentryId with a random UUID. + @override + SentryId init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return SentryId._(_ret, _lib, retain: true, release: true); + } + + /// Creates a SentryId with the given UUID. + SentryId initWithUUID_(NSUUID? uuid) { + final _ret = _lib._objc_msgSend_1037( + _id, _lib._sel_initWithUUID_1, uuid?._id ?? ffi.nullptr); + return SentryId._(_ret, _lib, retain: true, release: true); + } + + /// Creates a @c SentryId from a 32 character hexadecimal string without dashes such as + /// "12c2d058d58442709aa2eca08bf20986" or a 36 character hexadecimal string such as such as + /// "12c2d058-d584-4270-9aa2-eca08bf20986". + /// @return SentryId.empty for invalid strings. + SentryId initWithUUIDString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithUUIDString_1, string?._id ?? ffi.nullptr); + return SentryId._(_ret, _lib, retain: true, release: true); + } + + /// Returns a 32 lowercase character hexadecimal string description of the @c SentryId, such as + /// "12c2d058d58442709aa2eca08bf20986". + NSString? get sentryIdString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_sentryIdString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + /// A @c SentryId with an empty UUID "00000000000000000000000000000000". + static SentryId? getEmpty(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_1038(_lib._class_SentryId1, _lib._sel_empty1); + return _ret.address == 0 + ? null + : SentryId._(_ret, _lib, retain: true, release: true); + } + + static SentryId new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_SentryId1, _lib._sel_new1); + return SentryId._(_ret, _lib, retain: false, release: true); + } + + static SentryId allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_SentryId1, _lib._sel_allocWithZone_1, zone); + return SentryId._(_ret, _lib, retain: false, release: true); + } + + static SentryId alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_SentryId1, _lib._sel_alloc1); + return SentryId._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_SentryId1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_SentryId1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_SentryId1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_SentryId1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_SentryId1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_SentryId1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_SentryId1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_SentryId1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_SentryId1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class NSUUID extends NSObject { + NSUUID._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [NSUUID] that points to the same underlying object as [other]. + static NSUUID castFrom(T other) { + return NSUUID._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [NSUUID] that wraps the given raw object pointer. + static NSUUID castFromPointer(SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return NSUUID._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [NSUUID]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSUUID1); + } + + static NSUUID UUID(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSUUID1, _lib._sel_UUID1); + return NSUUID._(_ret, _lib, retain: true, release: true); + } + + @override + NSUUID init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return NSUUID._(_ret, _lib, retain: true, release: true); + } + + NSUUID initWithUUIDString_(NSString? string) { + final _ret = _lib._objc_msgSend_30( + _id, _lib._sel_initWithUUIDString_1, string?._id ?? ffi.nullptr); + return NSUUID._(_ret, _lib, retain: true, release: true); + } + + NSUUID initWithUUIDBytes_(ffi.Pointer bytes) { + final _ret = + _lib._objc_msgSend_1034(_id, _lib._sel_initWithUUIDBytes_1, bytes); + return NSUUID._(_ret, _lib, retain: true, release: true); + } + + void getUUIDBytes_(ffi.Pointer uuid) { + _lib._objc_msgSend_1035(_id, _lib._sel_getUUIDBytes_1, uuid); + } + + int compare_(NSUUID? otherUUID) { + return _lib._objc_msgSend_1036( + _id, _lib._sel_compare_1, otherUUID?._id ?? ffi.nullptr); + } + + NSString? get UUIDString { + final _ret = _lib._objc_msgSend_20(_id, _lib._sel_UUIDString1); + return _ret.address == 0 + ? null + : NSString._(_ret, _lib, retain: true, release: true); + } + + static NSUUID new1(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSUUID1, _lib._sel_new1); + return NSUUID._(_ret, _lib, retain: false, release: true); + } + + static NSUUID allocWithZone_(SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_NSUUID1, _lib._sel_allocWithZone_1, zone); + return NSUUID._(_ret, _lib, retain: false, release: true); + } + + static NSUUID alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2(_lib._class_NSUUID1, _lib._sel_alloc1); + return NSUUID._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_NSUUID1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_NSUUID1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSUUID1, _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_NSUUID1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_NSUUID1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_NSUUID1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_NSUUID1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79( + _lib._class_NSUUID1, _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_NSUUID1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class SentryEnvelopeItem extends NSObject { + SentryEnvelopeItem._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryEnvelopeItem] that points to the same underlying object as [other]. + static SentryEnvelopeItem castFrom(T other) { + return SentryEnvelopeItem._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryEnvelopeItem] that wraps the given raw object pointer. + static SentryEnvelopeItem castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryEnvelopeItem._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryEnvelopeItem]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryEnvelopeItem1); + } + + @override + SentryEnvelopeItem init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return SentryEnvelopeItem._(_ret, _lib, retain: true, release: true); + } + + static SentryEnvelopeItem new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_SentryEnvelopeItem1, _lib._sel_new1); + return SentryEnvelopeItem._(_ret, _lib, retain: false, release: true); + } + + SentryEnvelopeItem initWithEvent_(SentryEvent? event) { + final _ret = _lib._objc_msgSend_1039( + _id, _lib._sel_initWithEvent_1, event?._id ?? ffi.nullptr); + return SentryEnvelopeItem._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelopeItem initWithSession_(SentrySession? session) { + final _ret = _lib._objc_msgSend_1040( + _id, _lib._sel_initWithSession_1, session?._id ?? ffi.nullptr); + return SentryEnvelopeItem._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelopeItem initWithUserFeedback_(SentryUserFeedback? userFeedback) { + final _ret = _lib._objc_msgSend_1041(_id, _lib._sel_initWithUserFeedback_1, + userFeedback?._id ?? ffi.nullptr); + return SentryEnvelopeItem._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelopeItem initWithAttachment_maxAttachmentSize_( + SentryAttachment? attachment, int maxAttachmentSize) { + final _ret = _lib._objc_msgSend_1042( + _id, + _lib._sel_initWithAttachment_maxAttachmentSize_1, + attachment?._id ?? ffi.nullptr, + maxAttachmentSize); + return SentryEnvelopeItem._(_ret, _lib, retain: true, release: true); + } + + SentryEnvelopeItem initWithHeader_data_( + SentryEnvelopeItemHeader? header, NSData? data) { + final _ret = _lib._objc_msgSend_1043(_id, _lib._sel_initWithHeader_data_1, + header?._id ?? ffi.nullptr, data?._id ?? ffi.nullptr); + return SentryEnvelopeItem._(_ret, _lib, retain: true, release: true); + } + + /// The envelope item header. + SentryEnvelopeItemHeader? get header { + final _ret = _lib._objc_msgSend_1044(_id, _lib._sel_header1); + return _ret.address == 0 + ? null + : SentryEnvelopeItemHeader._(_ret, _lib, retain: true, release: true); + } + + /// The envelope payload. + NSData? get data { + final _ret = _lib._objc_msgSend_39(_id, _lib._sel_data1); + return _ret.address == 0 + ? null + : NSData._(_ret, _lib, retain: true, release: true); + } + + static SentryEnvelopeItem allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_SentryEnvelopeItem1, _lib._sel_allocWithZone_1, zone); + return SentryEnvelopeItem._(_ret, _lib, retain: false, release: true); + } + + static SentryEnvelopeItem alloc(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_SentryEnvelopeItem1, _lib._sel_alloc1); + return SentryEnvelopeItem._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_SentryEnvelopeItem1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_SentryEnvelopeItem1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_SentryEnvelopeItem1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_SentryEnvelopeItem1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_SentryEnvelopeItem1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_SentryEnvelopeItem1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_SentryEnvelopeItem1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_SentryEnvelopeItem1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_SentryEnvelopeItem1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class SentryEvent extends _ObjCWrapper { + SentryEvent._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryEvent] that points to the same underlying object as [other]. + static SentryEvent castFrom(T other) { + return SentryEvent._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentryEvent] that wraps the given raw object pointer. + static SentryEvent castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryEvent._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryEvent]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SentryEvent1); + } +} + +class SentrySession extends _ObjCWrapper { + SentrySession._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentrySession] that points to the same underlying object as [other]. + static SentrySession castFrom(T other) { + return SentrySession._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentrySession] that wraps the given raw object pointer. + static SentrySession castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentrySession._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentrySession]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SentrySession1); + } +} + +class SentryUserFeedback extends _ObjCWrapper { + SentryUserFeedback._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryUserFeedback] that points to the same underlying object as [other]. + static SentryUserFeedback castFrom(T other) { + return SentryUserFeedback._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryUserFeedback] that wraps the given raw object pointer. + static SentryUserFeedback castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryUserFeedback._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryUserFeedback]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryUserFeedback1); + } +} + +class SentryAttachment extends _ObjCWrapper { + SentryAttachment._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryAttachment] that points to the same underlying object as [other]. + static SentryAttachment castFrom(T other) { + return SentryAttachment._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryAttachment] that wraps the given raw object pointer. + static SentryAttachment castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryAttachment._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryAttachment]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryAttachment1); + } +} + +class SentryEnvelopeItemHeader extends _ObjCWrapper { + SentryEnvelopeItemHeader._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryEnvelopeItemHeader] that points to the same underlying object as [other]. + static SentryEnvelopeItemHeader castFrom(T other) { + return SentryEnvelopeItemHeader._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryEnvelopeItemHeader] that wraps the given raw object pointer. + static SentryEnvelopeItemHeader castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryEnvelopeItemHeader._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryEnvelopeItemHeader]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryEnvelopeItemHeader1); + } +} + +class SentryEnvelopeHeader extends NSObject { + SentryEnvelopeHeader._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryEnvelopeHeader] that points to the same underlying object as [other]. + static SentryEnvelopeHeader castFrom(T other) { + return SentryEnvelopeHeader._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryEnvelopeHeader] that wraps the given raw object pointer. + static SentryEnvelopeHeader castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryEnvelopeHeader._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryEnvelopeHeader]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryEnvelopeHeader1); + } + + @override + SentryEnvelopeHeader init() { + final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); + return SentryEnvelopeHeader._(_ret, _lib, retain: true, release: true); + } + + static SentryEnvelopeHeader new1(SentryCocoa _lib) { + final _ret = + _lib._objc_msgSend_2(_lib._class_SentryEnvelopeHeader1, _lib._sel_new1); + return SentryEnvelopeHeader._(_ret, _lib, retain: false, release: true); + } + + /// Initializes an @c SentryEnvelopeHeader object with the specified eventId. + /// @note Sets the @c sdkInfo from @c SentryMeta. + /// @param eventId The identifier of the event. Can be nil if no event in the envelope or attachment + /// related to event. + SentryEnvelopeHeader initWithId_(SentryId? eventId) { + final _ret = _lib._objc_msgSend_1046( + _id, _lib._sel_initWithId_1, eventId?._id ?? ffi.nullptr); + return SentryEnvelopeHeader._(_ret, _lib, retain: true, release: true); + } + + /// Initializes a @c SentryEnvelopeHeader object with the specified @c eventId and @c traceContext. + /// @param eventId The identifier of the event. Can be @c nil if no event in the envelope or + /// attachment related to event. + /// @param traceContext Current trace state. + SentryEnvelopeHeader initWithId_traceContext_( + SentryId? eventId, SentryTraceContext? traceContext) { + final _ret = _lib._objc_msgSend_1047( + _id, + _lib._sel_initWithId_traceContext_1, + eventId?._id ?? ffi.nullptr, + traceContext?._id ?? ffi.nullptr); + return SentryEnvelopeHeader._(_ret, _lib, retain: true, release: true); + } + + /// Initializes a @c SentryEnvelopeHeader object with the specified @c eventId, @c skdInfo and + /// @c traceContext. It is recommended to use @c initWithId:traceContext: because it sets the + /// @c sdkInfo for you. + /// @param eventId The identifier of the event. Can be @c nil if no event in the envelope or + /// attachment related to event. + /// @param sdkInfo Describes the Sentry SDK. Can be @c nil for backwards compatibility. New + /// instances should always provide a version. + /// @param traceContext Current trace state. + SentryEnvelopeHeader initWithId_sdkInfo_traceContext_(SentryId? eventId, + SentrySdkInfo? sdkInfo, SentryTraceContext? traceContext) { + final _ret = _lib._objc_msgSend_1048( + _id, + _lib._sel_initWithId_sdkInfo_traceContext_1, + eventId?._id ?? ffi.nullptr, + sdkInfo?._id ?? ffi.nullptr, + traceContext?._id ?? ffi.nullptr); + return SentryEnvelopeHeader._(_ret, _lib, retain: true, release: true); + } + + /// The event identifier, if available. + /// An event id exist if the envelope contains an event of items within it are related. i.e + /// Attachments + SentryId? get eventId { + final _ret = _lib._objc_msgSend_1038(_id, _lib._sel_eventId1); + return _ret.address == 0 + ? null + : SentryId._(_ret, _lib, retain: true, release: true); + } + + SentrySdkInfo? get sdkInfo { + final _ret = _lib._objc_msgSend_1049(_id, _lib._sel_sdkInfo1); + return _ret.address == 0 + ? null + : SentrySdkInfo._(_ret, _lib, retain: true, release: true); + } + + SentryTraceContext? get traceContext { + final _ret = _lib._objc_msgSend_1050(_id, _lib._sel_traceContext1); + return _ret.address == 0 + ? null + : SentryTraceContext._(_ret, _lib, retain: true, release: true); + } + + /// The timestamp when the event was sent from the SDK as string in RFC 3339 format. Used + /// for clock drift correction of the event timestamp. The time zone must be UTC. + /// + /// The timestamp should be generated as close as possible to the transmision of the event, + /// so that the delay between sending the envelope and receiving it on the server-side is + /// minimized. + NSDate? get sentAt { + final _ret = _lib._objc_msgSend_162(_id, _lib._sel_sentAt1); + return _ret.address == 0 + ? null + : NSDate._(_ret, _lib, retain: true, release: true); + } + + /// The timestamp when the event was sent from the SDK as string in RFC 3339 format. Used + /// for clock drift correction of the event timestamp. The time zone must be UTC. + /// + /// The timestamp should be generated as close as possible to the transmision of the event, + /// so that the delay between sending the envelope and receiving it on the server-side is + /// minimized. + set sentAt(NSDate? value) { + return _lib._objc_msgSend_525( + _id, _lib._sel_setSentAt_1, value?._id ?? ffi.nullptr); + } + + static SentryEnvelopeHeader allocWithZone_( + SentryCocoa _lib, ffi.Pointer<_NSZone> zone) { + final _ret = _lib._objc_msgSend_3( + _lib._class_SentryEnvelopeHeader1, _lib._sel_allocWithZone_1, zone); + return SentryEnvelopeHeader._(_ret, _lib, retain: false, release: true); + } + + static SentryEnvelopeHeader alloc(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_SentryEnvelopeHeader1, _lib._sel_alloc1); + return SentryEnvelopeHeader._(_ret, _lib, retain: false, release: true); + } + + static void cancelPreviousPerformRequestsWithTarget_selector_object_( + SentryCocoa _lib, + NSObject aTarget, + ffi.Pointer aSelector, + NSObject anArgument) { + _lib._objc_msgSend_14( + _lib._class_SentryEnvelopeHeader1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1, + aTarget._id, + aSelector, + anArgument._id); + } + + static void cancelPreviousPerformRequestsWithTarget_( + SentryCocoa _lib, NSObject aTarget) { + _lib._objc_msgSend_15(_lib._class_SentryEnvelopeHeader1, + _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id); + } + + static bool getAccessInstanceVariablesDirectly(SentryCocoa _lib) { + return _lib._objc_msgSend_12(_lib._class_SentryEnvelopeHeader1, + _lib._sel_accessInstanceVariablesDirectly1); + } + + static bool useStoredAccessor(SentryCocoa _lib) { + return _lib._objc_msgSend_12( + _lib._class_SentryEnvelopeHeader1, _lib._sel_useStoredAccessor1); + } + + static NSSet keyPathsForValuesAffectingValueForKey_( + SentryCocoa _lib, NSString? key) { + final _ret = _lib._objc_msgSend_58( + _lib._class_SentryEnvelopeHeader1, + _lib._sel_keyPathsForValuesAffectingValueForKey_1, + key?._id ?? ffi.nullptr); + return NSSet._(_ret, _lib, retain: true, release: true); + } + + static bool automaticallyNotifiesObserversForKey_( + SentryCocoa _lib, NSString? key) { + return _lib._objc_msgSend_59( + _lib._class_SentryEnvelopeHeader1, + _lib._sel_automaticallyNotifiesObserversForKey_1, + key?._id ?? ffi.nullptr); + } + + static void setKeys_triggerChangeNotificationsForDependentKey_( + SentryCocoa _lib, NSArray? keys, NSString? dependentKey) { + _lib._objc_msgSend_82( + _lib._class_SentryEnvelopeHeader1, + _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1, + keys?._id ?? ffi.nullptr, + dependentKey?._id ?? ffi.nullptr); + } + + static NSArray classFallbacksForKeyedArchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_79(_lib._class_SentryEnvelopeHeader1, + _lib._sel_classFallbacksForKeyedArchiver1); + return NSArray._(_ret, _lib, retain: true, release: true); + } + + static NSObject classForKeyedUnarchiver(SentryCocoa _lib) { + final _ret = _lib._objc_msgSend_2( + _lib._class_SentryEnvelopeHeader1, _lib._sel_classForKeyedUnarchiver1); + return NSObject._(_ret, _lib, retain: true, release: true); + } +} + +class SentryTraceContext extends _ObjCWrapper { + SentryTraceContext._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryTraceContext] that points to the same underlying object as [other]. + static SentryTraceContext castFrom(T other) { + return SentryTraceContext._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryTraceContext] that wraps the given raw object pointer. + static SentryTraceContext castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryTraceContext._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryTraceContext]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryTraceContext1); + } +} + +class SentrySdkInfo extends _ObjCWrapper { + SentrySdkInfo._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentrySdkInfo] that points to the same underlying object as [other]. + static SentrySdkInfo castFrom(T other) { + return SentrySdkInfo._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentrySdkInfo] that wraps the given raw object pointer. + static SentrySdkInfo castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentrySdkInfo._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentrySdkInfo]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SentrySdkInfo1); + } +} + +void _ObjCBlock_ffiVoid_SentryAppStartMeasurement_fnPtrTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction arg0)>()(arg0); +} + +final _ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureRegistry = + {}; +int _ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureRegistryIndex = 0; +ffi.Pointer + _ObjCBlock_ffiVoid_SentryAppStartMeasurement_registerClosure(Function fn) { + final id = + ++_ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureRegistryIndex; + _ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureRegistry[id] = fn; + return ffi.Pointer.fromAddress(id); +} + +void _ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureTrampoline( + ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) { + return (_ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureRegistry[block + .ref.target.address] as void Function(ffi.Pointer))(arg0); +} + +class ObjCBlock_ffiVoid_SentryAppStartMeasurement extends _ObjCBlockBase { + ObjCBlock_ffiVoid_SentryAppStartMeasurement._( + ffi.Pointer<_ObjCBlock> id, SentryCocoa lib) + : super._(id, lib, retain: false, release: true); + + /// Creates a block from a C function pointer. + ObjCBlock_ffiVoid_SentryAppStartMeasurement.fromFunctionPointer( + SentryCocoa lib, + ffi.Pointer< + ffi + .NativeFunction arg0)>> + ptr) + : this._( + lib._newBlock1( + _cFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_SentryAppStartMeasurement_fnPtrTrampoline) + .cast(), + ptr.cast()), + lib); + static ffi.Pointer? _cFuncTrampoline; + + /// Creates a block from a Dart function. + ObjCBlock_ffiVoid_SentryAppStartMeasurement.fromFunction( + SentryCocoa lib, void Function(ffi.Pointer arg0) fn) + : this._( + lib._newBlock1( + _dartFuncTrampoline ??= ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>( + _ObjCBlock_ffiVoid_SentryAppStartMeasurement_closureTrampoline) + .cast(), + _ObjCBlock_ffiVoid_SentryAppStartMeasurement_registerClosure( + fn)), + lib); + static ffi.Pointer? _dartFuncTrampoline; + void call(ffi.Pointer arg0) { + return _id.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer<_ObjCBlock> block, + ffi.Pointer arg0)>()(_id, arg0); + } +} + +class SentryAppStartMeasurement extends _ObjCWrapper { + SentryAppStartMeasurement._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryAppStartMeasurement] that points to the same underlying object as [other]. + static SentryAppStartMeasurement castFrom(T other) { + return SentryAppStartMeasurement._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryAppStartMeasurement] that wraps the given raw object pointer. + static SentryAppStartMeasurement castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryAppStartMeasurement._(other, lib, + retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryAppStartMeasurement]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryAppStartMeasurement1); + } +} + +class SentryOptions extends _ObjCWrapper { + SentryOptions._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryOptions] that points to the same underlying object as [other]. + static SentryOptions castFrom(T other) { + return SentryOptions._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentryOptions] that wraps the given raw object pointer. + static SentryOptions castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryOptions._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryOptions]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SentryOptions1); + } +} + +class SentryUser extends _ObjCWrapper { + SentryUser._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryUser] that points to the same underlying object as [other]. + static SentryUser castFrom(T other) { + return SentryUser._(other._id, other._lib, retain: true, release: true); + } + + /// Returns a [SentryUser] that wraps the given raw object pointer. + static SentryUser castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryUser._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryUser]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0( + obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_SentryUser1); + } +} + +class SentryBreadcrumb extends _ObjCWrapper { + SentryBreadcrumb._(ffi.Pointer id, SentryCocoa lib, + {bool retain = false, bool release = false}) + : super._(id, lib, retain: retain, release: release); + + /// Returns a [SentryBreadcrumb] that points to the same underlying object as [other]. + static SentryBreadcrumb castFrom(T other) { + return SentryBreadcrumb._(other._id, other._lib, + retain: true, release: true); + } + + /// Returns a [SentryBreadcrumb] that wraps the given raw object pointer. + static SentryBreadcrumb castFromPointer( + SentryCocoa lib, ffi.Pointer other, + {bool retain = false, bool release = false}) { + return SentryBreadcrumb._(other, lib, retain: retain, release: release); + } + + /// Returns whether [obj] is an instance of [SentryBreadcrumb]. + static bool isInstance(_ObjCWrapper obj) { + return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, + obj._lib._class_SentryBreadcrumb1); + } +} diff --git a/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart b/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart new file mode 100644 index 0000000000..0e6817cb48 --- /dev/null +++ b/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart @@ -0,0 +1,23 @@ +import 'dart:ffi'; + +import 'package:meta/meta.dart'; + +import '../../../sentry_flutter.dart'; +import '../sentry_native_channel.dart'; +import 'binding.dart' as cocoa; + +@internal +class SentryNativeCocoa extends SentryNativeChannel { + late final _lib = cocoa.SentryCocoa(DynamicLibrary.process()); + + SentryNativeCocoa(super.channel); + + @override + int? startProfiler(SentryId traceId) { + final cSentryId = cocoa.SentryId.alloc(_lib) + ..initWithUUIDString_(cocoa.NSString(_lib, traceId.toString())); + final startTime = + cocoa.PrivateSentrySDKOnly.startProfilerForTrace_(_lib, cSentryId); + return startTime; + } +} diff --git a/flutter/lib/src/native/factory.dart b/flutter/lib/src/native/factory.dart new file mode 100644 index 0000000000..981e1d6ead --- /dev/null +++ b/flutter/lib/src/native/factory.dart @@ -0,0 +1 @@ +export 'factory_real.dart' if (dart.library.html) 'factory_web.dart'; diff --git a/flutter/lib/src/native/factory_real.dart b/flutter/lib/src/native/factory_real.dart new file mode 100644 index 0000000000..3c918b7be7 --- /dev/null +++ b/flutter/lib/src/native/factory_real.dart @@ -0,0 +1,14 @@ +import 'package:flutter/services.dart'; + +import '../../sentry_flutter.dart'; +import 'cocoa/sentry_native_cocoa.dart'; +import 'sentry_native_binding.dart'; +import 'sentry_native_channel.dart'; + +SentryNativeBinding createBinding(PlatformChecker pc, MethodChannel channel) { + if (pc.platform.isIOS || pc.platform.isMacOS) { + return SentryNativeCocoa(channel); + } else { + return SentryNativeChannel(channel); + } +} diff --git a/flutter/lib/src/native/factory_web.dart b/flutter/lib/src/native/factory_web.dart new file mode 100644 index 0000000000..8038ea9780 --- /dev/null +++ b/flutter/lib/src/native/factory_web.dart @@ -0,0 +1,9 @@ +import 'package:flutter/services.dart'; + +import '../../sentry_flutter.dart'; +import 'sentry_native_binding.dart'; + +// This isn't actually called, see SentryFlutter.init() +SentryNativeBinding createBinding(PlatformChecker pc, MethodChannel channel) { + throw UnsupportedError("Native binding is not supported on this platform."); +} diff --git a/flutter/lib/src/native/method_channel_helper.dart b/flutter/lib/src/native/method_channel_helper.dart new file mode 100644 index 0000000000..bd3c8864b8 --- /dev/null +++ b/flutter/lib/src/native/method_channel_helper.dart @@ -0,0 +1,38 @@ +import 'package:meta/meta.dart'; + +/// Makes sure no invalid data is sent over method channels. +@internal +class MethodChannelHelper { + static dynamic normalize(dynamic data) { + if (data == null) { + return null; + } + if (_isPrimitive(data)) { + return data; + } else if (data is List) { + return _normalizeList(data); + } else if (data is Map) { + return normalizeMap(data); + } else { + return data.toString(); + } + } + + static Map? normalizeMap(Map? data) { + if (data == null) { + return null; + } + return data.map((key, value) => MapEntry(key, normalize(value))); + } + + static List? _normalizeList(List? data) { + if (data == null) { + return null; + } + return data.map((e) => normalize(e)).toList(); + } + + static bool _isPrimitive(dynamic value) { + return value == null || value is String || value is num || value is bool; + } +} diff --git a/flutter/lib/src/native_scope_observer.dart b/flutter/lib/src/native/native_scope_observer.dart similarity index 100% rename from flutter/lib/src/native_scope_observer.dart rename to flutter/lib/src/native/native_scope_observer.dart diff --git a/flutter/lib/src/native/sentry_native.dart b/flutter/lib/src/native/sentry_native.dart new file mode 100644 index 0000000000..b8d2206a8d --- /dev/null +++ b/flutter/lib/src/native/sentry_native.dart @@ -0,0 +1,156 @@ +import 'dart:async'; + +import 'package:meta/meta.dart'; + +import '../../sentry_flutter.dart'; +import 'sentry_native_binding.dart'; + +/// [SentryNative] holds state that it fetches from to the native SDKs. +/// It forwards to platform-specific implementations of [SentryNativeBinding]. +/// Any errors are logged and ignored. +@internal +class SentryNative { + final SentryOptions _options; + final SentryNativeBinding _binding; + + SentryNative(this._options, this._binding); + + // AppStart + + /// This timestamp marks the end of app startup. Either set automatically when + /// [SentryFlutterOptions.autoAppStart] is true, or by calling + /// [SentryFlutter.setAppStartEnd] + DateTime? appStartEnd; + + bool _didFetchAppStart = false; + + /// Flag indicating if app start was already fetched. + bool get didFetchAppStart => _didFetchAppStart; + + /// Fetch [NativeAppStart] from native channels. Can only be called once. + Future fetchNativeAppStart() async { + _didFetchAppStart = true; + return _invoke("fetchNativeAppStart", _binding.fetchNativeAppStart); + } + + // NativeFrames + + Future beginNativeFramesCollection() => + _invoke("beginNativeFrames", _binding.beginNativeFrames); + + Future endNativeFramesCollection(SentryId traceId) => + _invoke("endNativeFrames", () => _binding.endNativeFrames(traceId)); + + // Scope + + Future setContexts(String key, dynamic value) => + _invoke("setContexts", () => _binding.setContexts(key, value)); + + Future removeContexts(String key) => + _invoke("removeContexts", () => _binding.removeContexts(key)); + + Future setUser(SentryUser? sentryUser) => + _invoke("setUser", () => _binding.setUser(sentryUser)); + + Future addBreadcrumb(Breadcrumb breadcrumb) => + _invoke("addBreadcrumb", () => _binding.addBreadcrumb(breadcrumb)); + + Future clearBreadcrumbs() => + _invoke("clearBreadcrumbs", _binding.clearBreadcrumbs); + + Future setExtra(String key, dynamic value) => + _invoke("setExtra", () => _binding.setExtra(key, value)); + + Future removeExtra(String key) => + _invoke("removeExtra", () => _binding.removeExtra(key)); + + Future setTag(String key, String value) => + _invoke("setTag", () => _binding.setTag(key, value)); + + Future removeTag(String key) => + _invoke("removeTag", () => _binding.removeTag(key)); + + int? startProfiler(SentryId traceId) => + _invokeSync("startProfiler", () => _binding.startProfiler(traceId)); + + Future discardProfiler(SentryId traceId) => + _invoke("discardProfiler", () => _binding.discardProfiler(traceId)); + + Future?> collectProfile( + SentryId traceId, int startTimeNs, int endTimeNs) => + _invoke("collectProfile", + () => _binding.collectProfile(traceId, startTimeNs, endTimeNs)); + + /// Reset state + void reset() { + appStartEnd = null; + _didFetchAppStart = false; + } + + // Helpers + Future _invoke( + String nativeMethodName, Future Function() fn) async { + try { + return await fn(); + } catch (error, stackTrace) { + _logError(nativeMethodName, error, stackTrace); + // ignore: invalid_use_of_internal_member + if (_options.automatedTestMode) { + rethrow; + } + return null; + } + } + + T? _invokeSync(String nativeMethodName, T? Function() fn) { + try { + return fn(); + } catch (error, stackTrace) { + _logError(nativeMethodName, error, stackTrace); + // ignore: invalid_use_of_internal_member + if (_options.automatedTestMode) { + rethrow; + } + return null; + } + } + + void _logError(String nativeMethodName, Object error, StackTrace stackTrace) { + _options.logger( + SentryLevel.error, + 'Native call `$nativeMethodName` failed', + exception: error, + stackTrace: stackTrace, + ); + } +} + +class NativeAppStart { + NativeAppStart(this.appStartTime, this.isColdStart); + + double appStartTime; + bool isColdStart; + + factory NativeAppStart.fromJson(Map json) { + return NativeAppStart( + json['appStartTime'] as double, + json['isColdStart'] as bool, + ); + } +} + +class NativeFrames { + NativeFrames(this.totalFrames, this.slowFrames, this.frozenFrames); + + int totalFrames; + int slowFrames; + int frozenFrames; + + factory NativeFrames.fromJson(Map json) { + return NativeFrames( + json['totalFrames'] as int, + json['slowFrames'] as int, + json['frozenFrames'] as int, + ); + } +} diff --git a/flutter/lib/src/native/sentry_native_binding.dart b/flutter/lib/src/native/sentry_native_binding.dart new file mode 100644 index 0000000000..54d335d529 --- /dev/null +++ b/flutter/lib/src/native/sentry_native_binding.dart @@ -0,0 +1,43 @@ +import 'dart:async'; + +import 'package:meta/meta.dart'; + +import '../../sentry_flutter.dart'; +import 'sentry_native.dart'; + +/// Provide typed methods to access native layer. +@internal +abstract class SentryNativeBinding { + // TODO Move other native calls here. + + Future fetchNativeAppStart(); + + Future beginNativeFrames(); + + Future endNativeFrames(SentryId id); + + Future setUser(SentryUser? user); + + Future addBreadcrumb(Breadcrumb breadcrumb); + + Future clearBreadcrumbs(); + + Future setContexts(String key, dynamic value); + + Future removeContexts(String key); + + Future setExtra(String key, dynamic value); + + Future removeExtra(String key); + + Future setTag(String key, String value); + + Future removeTag(String key); + + int? startProfiler(SentryId traceId); + + Future discardProfiler(SentryId traceId); + + Future?> collectProfile( + SentryId traceId, int startTimeNs, int endTimeNs); +} diff --git a/flutter/lib/src/native/sentry_native_channel.dart b/flutter/lib/src/native/sentry_native_channel.dart new file mode 100644 index 0000000000..4bf9745cb3 --- /dev/null +++ b/flutter/lib/src/native/sentry_native_channel.dart @@ -0,0 +1,107 @@ +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; + +import '../../sentry_flutter.dart'; +import 'sentry_native.dart'; +import 'method_channel_helper.dart'; +import 'sentry_native_binding.dart'; + +/// Provide typed methods to access native layer via MethodChannel. +@internal +class SentryNativeChannel implements SentryNativeBinding { + SentryNativeChannel(this._channel); + + final MethodChannel _channel; + + // TODO Move other native calls here. + + @override + Future fetchNativeAppStart() async { + final json = + await _channel.invokeMapMethod('fetchNativeAppStart'); + return (json != null) ? NativeAppStart.fromJson(json) : null; + } + + @override + Future beginNativeFrames() => + _channel.invokeMethod('beginNativeFrames'); + + @override + Future endNativeFrames(SentryId id) async { + final json = await _channel.invokeMapMethod( + 'endNativeFrames', {'id': id.toString()}); + return (json != null) ? NativeFrames.fromJson(json) : null; + } + + @override + Future setUser(SentryUser? user) async { + final normalizedUser = user?.copyWith( + data: MethodChannelHelper.normalizeMap(user.data), + ); + await _channel.invokeMethod( + 'setUser', + {'user': normalizedUser?.toJson()}, + ); + } + + @override + Future addBreadcrumb(Breadcrumb breadcrumb) async { + final normalizedBreadcrumb = breadcrumb.copyWith( + data: MethodChannelHelper.normalizeMap(breadcrumb.data), + ); + await _channel.invokeMethod( + 'addBreadcrumb', + {'breadcrumb': normalizedBreadcrumb.toJson()}, + ); + } + + @override + Future clearBreadcrumbs() => _channel.invokeMethod('clearBreadcrumbs'); + + @override + Future setContexts(String key, dynamic value) => _channel.invokeMethod( + 'setContexts', + {'key': key, 'value': MethodChannelHelper.normalize(value)}, + ); + + @override + Future removeContexts(String key) => + _channel.invokeMethod('removeContexts', {'key': key}); + + @override + Future setExtra(String key, dynamic value) => _channel.invokeMethod( + 'setExtra', + {'key': key, 'value': MethodChannelHelper.normalize(value)}, + ); + + @override + Future removeExtra(String key) => + _channel.invokeMethod('removeExtra', {'key': key}); + + @override + Future setTag(String key, String value) => + _channel.invokeMethod('setTag', {'key': key, 'value': value}); + + @override + Future removeTag(String key) => + _channel.invokeMethod('removeTag', {'key': key}); + + @override + int? startProfiler(SentryId traceId) => + throw UnsupportedError("Not supported on this platform"); + + @override + Future discardProfiler(SentryId traceId) => + _channel.invokeMethod('discardProfiler', traceId.toString()); + + @override + Future?> collectProfile( + SentryId traceId, int startTimeNs, int endTimeNs) => + _channel.invokeMapMethod('collectProfile', { + 'traceId': traceId.toString(), + 'startTime': startTimeNs, + 'endTime': endTimeNs, + }); +} diff --git a/flutter/lib/src/navigation/sentry_navigator_observer.dart b/flutter/lib/src/navigation/sentry_navigator_observer.dart index 135d131ec2..6893d47aca 100644 --- a/flutter/lib/src/navigation/sentry_navigator_observer.dart +++ b/flutter/lib/src/navigation/sentry_navigator_observer.dart @@ -1,8 +1,9 @@ import 'package:flutter/widgets.dart'; +import 'package:meta/meta.dart'; import '../../sentry_flutter.dart'; -import '../sentry_native.dart'; -import '../sentry_native_channel.dart'; +import '../event_processor/flutter_enricher_event_processor.dart'; +import '../native/sentry_native.dart'; /// This key must be used so that the web interface displays the events nicely /// See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ @@ -23,6 +24,9 @@ typedef AdditionalInfoExtractor = Map? Function( /// The [RouteSettings] is null if a developer has not specified any /// RouteSettings. /// +/// The current route name will also be set to [SentryEvent] +/// `contexts.app.view_names` by [FlutterEnricherEventProcessor]. +/// /// [SentryNavigatorObserver] must be added to the [navigation observer](https://api.flutter.dev/flutter/material/MaterialApp/navigatorObservers.html) of /// your used app. This is an example for [MaterialApp](https://api.flutter.dev/flutter/material/MaterialApp/navigatorObservers.html), /// but the integration for [CupertinoApp](https://api.flutter.dev/flutter/cupertino/CupertinoApp/navigatorObservers.html) @@ -68,7 +72,7 @@ class SentryNavigatorObserver extends RouteObserver> { _setRouteNameAsTransaction = setRouteNameAsTransaction, _routeNameExtractor = routeNameExtractor, _additionalInfoProvider = additionalInfoProvider, - _native = SentryNative() { + _native = SentryFlutter.native { if (enableAutoTransactions) { // ignore: invalid_use_of_internal_member _hub.options.sdk.addIntegration('UINavigationTracing'); @@ -81,15 +85,21 @@ class SentryNavigatorObserver extends RouteObserver> { final bool _setRouteNameAsTransaction; final RouteNameExtractor? _routeNameExtractor; final AdditionalInfoExtractor? _additionalInfoProvider; - final SentryNative _native; + final SentryNative? _native; ISentrySpan? _transaction; + static String? _currentRouteName; + + @internal + static String? get currentRouteName => _currentRouteName; + @override void didPush(Route route, Route? previousRoute) { super.didPush(route, previousRoute); - _setCurrentRoute(route); + _setCurrentRouteName(route); + _setCurrentRouteNameAsTransaction(route); _addBreadcrumb( type: 'didPush', @@ -105,7 +115,9 @@ class SentryNavigatorObserver extends RouteObserver> { void didReplace({Route? newRoute, Route? oldRoute}) { super.didReplace(newRoute: newRoute, oldRoute: oldRoute); - _setCurrentRoute(newRoute); + _setCurrentRouteName(newRoute); + _setCurrentRouteNameAsTransaction(newRoute); + _addBreadcrumb( type: 'didReplace', from: oldRoute?.settings, @@ -117,7 +129,9 @@ class SentryNavigatorObserver extends RouteObserver> { void didPop(Route route, Route? previousRoute) { super.didPop(route, previousRoute); - _setCurrentRoute(previousRoute); + _setCurrentRouteName(previousRoute); + _setCurrentRouteNameAsTransaction(previousRoute); + _addBreadcrumb( type: 'didPop', from: route.settings, @@ -148,7 +162,11 @@ class SentryNavigatorObserver extends RouteObserver> { ?.name; } - Future _setCurrentRoute(Route? route) async { + Future _setCurrentRouteName(Route? route) async { + _currentRouteName = _getRouteName(route); + } + + Future _setCurrentRouteNameAsTransaction(Route? route) async { final name = _getRouteName(route); if (name == null) { return; @@ -190,7 +208,7 @@ class SentryNavigatorObserver extends RouteObserver> { trimEnd: true, onFinish: (transaction) async { final nativeFrames = await _native - .endNativeFramesCollection(transaction.context.traceId); + ?.endNativeFramesCollection(transaction.context.traceId); if (nativeFrames != null) { final measurements = nativeFrames.toMeasurements(); for (final item in measurements.entries) { @@ -219,7 +237,7 @@ class SentryNavigatorObserver extends RouteObserver> { scope.span ??= _transaction; }); - await _native.beginNativeFramesCollection(); + await _native?.beginNativeFramesCollection(); } Future _finishTransaction() async { @@ -265,14 +283,12 @@ class RouteObserverBreadcrumb extends Breadcrumb { dynamic fromArgs, String? to, dynamic toArgs, - SentryLevel? level, - DateTime? timestamp, + super.level, + super.timestamp, Map? data, }) : super( category: _navigationKey, type: _navigationKey, - level: level, - timestamp: timestamp, data: { 'state': navigationType, if (from != null) 'from': from, diff --git a/flutter/lib/src/profiling.dart b/flutter/lib/src/profiling.dart new file mode 100644 index 0000000000..a4332d77e7 --- /dev/null +++ b/flutter/lib/src/profiling.dart @@ -0,0 +1,117 @@ +import 'dart:async'; + +// ignore: implementation_imports +import 'package:sentry/src/profiling.dart'; +// ignore: implementation_imports +import 'package:sentry/src/sentry_envelope_item_header.dart'; +// ignore: implementation_imports +import 'package:sentry/src/sentry_item_type.dart'; + +import '../sentry_flutter.dart'; +import 'native/sentry_native.dart'; + +// ignore: invalid_use_of_internal_member +class SentryNativeProfilerFactory implements SentryProfilerFactory { + final SentryNative _native; + final ClockProvider _clock; + + SentryNativeProfilerFactory(this._native, this._clock); + + static void attachTo(Hub hub, SentryNative native) { + // ignore: invalid_use_of_internal_member + final options = hub.options; + + // ignore: invalid_use_of_internal_member + if ((options.profilesSampleRate ?? 0.0) <= 0.0) { + return; + } + + if (options.platformChecker.isWeb) { + return; + } + + if (options.platformChecker.platform.isMacOS || + options.platformChecker.platform.isIOS) { + // ignore: invalid_use_of_internal_member + hub.profilerFactory = SentryNativeProfilerFactory(native, options.clock); + } + } + + @override + SentryNativeProfiler? startProfiler(SentryTransactionContext context) { + if (context.traceId == SentryId.empty()) { + return null; + } + + final startTime = _native.startProfiler(context.traceId); + if (startTime == null) { + return null; + } + return SentryNativeProfiler(_native, startTime, context.traceId, _clock); + } +} + +// ignore: invalid_use_of_internal_member +class SentryNativeProfiler implements SentryProfiler { + final SentryNative _native; + final int _starTimeNs; + final SentryId _traceId; + bool _finished = false; + final ClockProvider _clock; + + SentryNativeProfiler( + this._native, this._starTimeNs, this._traceId, this._clock); + + @override + void dispose() { + if (!_finished) { + _finished = true; + _native.discardProfiler(_traceId); + } + } + + @override + Future finishFor( + SentryTransaction transaction) async { + if (_finished) { + return null; + } + _finished = true; + + // ignore: invalid_use_of_internal_member + final transactionEndTime = transaction.timestamp ?? _clock(); + final duration = transactionEndTime.difference(transaction.startTimestamp); + final endTimeNs = _starTimeNs + (duration.inMicroseconds * 1000); + + final payload = + await _native.collectProfile(_traceId, _starTimeNs, endTimeNs); + if (payload == null) { + return null; + } + + payload["transaction"]["id"] = transaction.eventId.toString(); + payload["transaction"]["trace_id"] = _traceId.toString(); + payload["transaction"]["name"] = transaction.transaction; + payload["timestamp"] = transaction.startTimestamp.toIso8601String(); + return SentryNativeProfileInfo(payload); + } +} + +// ignore: invalid_use_of_internal_member +class SentryNativeProfileInfo implements SentryProfileInfo { + final Map _payload; + // ignore: invalid_use_of_internal_member + late final List _data = utf8JsonEncoder.convert(_payload); + + SentryNativeProfileInfo(this._payload); + + @override + SentryEnvelopeItem asEnvelopeItem() { + final header = SentryEnvelopeItemHeader( + SentryItemType.profile, + () => Future.value(_data.length), + contentType: 'application/json', + ); + return SentryEnvelopeItem(header, () => Future.value(_data)); + } +} diff --git a/flutter/lib/src/renderer/html_renderer.dart b/flutter/lib/src/renderer/html_renderer.dart index b768a14c09..de41f5e77a 100644 --- a/flutter/lib/src/renderer/html_renderer.dart +++ b/flutter/lib/src/renderer/html_renderer.dart @@ -2,7 +2,7 @@ import 'dart:js' as js; import 'renderer.dart'; -FlutterRenderer getRenderer() { +FlutterRenderer? getRenderer() { return isCanvasKitRenderer ? FlutterRenderer.canvasKit : FlutterRenderer.html; } diff --git a/flutter/lib/src/renderer/io_renderer.dart b/flutter/lib/src/renderer/io_renderer.dart index 961feb7a1f..77322a4e08 100644 --- a/flutter/lib/src/renderer/io_renderer.dart +++ b/flutter/lib/src/renderer/io_renderer.dart @@ -1,5 +1,3 @@ import 'renderer.dart'; -FlutterRenderer getRenderer() { - return FlutterRenderer.skia; -} +FlutterRenderer? getRenderer() => null; diff --git a/flutter/lib/src/renderer/renderer.dart b/flutter/lib/src/renderer/renderer.dart index b1b9c2dd69..3e41eced70 100644 --- a/flutter/lib/src/renderer/renderer.dart +++ b/flutter/lib/src/renderer/renderer.dart @@ -6,14 +6,22 @@ import 'unknown_renderer.dart' @internal class RendererWrapper { - FlutterRenderer getRenderer() { + FlutterRenderer? getRenderer() { return implementation.getRenderer(); } } enum FlutterRenderer { + /// https://skia.org/ skia, + + /// https://docs.flutter.dev/perf/impeller + impeller, + + /// https://docs.flutter.dev/platform-integration/web/renderers canvasKit, + + /// https://docs.flutter.dev/platform-integration/web/renderers html, unknown, } diff --git a/flutter/lib/src/screenshot/sentry_screenshot_widget.dart b/flutter/lib/src/screenshot/sentry_screenshot_widget.dart index b11b511bb3..e83d46d0c5 100644 --- a/flutter/lib/src/screenshot/sentry_screenshot_widget.dart +++ b/flutter/lib/src/screenshot/sentry_screenshot_widget.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:meta/meta.dart'; +import '../../sentry_flutter.dart'; + /// Key which is used to identify the [RepaintBoundary] @internal final sentryScreenshotWidgetGlobalKey = @@ -22,21 +24,37 @@ final sentryScreenshotWidgetGlobalKey = /// - You can only have one [SentryScreenshotWidget] widget in your widget tree at all /// times. class SentryScreenshotWidget extends StatefulWidget { - const SentryScreenshotWidget({Key? key, required this.child}) - : super(key: key); - final Widget child; + late final Hub _hub; + + SentryFlutterOptions? get _options => + // ignore: invalid_use_of_internal_member + _hub.options is SentryFlutterOptions + // ignore: invalid_use_of_internal_member + ? _hub.options as SentryFlutterOptions + : null; + + SentryScreenshotWidget({ + super.key, + required this.child, + @internal Hub? hub, + }) : _hub = hub ?? HubAdapter(); @override _SentryScreenshotWidgetState createState() => _SentryScreenshotWidgetState(); } class _SentryScreenshotWidgetState extends State { + SentryFlutterOptions? get _options => widget._options; + @override Widget build(BuildContext context) { - return RepaintBoundary( - key: sentryScreenshotWidgetGlobalKey, - child: widget.child, - ); + if (_options?.attachScreenshot ?? false) { + return RepaintBoundary( + key: sentryScreenshotWidgetGlobalKey, + child: widget.child, + ); + } + return widget.child; } } diff --git a/flutter/lib/src/sentry_flutter.dart b/flutter/lib/src/sentry_flutter.dart index 860990b213..44bec28657 100644 --- a/flutter/lib/src/sentry_flutter.dart +++ b/flutter/lib/src/sentry_flutter.dart @@ -9,11 +9,13 @@ import '../sentry_flutter.dart'; import 'event_processor/android_platform_exception_event_processor.dart'; import 'event_processor/flutter_exception_event_processor.dart'; import 'event_processor/platform_exception_event_processor.dart'; +import 'integrations/connectivity/connectivity_integration.dart'; import 'integrations/screenshot_integration.dart'; -import 'native_scope_observer.dart'; +import 'native/factory.dart'; +import 'native/native_scope_observer.dart'; +import 'profiling.dart'; import 'renderer/renderer.dart'; -import 'sentry_native.dart'; -import 'sentry_native_channel.dart'; +import 'native/sentry_native.dart'; import 'integrations/integrations.dart'; import 'event_processor/flutter_enricher_event_processor.dart'; @@ -47,10 +49,9 @@ mixin SentryFlutter { flutterOptions.rendererWrapper = rendererWrapper; } - final nativeChannel = SentryNativeChannel(channel, flutterOptions); if (flutterOptions.platformChecker.hasNativeIntegration) { - final native = SentryNative(); - native.nativeChannel = nativeChannel; + final binding = createBinding(flutterOptions.platformChecker, channel); + _native = SentryNative(flutterOptions, binding); } final platformDispatcher = PlatformDispatcher.instance; @@ -81,9 +82,7 @@ mixin SentryFlutter { await _initDefaultValues(flutterOptions, channel); await Sentry.init( - (options) async { - await optionsConfiguration(options as SentryFlutterOptions); - }, + (options) => optionsConfiguration(options as SentryFlutterOptions), appRunner: appRunner, // ignore: invalid_use_of_internal_member options: flutterOptions, @@ -92,6 +91,11 @@ mixin SentryFlutter { // ignore: invalid_use_of_internal_member runZonedGuardedOnError: runZonedGuardedOnError, ); + + if (_native != null) { + // ignore: invalid_use_of_internal_member + SentryNativeProfilerFactory.attachTo(Sentry.currentHub, _native!); + } } static Future _initDefaultValues( @@ -101,9 +105,9 @@ mixin SentryFlutter { options.addEventProcessor(FlutterExceptionEventProcessor()); // Not all platforms have a native integration. - if (options.platformChecker.hasNativeIntegration) { + if (_native != null) { options.transport = FileSystemTransport(channel, options); - options.addScopeObserver(NativeScopeObserver(SentryNative())); + options.addScopeObserver(NativeScopeObserver(_native!)); } var flutterEventProcessor = FlutterEnricherEventProcessor(options); @@ -164,11 +168,14 @@ mixin SentryFlutter { integrations.add(LoadImageListIntegration(channel)); } final renderer = options.rendererWrapper.getRenderer(); - if (renderer == FlutterRenderer.skia || - renderer == FlutterRenderer.canvasKit) { + if (!platformChecker.isWeb || renderer == FlutterRenderer.canvasKit) { integrations.add(ScreenshotIntegration()); } + if (platformChecker.isWeb) { + integrations.add(ConnectivityIntegration()); + } + // works with Skia, CanvasKit and HTML renderer integrations.add(SentryViewHierarchyIntegration()); @@ -179,9 +186,9 @@ mixin SentryFlutter { // in errors. integrations.add(LoadReleaseIntegration()); - if (platformChecker.hasNativeIntegration) { + if (_native != null) { integrations.add(NativeAppStartIntegration( - SentryNative(), + _native!, () { try { /// Flutter >= 2.12 throws if SchedulerBinding.instance isn't initialized. @@ -207,7 +214,7 @@ mixin SentryFlutter { /// Manually set when your app finished startup. Make sure to set /// [SentryFlutterOptions.autoAppStart] to false on init. static void setAppStartEnd(DateTime appStartEnd) { - SentryNative().appStartEnd = appStartEnd; + _native?.appStartEnd = appStartEnd; } static void _setSdk(SentryFlutterOptions options) { @@ -221,4 +228,10 @@ mixin SentryFlutter { sdk.addPackage('pub:sentry_flutter', sdkVersion); options.sdk = sdk; } + + @internal + static SentryNative? get native => _native; + @internal + static set native(SentryNative? value) => _native = value; + static SentryNative? _native; } diff --git a/flutter/lib/src/sentry_flutter_options.dart b/flutter/lib/src/sentry_flutter_options.dart index a1d7755c3c..ee722f8e9e 100644 --- a/flutter/lib/src/sentry_flutter_options.dart +++ b/flutter/lib/src/sentry_flutter_options.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:meta/meta.dart'; import 'package:sentry/sentry.dart'; import 'package:flutter/widgets.dart'; @@ -5,13 +7,13 @@ import 'package:flutter/widgets.dart'; import 'binding_wrapper.dart'; import 'renderer/renderer.dart'; import 'screenshot/sentry_screenshot_quality.dart'; +import 'event_processor/screenshot_event_processor.dart'; -/// This class adds options which are only availble in a Flutter environment. +/// This class adds options which are only available in a Flutter environment. /// Note that some of these options require native Sentry integration, which is /// not available on all platforms. class SentryFlutterOptions extends SentryOptions { - SentryFlutterOptions({String? dsn, PlatformChecker? checker}) - : super(dsn: dsn, checker: checker) { + SentryFlutterOptions({super.dsn, super.checker}) { enableBreadcrumbTrackingForCurrentPlatform(); } @@ -167,6 +169,14 @@ class SentryFlutterOptions extends SentryOptions { /// The quality of the attached screenshot SentryScreenshotQuality screenshotQuality = SentryScreenshotQuality.high; + /// Only attach a screenshot when the app is resumed. + bool attachScreenshotOnlyWhenResumed = false; + + /// Sets a callback which is executed before capturing screenshots. Only + /// relevant if `attachScreenshot` is set to true. When false is returned + /// from the function, no screenshot will be attached. + BeforeScreenshotCallback? beforeScreenshot; + /// Enable or disable automatic breadcrumbs for User interactions Using [Listener] /// /// Requires adding the [SentryUserInteractionWidget] to the widget tree. @@ -263,4 +273,34 @@ class SentryFlutterOptions extends SentryOptions { /// Setting this to a custom [BindingWrapper] allows you to use a custom [WidgetsBinding]. @experimental BindingWrapper bindingUtils = BindingWrapper(); + + /// The sample rate for profiling traces in the range of 0.0 to 1.0. + /// This is relative to tracesSampleRate - it is a ratio of profiled traces out of all sampled traces. + /// At the moment, only apps targeting iOS and macOS are supported. + @override + @experimental + double? get profilesSampleRate { + // ignore: invalid_use_of_internal_member + return super.profilesSampleRate; + } + + /// The sample rate for profiling traces in the range of 0.0 to 1.0. + /// This is relative to tracesSampleRate - it is a ratio of profiled traces out of all sampled traces. + /// At the moment, only apps targeting iOS and macOS are supported. + @override + @experimental + set profilesSampleRate(double? value) { + // ignore: invalid_use_of_internal_member + super.profilesSampleRate = value; + } + + /// The [navigatorKey] is used to add information of the currently used locale to the contexts. + GlobalKey? navigatorKey; } + +/// Callback being executed in [ScreenshotEventProcessor], deciding if a +/// screenshot should be recorded and attached. +typedef BeforeScreenshotCallback = FutureOr Function( + SentryEvent event, { + Hint? hint, +}); diff --git a/flutter/lib/src/sentry_native.dart b/flutter/lib/src/sentry_native.dart deleted file mode 100644 index 3727294f74..0000000000 --- a/flutter/lib/src/sentry_native.dart +++ /dev/null @@ -1,100 +0,0 @@ -import 'dart:async'; - -import 'package:meta/meta.dart'; - -import '../sentry_flutter.dart'; -import 'sentry_native_channel.dart'; - -/// [SentryNative] holds state that it fetches from to the native SDKs. Always -/// use the shared instance with [SentryNative()]. -@internal -class SentryNative { - SentryNative._(); - - static final SentryNative _instance = SentryNative._(); - - SentryNativeChannel? _nativeChannel; - - factory SentryNative() { - return _instance; - } - - SentryNativeChannel? get nativeChannel => _instance._nativeChannel; - - /// Provide [nativeChannel] for native communication. - set nativeChannel(SentryNativeChannel? nativeChannel) { - _instance._nativeChannel = nativeChannel; - } - - // AppStart - - /// This timestamp marks the end of app startup. Either set automatically when - /// [SentryFlutterOptions.autoAppStart] is true, or by calling - /// [SentryFlutter.setAppStartEnd] - DateTime? appStartEnd; - - bool _didFetchAppStart = false; - - /// Flag indicating if app start was already fetched. - bool get didFetchAppStart => _didFetchAppStart; - - /// Fetch [NativeAppStart] from native channels. Can only be called once. - Future fetchNativeAppStart() async { - _didFetchAppStart = true; - return await _nativeChannel?.fetchNativeAppStart(); - } - - // NativeFrames - - Future beginNativeFramesCollection() async { - await _nativeChannel?.beginNativeFrames(); - } - - Future endNativeFramesCollection(SentryId traceId) async { - return await _nativeChannel?.endNativeFrames(traceId); - } - - // Scope - - Future setContexts(String key, dynamic value) async { - return await _nativeChannel?.setContexts(key, value); - } - - Future removeContexts(String key) async { - return await _nativeChannel?.removeContexts(key); - } - - Future setUser(SentryUser? sentryUser) async { - return await _nativeChannel?.setUser(sentryUser); - } - - Future addBreadcrumb(Breadcrumb breadcrumb) async { - return await _nativeChannel?.addBreadcrumb(breadcrumb); - } - - Future clearBreadcrumbs() async { - return await _nativeChannel?.clearBreadcrumbs(); - } - - Future setExtra(String key, dynamic value) async { - return await _nativeChannel?.setExtra(key, value); - } - - Future removeExtra(String key) async { - return await _nativeChannel?.removeExtra(key); - } - - Future setTag(String key, String value) async { - return await _nativeChannel?.setTag(key, value); - } - - Future removeTag(String key) async { - return await _nativeChannel?.removeTag(key); - } - - /// Reset state - void reset() { - appStartEnd = null; - _didFetchAppStart = false; - } -} diff --git a/flutter/lib/src/sentry_native_channel.dart b/flutter/lib/src/sentry_native_channel.dart deleted file mode 100644 index 575e43b618..0000000000 --- a/flutter/lib/src/sentry_native_channel.dart +++ /dev/null @@ -1,161 +0,0 @@ -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -import '../sentry_flutter.dart'; - -/// Provide typed methods to access native layer. -@internal -class SentryNativeChannel { - SentryNativeChannel(this._channel, this._options); - - final MethodChannel _channel; - final SentryFlutterOptions _options; - - // TODO Move other native calls here. - - Future fetchNativeAppStart() async { - try { - final json = await _channel - .invokeMapMethod('fetchNativeAppStart'); - return (json != null) ? NativeAppStart.fromJson(json) : null; - } catch (error, stackTrace) { - _logError('fetchNativeAppStart', error, stackTrace); - return null; - } - } - - Future beginNativeFrames() async { - try { - await _channel.invokeMethod('beginNativeFrames'); - } catch (error, stackTrace) { - _logError('beginNativeFrames', error, stackTrace); - } - } - - Future endNativeFrames(SentryId id) async { - try { - final json = await _channel.invokeMapMethod( - 'endNativeFrames', {'id': id.toString()}); - return (json != null) ? NativeFrames.fromJson(json) : null; - } catch (error, stackTrace) { - _logError('endNativeFrames', error, stackTrace); - return null; - } - } - - Future setUser(SentryUser? user) async { - try { - await _channel.invokeMethod('setUser', {'user': user?.toJson()}); - } catch (error, stackTrace) { - _logError('setUser', error, stackTrace); - } - } - - Future addBreadcrumb(Breadcrumb breadcrumb) async { - try { - await _channel - .invokeMethod('addBreadcrumb', {'breadcrumb': breadcrumb.toJson()}); - } catch (error, stackTrace) { - _logError('addBreadcrumb', error, stackTrace); - } - } - - Future clearBreadcrumbs() async { - try { - await _channel.invokeMethod('clearBreadcrumbs'); - } catch (error, stackTrace) { - _logError('clearBreadcrumbs', error, stackTrace); - } - } - - Future setContexts(String key, dynamic value) async { - try { - await _channel.invokeMethod('setContexts', {'key': key, 'value': value}); - } catch (error, stackTrace) { - _logError('setContexts', error, stackTrace); - } - } - - Future removeContexts(String key) async { - try { - await _channel.invokeMethod('removeContexts', {'key': key}); - } catch (error, stackTrace) { - _logError('removeContexts', error, stackTrace); - } - } - - Future setExtra(String key, dynamic value) async { - try { - await _channel.invokeMethod('setExtra', {'key': key, 'value': value}); - } catch (error, stackTrace) { - _logError('setExtra', error, stackTrace); - } - } - - Future removeExtra(String key) async { - try { - await _channel.invokeMethod('removeExtra', {'key': key}); - } catch (error, stackTrace) { - _logError('removeExtra', error, stackTrace); - } - } - - Future setTag(String key, dynamic value) async { - try { - await _channel.invokeMethod('setTag', {'key': key, 'value': value}); - } catch (error, stackTrace) { - _logError('setTag', error, stackTrace); - } - } - - Future removeTag(String key) async { - try { - await _channel.invokeMethod('removeTag', {'key': key}); - } catch (error, stackTrace) { - _logError('removeTag', error, stackTrace); - } - } - - // Helper - - void _logError(String nativeMethodName, Object error, StackTrace stackTrace) { - _options.logger( - SentryLevel.error, - 'Native call `$nativeMethodName` failed', - exception: error, - stackTrace: stackTrace, - ); - } -} - -class NativeAppStart { - NativeAppStart(this.appStartTime, this.isColdStart); - - double appStartTime; - bool isColdStart; - - factory NativeAppStart.fromJson(Map json) { - return NativeAppStart( - json['appStartTime'] as double, - json['isColdStart'] as bool, - ); - } -} - -class NativeFrames { - NativeFrames(this.totalFrames, this.slowFrames, this.frozenFrames); - - int totalFrames; - int slowFrames; - int frozenFrames; - - factory NativeFrames.fromJson(Map json) { - return NativeFrames( - json['totalFrames'] as int, - json['slowFrames'] as int, - json['frozenFrames'] as int, - ); - } -} diff --git a/flutter/lib/src/sentry_widget.dart b/flutter/lib/src/sentry_widget.dart new file mode 100644 index 0000000000..ed390d1ab4 --- /dev/null +++ b/flutter/lib/src/sentry_widget.dart @@ -0,0 +1,23 @@ +import 'package:flutter/cupertino.dart'; +import '../sentry_flutter.dart'; + +/// This widget serves as a wrapper to include Sentry widgets such +/// as [SentryScreenshotWidget] and [SentryUserInteractionWidget]. +class SentryWidget extends StatefulWidget { + final Widget child; + + const SentryWidget({super.key, required this.child}); + + @override + _SentryWidgetState createState() => _SentryWidgetState(); +} + +class _SentryWidgetState extends State { + @override + Widget build(BuildContext context) { + Widget content = widget.child; + content = SentryScreenshotWidget(child: content); + content = SentryUserInteractionWidget(child: content); + return content; + } +} diff --git a/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart b/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart index 46b25e5cb3..018f750a2e 100644 --- a/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart +++ b/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart @@ -234,10 +234,10 @@ Element? _clickTrackerElement; /// [SentryUserInteractionWidget] as a child of [SentryScreenshotWidget]. class SentryUserInteractionWidget extends StatefulWidget { SentryUserInteractionWidget({ - Key? key, + super.key, required this.child, @internal Hub? hub, - }) : super(key: key) { + }) { _hub = hub ?? HubAdapter(); if (_options?.enableUserInteractionTracing ?? false) { @@ -281,12 +281,16 @@ class _SentryUserInteractionWidgetState @override Widget build(BuildContext context) { - return Listener( - behavior: HitTestBehavior.translucent, - onPointerDown: _onPointerDown, - onPointerUp: _onPointerUp, - child: widget.child, - ); + if ((_options?.enableUserInteractionTracing ?? true) || + (_options?.enableUserInteractionBreadcrumbs ?? true)) { + return Listener( + behavior: HitTestBehavior.translucent, + onPointerDown: _onPointerDown, + onPointerUp: _onPointerUp, + child: widget.child, + ); + } + return widget.child; } void _onPointerDown(PointerDownEvent event) { diff --git a/flutter/lib/src/version.dart b/flutter/lib/src/version.dart index 0da840e5b1..078ad6a08f 100644 --- a/flutter/lib/src/version.dart +++ b/flutter/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.9.0'; +const String sdkVersion = '7.16.0'; /// The default SDK name reported to Sentry.io in the submitted events. const String sdkName = 'sentry.dart.flutter'; diff --git a/flutter/macos/Classes/SentryFlutter.swift b/flutter/macos/Classes/SentryFlutter.swift new file mode 120000 index 0000000000..ea42d8c01c --- /dev/null +++ b/flutter/macos/Classes/SentryFlutter.swift @@ -0,0 +1 @@ +../../ios/Classes/SentryFlutter.swift \ No newline at end of file diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index f49fb9ca53..9757dbd698 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: sentry_flutter -version: 7.9.0 +version: 7.16.0 description: Sentry SDK for Flutter. This package aims to support different Flutter targets by relying on the many platforms supported by Sentry with native SDKs. homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart @@ -15,9 +15,10 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - sentry: 7.9.0 - package_info_plus: '>=1.0.0 <5.0.0' + sentry: 7.16.0 + package_info_plus: '>=1.0.0 <=5.0.1' meta: ^1.3.0 + ffi: ^2.0.0 dev_dependencies: build_runner: ^2.4.2 @@ -25,7 +26,11 @@ dev_dependencies: sdk: flutter mockito: ^5.1.0 yaml: ^3.1.0 # needed for version match (code and pubspec) - flutter_lints: ^2.0.0 + flutter_lints: ^3.0.0 + collection: ^1.16.0 + remove_from_coverage: ^2.0.0 + flutter_localizations: + sdk: flutter flutter: plugin: diff --git a/flutter/scripts/generate-cocoa-bindings.sh b/flutter/scripts/generate-cocoa-bindings.sh new file mode 100755 index 0000000000..3381089df5 --- /dev/null +++ b/flutter/scripts/generate-cocoa-bindings.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ -n ${CI:+x} ]]; then + echo "Running in CI so we need to set up Flutter SDK first" + curl -Lv https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.13.3-stable.zip --output /tmp/flutter.zip + unzip -q /tmp/flutter.zip -d /tmp + export PATH=":/tmp/flutter/bin:$PATH" + which flutter + flutter --version +fi + +cocoa_version="${1:-$(./scripts/update-cocoa.sh get-version)}" + +cd "$(dirname "$0")/../" + +# Remove dependency on script exit (even in case of an error). +trap "dart pub remove ffigen" EXIT + +# Currently we add the dependency only when the code needs to be generated because it depends +# on Dart SDK 3.2.0 which isn't available on with Flutter stable yet. +# Leaving the dependency in pubspec would block all contributors. +# As for why this is coming from a fork - because we need a specific version of ffigen including PR 607 but not PR 601 +# which starts generating code not compatible with Dart SDK 2.17. The problem is they were merged in the wrong order... +dart pub add 'dev:ffigen:{"git":{"url":"https://github.com/getsentry/ffigen","ref":"6aa2c2642f507eab3df83373189170797a9fa5e7"}}' + +# Download Cocoa SDK (we need the headers) +temp="cocoa_bindings_temp" +rm -rf $temp +mkdir -p $temp +curl -Lv https://github.com/getsentry/sentry-cocoa/releases/download/$cocoa_version/Sentry.xcframework.zip -o $temp/Sentry.xcframework.zip +subdir="Carthage/Build/Sentry.xcframework/macos-arm64_x86_64/Sentry.framework" +unzip -q $temp/Sentry.xcframework.zip "$subdir/*" -d $temp +mv "$temp/$subdir" $temp/Sentry.framework + +dart run ffigen --config ffi-cocoa.yaml +sed -i.bak 's|final class|class|g' lib/src/native/cocoa/binding.dart +rm lib/src/native/cocoa/binding.dart.bak diff --git a/flutter/scripts/update-cocoa.sh b/flutter/scripts/update-cocoa.sh index ebe557c405..d54a754399 100755 --- a/flutter/scripts/update-cocoa.sh +++ b/flutter/scripts/update-cocoa.sh @@ -20,6 +20,7 @@ get-repo) set-version) newValue="${BASH_REMATCH[1]}'$2'" echo "${content/${BASH_REMATCH[0]}/$newValue}" >$file + ../scripts/generate-cocoa-bindings.sh "$2" ;; *) echo "Unknown argument $1" diff --git a/flutter/test/android_platform_exception_event_processor_test.dart b/flutter/test/android_platform_exception_event_processor_test.dart index 0ac142922a..5e916f06a3 100644 --- a/flutter/test/android_platform_exception_event_processor_test.dart +++ b/flutter/test/android_platform_exception_event_processor_test.dart @@ -30,7 +30,7 @@ void main() { .apply(fixture.eventWithPlatformStackTrace, Hint()); final exceptions = platformExceptionEvent!.exceptions!; - expect(exceptions.length, 2); + expect(exceptions.length, 3); final platformException = exceptions[1]; @@ -40,6 +40,15 @@ void main() { "Unsupported value: '[Ljava.lang.StackTraceElement;@ba6feed' of type 'class [Ljava.lang.StackTraceElement;'", ); expect(platformException.stackTrace!.frames.length, 18); + + final platformException_2 = exceptions[2]; + + expect(platformException_2.type, 'IllegalArgumentException'); + expect( + platformException_2.value, + "Unsupported value: '[Ljava.lang.StackTraceElement;@ba6feed' of type 'class [Ljava.lang.StackTraceElement;'", + ); + expect(platformException_2.stackTrace!.frames.length, 18); }); test( @@ -49,7 +58,7 @@ void main() { .apply(fixture.eventWithPlatformStackTrace, Hint()); final exceptions = platformExceptionEvent!.exceptions!; - expect(exceptions.length, 2); + expect(exceptions.length, 3); expect(platformExceptionEvent.threads?.first.current, true); expect(platformExceptionEvent.threads?.first.crashed, false); @@ -60,7 +69,7 @@ void main() { .apply(fixture.eventWithPlatformStackTrace, Hint()); final exceptions = platformExceptionEvent!.exceptions!; - expect(exceptions.length, 2); + expect(exceptions.length, 3); final platformException = exceptions[1]; final platformThread = platformExceptionEvent.threads?[1]; @@ -80,7 +89,7 @@ void main() { .apply(fixture.eventWithPlatformStackTrace, Hint()); final exceptions = platformExceptionEvent!.exceptions!; - expect(exceptions.length, 2); + expect(exceptions.length, 3); expect(platformExceptionEvent.threads?.length, threadCount); }); @@ -145,12 +154,23 @@ class Fixture { } final testPlatformException = PlatformException( + code: 'error', + details: + "Unsupported value: '[Ljava.lang.StackTraceElement;@fa902f1' of type 'class [Ljava.lang.StackTraceElement;'", + message: _jvmStackTrace, + stacktrace: _jvmStackTrace, +); + +final emptyPlatformException = PlatformException( code: 'error', details: "Unsupported value: '[Ljava.lang.StackTraceElement;@fa902f1' of type 'class [Ljava.lang.StackTraceElement;'", message: null, - stacktrace: - """java.lang.IllegalArgumentException: Unsupported value: '[Ljava.lang.StackTraceElement;@ba6feed' of type 'class [Ljava.lang.StackTraceElement;' + stacktrace: null, +); + +const _jvmStackTrace = + """java.lang.IllegalArgumentException: Unsupported value: '[Ljava.lang.StackTraceElement;@ba6feed' of type 'class [Ljava.lang.StackTraceElement;' at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:292) at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:59) at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler\$1.success(MethodChannel.java:267) @@ -168,13 +188,4 @@ final testPlatformException = PlatformException( at android.app.ActivityThread.main(ActivityThread.java:8138) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit\$MethodAndArgsCaller.run(RuntimeInit.java:556) - at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)""", -); - -final emptyPlatformException = PlatformException( - code: 'error', - details: - "Unsupported value: '[Ljava.lang.StackTraceElement;@fa902f1' of type 'class [Ljava.lang.StackTraceElement;'", - message: null, - stacktrace: null, -); + at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)"""; diff --git a/flutter/test/event_processor/flutter_enricher_event_processor_test.dart b/flutter/test/event_processor/flutter_enricher_event_processor_test.dart index 72ff0fc1cb..892e7ff517 100644 --- a/flutter/test/event_processor/flutter_enricher_event_processor_test.dart +++ b/flutter/test/event_processor/flutter_enricher_event_processor_test.dart @@ -1,9 +1,11 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; + // backcompatibility for Flutter < 3.3 // ignore: unnecessary_import import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -22,7 +24,38 @@ void main() { fixture = Fixture(); }); - testWidgets('flutter context', (WidgetTester tester) async { + testWidgets('flutter context on dart:io', (WidgetTester tester) async { + if (kIsWeb) { + // widget tests don't support onPlatform config + // https://pub.dev/packages/test#platform-specific-configuration + return; + } + // These two values need to be changed inside the test, + // otherwise the Flutter test framework complains that these + // values are changed outside of a test. + debugBrightnessOverride = Brightness.dark; + debugDefaultTargetPlatformOverride = TargetPlatform.android; + final enricher = fixture.getSut( + binding: () => tester.binding, + ); + + final event = await enricher.apply(SentryEvent(), Hint()); + + debugBrightnessOverride = null; + debugDefaultTargetPlatformOverride = null; + + final flutterContext = event?.contexts['flutter_context']; + expect(flutterContext, isNotNull); + expect(flutterContext, isA>()); + }, skip: !kIsWeb); + + testWidgets('flutter context on web', (WidgetTester tester) async { + if (!kIsWeb) { + // widget tests don't support onPlatform config + // https://pub.dev/packages/test#platform-specific-configuration + return; + } + // These two values need to be changed inside the test, // otherwise the Flutter test framework complains that these // values are changed outside of a test. @@ -73,6 +106,38 @@ void main() { expect(culture?.timezone, isNotNull); }); + testWidgets( + 'GIVEN MaterialApp WHEN setting locale and sentryNavigatorKey THEN enrich event culture with selected locale', + (WidgetTester tester) async { + GlobalKey navigatorKey = GlobalKey(); + + await tester.pumpWidget(MaterialApp( + navigatorKey: navigatorKey, + home: Material(), + localizationsDelegates: const [ + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: const [ + Locale('en', 'US'), + Locale('de', 'DE'), + ], + locale: const Locale('de', 'DE'), + )); + + final enricher = fixture.getSut( + binding: () => tester.binding, + optionsBuilder: (options) { + options.navigatorKey = navigatorKey; + return options; + }, + ); + + final event = await enricher.apply(SentryEvent(), Hint()); + + expect(event?.contexts.culture?.locale, 'de-DE'); + }); + testWidgets('app context in foreground', (WidgetTester tester) async { final enricher = fixture.getSut( binding: () => tester.binding, @@ -322,6 +387,24 @@ void main() { .length; expect(ioEnricherCount, 1); }); + + testWidgets('adds SentryNavigatorObserver.currentRouteName as app.screen', + (tester) async { + final observer = SentryNavigatorObserver(); + final route = + fixture.route(RouteSettings(name: 'fixture-currentRouteName')); + observer.didPush(route, null); + + final eventWithContextsApp = + SentryEvent(contexts: Contexts(app: SentryApp())); + + final enricher = fixture.getSut( + binding: () => tester.binding, + ); + final event = await enricher.apply(eventWithContextsApp, Hint()); + + expect(event?.contexts.app?.viewNames, ['fixture-currentRouteName']); + }); }); } @@ -331,17 +414,25 @@ class Fixture { PlatformChecker? checker, bool hasNativeIntegration = false, bool reportPackages = true, + SentryFlutterOptions Function(SentryFlutterOptions)? optionsBuilder, }) { final platformChecker = checker ?? MockPlatformChecker( hasNativeIntegration: hasNativeIntegration, ); + final options = SentryFlutterOptions( dsn: fakeDsn, checker: platformChecker, )..reportPackages = reportPackages; - return FlutterEnricherEventProcessor(options); + final customizedOptions = optionsBuilder?.call(options) ?? options; + return FlutterEnricherEventProcessor(customizedOptions); } + + PageRoute route(RouteSettings? settings) => PageRouteBuilder( + pageBuilder: (_, __, ___) => Container(), + settings: settings, + ); } void loadTestPackage() { diff --git a/flutter/test/event_processor/screenshot_event_processor_test.dart b/flutter/test/event_processor/screenshot_event_processor_test.dart index 6101217a04..2c1d0a4adc 100644 --- a/flutter/test/event_processor/screenshot_event_processor_test.dart +++ b/flutter/test/event_processor/screenshot_event_processor_test.dart @@ -14,24 +14,32 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); late Fixture fixture; + late SentryEvent event; + late Hint hint; + setUp(() { fixture = Fixture(); }); Future _addScreenshotAttachment( - WidgetTester tester, FlutterRenderer renderer, bool added, - {int? expectedMaxWidthOrHeight}) async { + WidgetTester tester, + FlutterRenderer? renderer, { + required bool isWeb, + required bool added, + int? expectedMaxWidthOrHeight, + }) async { // Run with real async https://stackoverflow.com/a/54021863 await tester.runAsync(() async { - final sut = fixture.getSut(renderer); + final sut = fixture.getSut(renderer, isWeb); await tester.pumpWidget(SentryScreenshotWidget( + hub: fixture.hub, child: Text('Catching Pokémon is a snap!', textDirection: TextDirection.ltr))); final throwable = Exception(); - final event = SentryEvent(throwable: throwable); - final hint = Hint(); + event = SentryEvent(throwable: throwable); + hint = Hint(); await sut.apply(event, hint); expect(hint.screenshot != null, added); @@ -48,55 +56,141 @@ void main() { }); } - testWidgets('adds screenshot attachment with skia renderer', (tester) async { - await _addScreenshotAttachment(tester, FlutterRenderer.skia, true); + testWidgets('adds screenshot attachment dart:io', (tester) async { + await _addScreenshotAttachment(tester, null, added: true, isWeb: false); }); testWidgets('adds screenshot attachment with canvasKit renderer', (tester) async { - await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, true); + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: true, isWeb: true); }); testWidgets('does not add screenshot attachment with html renderer', (tester) async { - await _addScreenshotAttachment(tester, FlutterRenderer.html, false); - }); - - testWidgets('does not add screenshot attachment with unknown renderer', - (tester) async { - await _addScreenshotAttachment(tester, FlutterRenderer.unknown, false); + await _addScreenshotAttachment(tester, FlutterRenderer.html, + added: false, isWeb: true); }); testWidgets('does add screenshot in correct resolution for low', (tester) async { final height = SentryScreenshotQuality.low.targetResolution()!; fixture.options.screenshotQuality = SentryScreenshotQuality.low; - await _addScreenshotAttachment(tester, FlutterRenderer.skia, true, - expectedMaxWidthOrHeight: height); + await _addScreenshotAttachment(tester, null, + added: true, isWeb: false, expectedMaxWidthOrHeight: height); }); testWidgets('does add screenshot in correct resolution for medium', (tester) async { final height = SentryScreenshotQuality.medium.targetResolution()!; fixture.options.screenshotQuality = SentryScreenshotQuality.medium; - await _addScreenshotAttachment(tester, FlutterRenderer.skia, true, - expectedMaxWidthOrHeight: height); + await _addScreenshotAttachment(tester, null, + added: true, isWeb: false, expectedMaxWidthOrHeight: height); }); testWidgets('does add screenshot in correct resolution for high', (tester) async { final widthOrHeight = SentryScreenshotQuality.high.targetResolution()!; fixture.options.screenshotQuality = SentryScreenshotQuality.high; - await _addScreenshotAttachment(tester, FlutterRenderer.skia, true, - expectedMaxWidthOrHeight: widthOrHeight); + await _addScreenshotAttachment(tester, null, + added: true, isWeb: false, expectedMaxWidthOrHeight: widthOrHeight); + }); + + group('beforeScreenshot', () { + testWidgets('does add screenshot if beforeScreenshot returns true', + (tester) async { + fixture.options.beforeScreenshot = (SentryEvent event, {Hint? hint}) { + return true; + }; + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: true, isWeb: false); + }); + + testWidgets('does add screenshot if async beforeScreenshot returns true', + (tester) async { + fixture.options.beforeScreenshot = + (SentryEvent event, {Hint? hint}) async { + await Future.delayed(Duration(milliseconds: 1)); + return true; + }; + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: true, isWeb: false); + }); + + testWidgets('does not add screenshot if beforeScreenshot returns false', + (tester) async { + fixture.options.beforeScreenshot = (SentryEvent event, {Hint? hint}) { + return false; + }; + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: false, isWeb: false); + }); + + testWidgets( + 'does not add screenshot if async beforeScreenshot returns false', + (tester) async { + fixture.options.beforeScreenshot = + (SentryEvent event, {Hint? hint}) async { + await Future.delayed(Duration(milliseconds: 1)); + return false; + }; + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: false, isWeb: false); + }); + + testWidgets('does add screenshot if beforeScreenshot throws', + (tester) async { + fixture.options.beforeScreenshot = (SentryEvent event, {Hint? hint}) { + throw Error(); + }; + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: true, isWeb: false); + }); + + testWidgets('does add screenshot if async beforeScreenshot throws', + (tester) async { + fixture.options.beforeScreenshot = + (SentryEvent event, {Hint? hint}) async { + await Future.delayed(Duration(milliseconds: 1)); + throw Error(); + }; + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: true, isWeb: false); + }); + + testWidgets('passes event & hint to beforeScreenshot callback', + (tester) async { + SentryEvent? beforeScreenshotEvent; + Hint? beforeScreenshotHint; + + fixture.options.beforeScreenshot = (SentryEvent event, {Hint? hint}) { + beforeScreenshotEvent = event; + beforeScreenshotHint = hint; + return true; + }; + + await _addScreenshotAttachment(tester, FlutterRenderer.canvasKit, + added: true, isWeb: false); + + expect(beforeScreenshotEvent, event); + expect(beforeScreenshotHint, hint); + }); }); } class Fixture { + late Hub hub; SentryFlutterOptions options = SentryFlutterOptions(dsn: fakeDsn); - ScreenshotEventProcessor getSut(FlutterRenderer flutterRenderer) { + Fixture() { + options.attachScreenshot = true; + hub = Hub(options); + } + + ScreenshotEventProcessor getSut( + FlutterRenderer? flutterRenderer, bool isWeb) { options.rendererWrapper = MockRendererWrapper(flutterRenderer); + options.platformChecker = MockPlatformChecker(isWebValue: isWeb); return ScreenshotEventProcessor(options); } } diff --git a/flutter/test/initialization_test.dart b/flutter/test/initialization_test.dart index cf1374df37..29d5e42c96 100644 --- a/flutter/test/initialization_test.dart +++ b/flutter/test/initialization_test.dart @@ -18,7 +18,7 @@ void main() { (options) { options.dsn = fakeDsn; // ignore: invalid_use_of_internal_member - options.devMode = true; + options.automatedTestMode = true; }, ); @@ -28,7 +28,7 @@ void main() { (options) { options.dsn = fakeDsn; // ignore: invalid_use_of_internal_member - options.devMode = true; + options.automatedTestMode = true; }, ); @@ -42,7 +42,7 @@ void main() { (options) { options.dsn = fakeDsn; // ignore: invalid_use_of_internal_member - options.devMode = true; + options.automatedTestMode = true; }, ); @@ -52,7 +52,7 @@ void main() { (options) { options.dsn = fakeDsn; // ignore: invalid_use_of_internal_member - options.devMode = true; + options.automatedTestMode = true; }, ); diff --git a/flutter/test/integrations/connectivity_integration_test.dart b/flutter/test/integrations/connectivity_integration_test.dart new file mode 100644 index 0000000000..2f0781e9ec --- /dev/null +++ b/flutter/test/integrations/connectivity_integration_test.dart @@ -0,0 +1,56 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_flutter/src/integrations/connectivity/connectivity_integration.dart'; +import 'package:sentry_flutter/src/sentry_flutter_options.dart'; + +import '../mocks.dart'; +import '../mocks.mocks.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + + late Fixture fixture; + + setUp(() { + fixture = Fixture(); + }); + + verifyBreadcrumb(Breadcrumb crumb, String connectivityData) { + expect(crumb.category, 'device.connectivity'); + expect(crumb.type, 'connectivity'); + expect(crumb.level, SentryLevel.info); + expect(crumb.data?['connectivity'], connectivityData); + } + + test('adds integration', () { + final sut = fixture.getSut(); + sut(fixture.hub, fixture.options); + + expect(fixture.options.sdk.integrations.contains('connectivityIntegration'), + true); + }); + + test('$ConnectivityIntegration: addsBreadcrumb', () { + final integration = fixture.getSut(); + integration.call(fixture.hub, fixture.options); + + integration.addBreadcrumb('wifi'); + + final crumb = verify( + fixture.hub.addBreadcrumb(captureAny), + ).captured.first as Breadcrumb; + + verifyBreadcrumb(crumb, 'wifi'); + }); +} + +class Fixture { + final hub = MockHub(); + final options = SentryFlutterOptions(dsn: fakeDsn); + + ConnectivityIntegration getSut() { + return ConnectivityIntegration(); + } +} diff --git a/flutter/test/integrations/flutter_error_integration_test.dart b/flutter/test/integrations/flutter_error_integration_test.dart index 43df8de278..401b606bc4 100644 --- a/flutter/test/integrations/flutter_error_integration_test.dart +++ b/flutter/test/integrations/flutter_error_integration_test.dart @@ -246,6 +246,20 @@ void main() { await span?.finish(); }); + + test('captures error with level error', () async { + final exception = StateError('error'); + + fixture.options.markAutomaticallyCollectedErrorsAsFatal = false; + + _reportError(exception: exception); + + final event = verify( + await fixture.hub.captureEvent(captureAny, hint: anyNamed('hint')), + ).captured.first as SentryEvent; + + expect(event.level, SentryLevel.error); + }); }); } diff --git a/flutter/test/integrations/load_image_list_test.dart b/flutter/test/integrations/load_image_list_test.dart index 1b82a3332e..b02acc94f3 100644 --- a/flutter/test/integrations/load_image_list_test.dart +++ b/flutter/test/integrations/load_image_list_test.dart @@ -187,12 +187,7 @@ void main() { SentryEvent _getEvent() { final frame = SentryStackFrame(platform: 'native'); final st = SentryStackTrace(frames: [frame]); - final ex = SentryException( - type: 'type', - value: 'value', - stackTrace: st, - ); - return SentryEvent(exceptions: [ex]); + return SentryEvent(threads: [SentryThread(stacktrace: st)]); } class Fixture { diff --git a/flutter/test/integrations/native_app_start_integration_test.dart b/flutter/test/integrations/native_app_start_integration_test.dart index 467ac9bb55..d16815bbe4 100644 --- a/flutter/test/integrations/native_app_start_integration_test.dart +++ b/flutter/test/integrations/native_app_start_integration_test.dart @@ -4,8 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/integrations/native_app_start_integration.dart'; -import 'package:sentry_flutter/src/sentry_native.dart'; -import 'package:sentry_flutter/src/sentry_native_channel.dart'; +import 'package:sentry_flutter/src/native/sentry_native.dart'; import 'package:sentry/src/sentry_tracer.dart'; import '../mocks.dart'; @@ -24,7 +23,7 @@ void main() { test('native app start measurement added to first transaction', () async { fixture.options.autoAppStart = false; fixture.native.appStartEnd = DateTime.fromMillisecondsSinceEpoch(10); - fixture.wrapper.nativeAppStart = NativeAppStart(0, true); + fixture.binding.nativeAppStart = NativeAppStart(0, true); fixture.getNativeAppStartIntegration().call(fixture.hub, fixture.options); @@ -44,7 +43,7 @@ void main() { () async { fixture.options.autoAppStart = false; fixture.native.appStartEnd = DateTime.fromMillisecondsSinceEpoch(10); - fixture.wrapper.nativeAppStart = NativeAppStart(0, true); + fixture.binding.nativeAppStart = NativeAppStart(0, true); fixture.getNativeAppStartIntegration().call(fixture.hub, fixture.options); @@ -64,7 +63,7 @@ void main() { test('measurements appended', () async { fixture.options.autoAppStart = false; fixture.native.appStartEnd = DateTime.fromMillisecondsSinceEpoch(10); - fixture.wrapper.nativeAppStart = NativeAppStart(0, true); + fixture.binding.nativeAppStart = NativeAppStart(0, true); final measurement = SentryMeasurement.warmAppStart(Duration(seconds: 1)); fixture.getNativeAppStartIntegration().call(fixture.hub, fixture.options); @@ -87,7 +86,7 @@ void main() { test('native app start measurement not added if more than 60s', () async { fixture.options.autoAppStart = false; fixture.native.appStartEnd = DateTime.fromMillisecondsSinceEpoch(60001); - fixture.wrapper.nativeAppStart = NativeAppStart(0, true); + fixture.binding.nativeAppStart = NativeAppStart(0, true); fixture.getNativeAppStartIntegration().call(fixture.hub, fixture.options); @@ -106,11 +105,10 @@ void main() { class Fixture { final hub = MockHub(); final options = SentryFlutterOptions(dsn: fakeDsn); - final wrapper = MockNativeChannel(); - late final native = SentryNative(); + final binding = MockNativeChannel(); + late final native = SentryNative(options, binding); Fixture() { - native.nativeChannel = wrapper; native.reset(); when(hub.options).thenReturn(options); } diff --git a/flutter/test/jvm/jvm_exception_test.dart b/flutter/test/jvm/jvm_exception_test.dart index 3202da097d..de8a3b4e29 100644 --- a/flutter/test/jvm/jvm_exception_test.dart +++ b/flutter/test/jvm/jvm_exception_test.dart @@ -40,7 +40,7 @@ void main() { 'Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]'); expect(thirdCause.thread, null); expect(thirdCause.type, 'java.sql.SQLException'); - expect(thirdCause.stackTrace.length, 6); + expect(thirdCause.stackTrace.length, 5); expect(thirdCause.causes, null); expect(thirdCause.suppressed, null); }); @@ -85,6 +85,16 @@ void main() { expect(exception.stackTrace[0].fileName, 'StandardMessageCodec.java'); expect(exception.stackTrace[0].lineNumber, 292); }); + + test('parse drops empty frames', () { + final exception = JvmException.parse(platformExceptionWithEmptyStackFrames); + expect(exception.stackTrace.length, 13); + expect(exception.stackTrace.last.className, + 'com.android.internal.os.ZygoteInit'); + expect(exception.stackTrace.last.fileName, 'ZygoteInit.java'); + expect(exception.stackTrace.last.method, 'main'); + expect(exception.stackTrace.last.lineNumber, 936); + }); } const javaExceptionWithCauses = ''' @@ -194,3 +204,21 @@ java.lang.IllegalArgumentException: Unsupported value: '[Ljava.lang.StackTraceEl at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit\$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)'''; + +const platformExceptionWithEmptyStackFrames = ''' +java.lang.RuntimeException: Catch this platform exception! + at io.sentry.samples.flutter.MainActivity\$configureFlutterEngine\$1.onMethodCall(MainActivity.kt:40) + at io.flutter.plugin.common.MethodChannel\$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) + at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) + at io.flutter.embedding.engine.dart.DartMessenger.lambda\$dispatchMessageToQueue\$0\$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) + at io.flutter.embedding.engine.dart.DartMessenger\$\$ExternalSyntheticLambda0.run(Unknown Source:12) + at android.os.Handler.handleCallback(Handler.java:942) + at android.os.Handler.dispatchMessage(Handler.java:99) + at android.os.Looper.loopOnce(Looper.java:201) + at android.os.Looper.loop(Looper.java:288) + at android.app.ActivityThread.main(ActivityThread.java:7872) + at java.lang.reflect.Method.invoke + at com.android.internal.os.RuntimeInit\$MethodAndArgsCaller.run(RuntimeInit.java:548) + at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) + + '''; diff --git a/flutter/test/method_channel_helper_test.dart b/flutter/test/method_channel_helper_test.dart new file mode 100644 index 0000000000..12729e7313 --- /dev/null +++ b/flutter/test/method_channel_helper_test.dart @@ -0,0 +1,159 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/src/native/method_channel_helper.dart'; +import 'package:collection/collection.dart'; + +void main() { + group('normalize', () { + test('primitives', () { + var expected = { + 'null': null, + 'int': 1, + 'float': 1.1, + 'bool': true, + 'string': 'Foo', + }; + + var actual = MethodChannelHelper.normalizeMap(expected); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + + expect(MethodChannelHelper.normalize(null), null); + expect(MethodChannelHelper.normalize(1), 1); + expect(MethodChannelHelper.normalize(1.1), 1.1); + expect(MethodChannelHelper.normalize(true), true); + expect(MethodChannelHelper.normalize('Foo'), 'Foo'); + }); + + test('object', () { + expect(MethodChannelHelper.normalize(_CustomObject()), 'CustomObject()'); + }); + + test('object in list', () { + var input = { + 'object': [_CustomObject()] + }; + var expected = { + 'object': ['CustomObject()'] + }; + + var actual = MethodChannelHelper.normalize(input); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + + test('object in map', () { + var input = { + 'object': {'object': _CustomObject()} + }; + var expected = { + 'object': {'object': 'CustomObject()'} + }; + + var actual = MethodChannelHelper.normalize(input); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + }); + + group('normalizeMap', () { + test('primitives', () { + var expected = { + 'null': null, + 'int': 1, + 'float': 1.1, + 'bool': true, + 'string': 'Foo', + }; + + var actual = MethodChannelHelper.normalizeMap(expected); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + + test('list with primitives', () { + var expected = { + 'list': [null, 1, 1.1, true, 'Foo'], + }; + + var actual = MethodChannelHelper.normalizeMap(expected); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + + test('map with primitives', () { + var expected = { + 'map': { + 'null': null, + 'int': 1, + 'float': 1.1, + 'bool': true, + 'string': 'Foo', + }, + }; + + var actual = MethodChannelHelper.normalizeMap(expected); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + + test('object', () { + var input = {'object': _CustomObject()}; + var expected = {'object': 'CustomObject()'}; + + var actual = MethodChannelHelper.normalizeMap(input); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + + test('object in list', () { + var input = { + 'object': [_CustomObject()] + }; + var expected = { + 'object': ['CustomObject()'] + }; + + var actual = MethodChannelHelper.normalizeMap(input); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + + test('object in map', () { + var input = { + 'object': {'object': _CustomObject()} + }; + var expected = { + 'object': {'object': 'CustomObject()'} + }; + + var actual = MethodChannelHelper.normalizeMap(input); + expect( + DeepCollectionEquality().equals(actual, expected), + true, + ); + }); + }); +} + +class _CustomObject { + @override + String toString() { + return 'CustomObject()'; + } +} diff --git a/flutter/test/mocks.dart b/flutter/test/mocks.dart index 28da5e6bff..b2e01788c1 100644 --- a/flutter/test/mocks.dart +++ b/flutter/test/mocks.dart @@ -4,15 +4,14 @@ import 'package:flutter/services.dart'; import 'package:flutter/src/widgets/binding.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; -import 'package:sentry/sentry.dart'; import 'package:sentry/src/platform/platform.dart'; import 'package:sentry/src/sentry_tracer.dart'; import 'package:meta/meta.dart'; -import 'package:sentry_flutter/src/binding_wrapper.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/renderer/renderer.dart'; -import 'package:sentry_flutter/src/sentry_native.dart'; -import 'package:sentry_flutter/src/sentry_native_channel.dart'; +import 'package:sentry_flutter/src/native/sentry_native.dart'; +import 'package:sentry_flutter/src/native/sentry_native_binding.dart'; import 'mocks.mocks.dart'; import 'no_such_method_provider.dart'; @@ -20,6 +19,12 @@ import 'no_such_method_provider.dart'; const fakeDsn = 'https://abc@def.ingest.sentry.io/1234567'; const fakeProguardUuid = '3457d982-65ef-576d-a6ad-65b5f30f49a5'; +// TODO use this everywhere in tests so that we don't get exceptions swallowed. +SentryFlutterOptions defaultTestOptions() { + // ignore: invalid_use_of_internal_member + return SentryFlutterOptions(dsn: fakeDsn)..automatedTestMode = true; +} + // https://github.com/dart-lang/mockito/blob/master/NULL_SAFETY_README.md#fallback-generators ISentrySpan startTransactionShim( String? name, @@ -40,8 +45,8 @@ ISentrySpan startTransactionShim( Transport, // ignore: invalid_use_of_internal_member SentryTracer, + SentryTransaction, MethodChannel, - SentryNative, ], customMocks: [ MockSpec(fallbackGenerators: {#startTransaction: startTransactionShim}) ]) @@ -146,7 +151,7 @@ class MockPlatformChecker with NoSuchMethodProvider implements PlatformChecker { // Does nothing or returns default values. // Useful for when a Hub needs to be passed but is not used. class NoOpHub with NoSuchMethodProvider implements Hub { - final _options = SentryOptions(dsn: 'fixture-dsn'); + final _options = defaultTestOptions(); @override @internal @@ -156,13 +161,11 @@ class NoOpHub with NoSuchMethodProvider implements Hub { bool get isEnabled => false; } +// TODO can this be replaced with https://pub.dev/packages/mockito#verifying-exact-number-of-invocations--at-least-x--never class TestMockSentryNative implements SentryNative { @override DateTime? appStartEnd; - @override - SentryNativeChannel? nativeChannel; - bool _didFetchAppStart = false; @override @@ -189,6 +192,9 @@ class TestMockSentryNative implements SentryNative { var numberOfSetTagCalls = 0; SentryUser? sentryUser; var numberOfSetUserCalls = 0; + var numberOfStartProfilerCalls = 0; + var numberOfDiscardProfilerCalls = 0; + var numberOfCollectProfileCalls = 0; @override Future addBreadcrumb(Breadcrumb breadcrumb) async { @@ -265,9 +271,29 @@ class TestMockSentryNative implements SentryNative { this.sentryUser = sentryUser; numberOfSetUserCalls++; } + + @override + Future?> collectProfile( + SentryId traceId, int startTimeNs, int endTimeNs) { + numberOfCollectProfileCalls++; + return Future.value(null); + } + + @override + int? startProfiler(SentryId traceId) { + numberOfStartProfilerCalls++; + return 42; + } + + @override + Future discardProfiler(SentryId traceId) { + numberOfDiscardProfilerCalls++; + return Future.value(null); + } } -class MockNativeChannel implements SentryNativeChannel { +// TODO can this be replaced with https://pub.dev/packages/mockito#verifying-exact-number-of-invocations--at-least-x--never +class MockNativeChannel implements SentryNativeBinding { NativeAppStart? nativeAppStart; NativeFrames? nativeFrames; SentryId? id; @@ -283,6 +309,9 @@ class MockNativeChannel implements SentryNativeChannel { int numberOfSetContextsCalls = 0; int numberOfSetExtraCalls = 0; int numberOfSetTagCalls = 0; + int numberOfStartProfilerCalls = 0; + int numberOfDiscardProfilerCalls = 0; + int numberOfCollectProfileCalls = 0; @override Future fetchNativeAppStart() async => nativeAppStart; @@ -343,15 +372,34 @@ class MockNativeChannel implements SentryNativeChannel { Future setTag(String key, value) async { numberOfSetTagCalls += 1; } + + @override + Future?> collectProfile( + SentryId traceId, int startTimeNs, int endTimeNs) { + numberOfCollectProfileCalls++; + return Future.value(null); + } + + @override + int? startProfiler(SentryId traceId) { + numberOfStartProfilerCalls++; + return null; + } + + @override + Future discardProfiler(SentryId traceId) { + numberOfDiscardProfilerCalls++; + return Future.value(null); + } } class MockRendererWrapper implements RendererWrapper { MockRendererWrapper(this._renderer); - final FlutterRenderer _renderer; + final FlutterRenderer? _renderer; @override - FlutterRenderer getRenderer() { + FlutterRenderer? getRenderer() { return _renderer; } } diff --git a/flutter/test/mocks.mocks.dart b/flutter/test/mocks.mocks.dart index 70a42aff77..e2807ef405 100644 --- a/flutter/test/mocks.mocks.dart +++ b/flutter/test/mocks.mocks.dart @@ -3,20 +3,19 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i7; -import 'package:flutter/src/services/binary_messenger.dart' as _i5; -import 'package:flutter/src/services/message_codec.dart' as _i4; -import 'package:flutter/src/services/platform_channel.dart' as _i9; +import 'package:flutter/src/services/binary_messenger.dart' as _i6; +import 'package:flutter/src/services/message_codec.dart' as _i5; +import 'package:flutter/src/services/platform_channel.dart' as _i10; import 'package:mockito/mockito.dart' as _i1; import 'package:sentry/sentry.dart' as _i2; +import 'package:sentry/src/profiling.dart' as _i9; import 'package:sentry/src/protocol.dart' as _i3; -import 'package:sentry/src/sentry_envelope.dart' as _i7; -import 'package:sentry/src/sentry_tracer.dart' as _i8; -import 'package:sentry_flutter/src/sentry_native.dart' as _i10; -import 'package:sentry_flutter/src/sentry_native_channel.dart' as _i11; +import 'package:sentry/src/sentry_envelope.dart' as _i8; +import 'package:sentry/src/sentry_tracer.dart' as _i4; -import 'mocks.dart' as _i12; +import 'mocks.dart' as _i11; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -71,8 +70,8 @@ class _FakeSentryTraceHeader_3 extends _i1.SmartFake ); } -class _FakeMethodCodec_4 extends _i1.SmartFake implements _i4.MethodCodec { - _FakeMethodCodec_4( +class _FakeSentryTracer_4 extends _i1.SmartFake implements _i4.SentryTracer { + _FakeSentryTracer_4( Object parent, Invocation parentInvocation, ) : super( @@ -81,9 +80,8 @@ class _FakeMethodCodec_4 extends _i1.SmartFake implements _i4.MethodCodec { ); } -class _FakeBinaryMessenger_5 extends _i1.SmartFake - implements _i5.BinaryMessenger { - _FakeBinaryMessenger_5( +class _FakeSentryId_5 extends _i1.SmartFake implements _i3.SentryId { + _FakeSentryId_5( Object parent, Invocation parentInvocation, ) : super( @@ -92,8 +90,8 @@ class _FakeBinaryMessenger_5 extends _i1.SmartFake ); } -class _FakeSentryOptions_6 extends _i1.SmartFake implements _i2.SentryOptions { - _FakeSentryOptions_6( +class _FakeContexts_6 extends _i1.SmartFake implements _i3.Contexts { + _FakeContexts_6( Object parent, Invocation parentInvocation, ) : super( @@ -102,8 +100,9 @@ class _FakeSentryOptions_6 extends _i1.SmartFake implements _i2.SentryOptions { ); } -class _FakeSentryId_7 extends _i1.SmartFake implements _i3.SentryId { - _FakeSentryId_7( +class _FakeSentryTransaction_7 extends _i1.SmartFake + implements _i3.SentryTransaction { + _FakeSentryTransaction_7( Object parent, Invocation parentInvocation, ) : super( @@ -112,8 +111,49 @@ class _FakeSentryId_7 extends _i1.SmartFake implements _i3.SentryId { ); } -class _FakeHub_8 extends _i1.SmartFake implements _i2.Hub { - _FakeHub_8( +class _FakeMethodCodec_8 extends _i1.SmartFake implements _i5.MethodCodec { + _FakeMethodCodec_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBinaryMessenger_9 extends _i1.SmartFake + implements _i6.BinaryMessenger { + _FakeBinaryMessenger_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSentryOptions_10 extends _i1.SmartFake implements _i2.SentryOptions { + _FakeSentryOptions_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeScope_11 extends _i1.SmartFake implements _i2.Scope { + _FakeScope_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeHub_12 extends _i1.SmartFake implements _i2.Hub { + _FakeHub_12( Object parent, Invocation parentInvocation, ) : super( @@ -131,21 +171,20 @@ class MockTransport extends _i1.Mock implements _i2.Transport { } @override - _i6.Future<_i3.SentryId?> send(_i7.SentryEnvelope? envelope) => + _i7.Future<_i3.SentryId?> send(_i8.SentryEnvelope? envelope) => (super.noSuchMethod( Invocation.method( #send, [envelope], ), - returnValue: _i6.Future<_i3.SentryId?>.value(), - ) as _i6.Future<_i3.SentryId?>); + returnValue: _i7.Future<_i3.SentryId?>.value(), + ) as _i7.Future<_i3.SentryId?>); } /// A class which mocks [SentryTracer]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: invalid_use_of_internal_member -class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { +class MockSentryTracer extends _i1.Mock implements _i4.SentryTracer { MockSentryTracer() { _i1.throwOnMissingStub(this); } @@ -155,6 +194,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { Invocation.getter(#name), returnValue: '', ) as String); + @override set name(String? _name) => super.noSuchMethod( Invocation.setter( @@ -163,12 +203,14 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override _i3.SentryTransactionNameSource get transactionNameSource => (super.noSuchMethod( Invocation.getter(#transactionNameSource), returnValue: _i3.SentryTransactionNameSource.custom, ) as _i3.SentryTransactionNameSource); + @override set transactionNameSource( _i3.SentryTransactionNameSource? _transactionNameSource) => @@ -179,6 +221,25 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + + @override + set profiler(_i9.SentryProfiler? _profiler) => super.noSuchMethod( + Invocation.setter( + #profiler, + _profiler, + ), + returnValueForMissingStub: null, + ); + + @override + set profileInfo(_i9.SentryProfileInfo? _profileInfo) => super.noSuchMethod( + Invocation.setter( + #profileInfo, + _profileInfo, + ), + returnValueForMissingStub: null, + ); + @override _i2.SentrySpanContext get context => (super.noSuchMethod( Invocation.getter(#context), @@ -187,6 +248,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { Invocation.getter(#context), ), ) as _i2.SentrySpanContext); + @override set origin(String? origin) => super.noSuchMethod( Invocation.setter( @@ -195,6 +257,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override DateTime get startTimestamp => (super.noSuchMethod( Invocation.getter(#startTimestamp), @@ -203,21 +266,25 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { Invocation.getter(#startTimestamp), ), ) as DateTime); + @override Map get data => (super.noSuchMethod( Invocation.getter(#data), returnValue: {}, ) as Map); + @override bool get finished => (super.noSuchMethod( Invocation.getter(#finished), returnValue: false, ) as bool); + @override List<_i3.SentrySpan> get children => (super.noSuchMethod( Invocation.getter(#children), returnValue: <_i3.SentrySpan>[], ) as List<_i3.SentrySpan>); + @override set throwable(dynamic throwable) => super.noSuchMethod( Invocation.setter( @@ -226,6 +293,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override set status(_i3.SpanStatus? status) => super.noSuchMethod( Invocation.setter( @@ -234,18 +302,21 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override Map get tags => (super.noSuchMethod( Invocation.getter(#tags), returnValue: {}, ) as Map); + @override Map get measurements => (super.noSuchMethod( Invocation.getter(#measurements), returnValue: {}, ) as Map); + @override - _i6.Future finish({ + _i7.Future finish({ _i3.SpanStatus? status, DateTime? endTimestamp, }) => @@ -258,9 +329,10 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { #endTimestamp: endTimestamp, }, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + @override void removeData(String? key) => super.noSuchMethod( Invocation.method( @@ -269,6 +341,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override void removeTag(String? key) => super.noSuchMethod( Invocation.method( @@ -277,6 +350,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override void setData( String? key, @@ -292,6 +366,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override void setTag( String? key, @@ -307,6 +382,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override _i2.ISentrySpan startChild( String? operation, { @@ -334,6 +410,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), ), ) as _i2.ISentrySpan); + @override _i2.ISentrySpan startChildWithParentSpanId( _i3.SpanId? parentSpanId, @@ -368,6 +445,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), ), ) as _i2.ISentrySpan); + @override _i3.SentryTraceHeader toSentryTrace() => (super.noSuchMethod( Invocation.method( @@ -382,6 +460,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), ), ) as _i3.SentryTraceHeader); + @override void setMeasurement( String? name, @@ -399,6 +478,7 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ), returnValueForMissingStub: null, ); + @override void scheduleFinish() => super.noSuchMethod( Invocation.method( @@ -409,257 +489,315 @@ class MockSentryTracer extends _i1.Mock implements _i8.SentryTracer { ); } -/// A class which mocks [MethodChannel]. +/// A class which mocks [SentryTransaction]. /// /// See the documentation for Mockito's code generation for more information. -class MockMethodChannel extends _i1.Mock implements _i9.MethodChannel { - MockMethodChannel() { +// ignore: must_be_immutable +class MockSentryTransaction extends _i1.Mock implements _i3.SentryTransaction { + MockSentryTransaction() { _i1.throwOnMissingStub(this); } @override - String get name => (super.noSuchMethod( - Invocation.getter(#name), - returnValue: '', - ) as String); - @override - _i4.MethodCodec get codec => (super.noSuchMethod( - Invocation.getter(#codec), - returnValue: _FakeMethodCodec_4( - this, - Invocation.getter(#codec), - ), - ) as _i4.MethodCodec); - @override - _i5.BinaryMessenger get binaryMessenger => (super.noSuchMethod( - Invocation.getter(#binaryMessenger), - returnValue: _FakeBinaryMessenger_5( + DateTime get startTimestamp => (super.noSuchMethod( + Invocation.getter(#startTimestamp), + returnValue: _FakeDateTime_1( this, - Invocation.getter(#binaryMessenger), - ), - ) as _i5.BinaryMessenger); - @override - _i6.Future invokeMethod( - String? method, [ - dynamic arguments, - ]) => - (super.noSuchMethod( - Invocation.method( - #invokeMethod, - [ - method, - arguments, - ], + Invocation.getter(#startTimestamp), ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + ) as DateTime); + @override - _i6.Future?> invokeListMethod( - String? method, [ - dynamic arguments, - ]) => - (super.noSuchMethod( - Invocation.method( - #invokeListMethod, - [ - method, - arguments, - ], + set startTimestamp(DateTime? _startTimestamp) => super.noSuchMethod( + Invocation.setter( + #startTimestamp, + _startTimestamp, ), - returnValue: _i6.Future?>.value(), - ) as _i6.Future?>); + returnValueForMissingStub: null, + ); + @override - _i6.Future?> invokeMapMethod( - String? method, [ - dynamic arguments, - ]) => - (super.noSuchMethod( - Invocation.method( - #invokeMapMethod, - [ - method, - arguments, - ], - ), - returnValue: _i6.Future?>.value(), - ) as _i6.Future?>); + List<_i3.SentrySpan> get spans => (super.noSuchMethod( + Invocation.getter(#spans), + returnValue: <_i3.SentrySpan>[], + ) as List<_i3.SentrySpan>); + @override - void setMethodCallHandler( - _i6.Future Function(_i4.MethodCall)? handler) => - super.noSuchMethod( - Invocation.method( - #setMethodCallHandler, - [handler], + set spans(List<_i3.SentrySpan>? _spans) => super.noSuchMethod( + Invocation.setter( + #spans, + _spans, ), returnValueForMissingStub: null, ); -} -/// A class which mocks [SentryNative]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockSentryNative extends _i1.Mock implements _i10.SentryNative { - MockSentryNative() { - _i1.throwOnMissingStub(this); - } + @override + _i4.SentryTracer get tracer => (super.noSuchMethod( + Invocation.getter(#tracer), + returnValue: _FakeSentryTracer_4( + this, + Invocation.getter(#tracer), + ), + ) as _i4.SentryTracer); @override - set appStartEnd(DateTime? _appStartEnd) => super.noSuchMethod( + Map get measurements => (super.noSuchMethod( + Invocation.getter(#measurements), + returnValue: {}, + ) as Map); + + @override + set measurements(Map? _measurements) => + super.noSuchMethod( Invocation.setter( - #appStartEnd, - _appStartEnd, + #measurements, + _measurements, ), returnValueForMissingStub: null, ); + @override - set nativeChannel(_i11.SentryNativeChannel? nativeChannel) => + set transactionInfo(_i3.SentryTransactionInfo? _transactionInfo) => super.noSuchMethod( Invocation.setter( - #nativeChannel, - nativeChannel, + #transactionInfo, + _transactionInfo, ), returnValueForMissingStub: null, ); + @override - bool get didFetchAppStart => (super.noSuchMethod( - Invocation.getter(#didFetchAppStart), + bool get finished => (super.noSuchMethod( + Invocation.getter(#finished), returnValue: false, ) as bool); + @override - _i6.Future<_i11.NativeAppStart?> fetchNativeAppStart() => (super.noSuchMethod( - Invocation.method( - #fetchNativeAppStart, - [], + bool get sampled => (super.noSuchMethod( + Invocation.getter(#sampled), + returnValue: false, + ) as bool); + + @override + _i3.SentryId get eventId => (super.noSuchMethod( + Invocation.getter(#eventId), + returnValue: _FakeSentryId_5( + this, + Invocation.getter(#eventId), ), - returnValue: _i6.Future<_i11.NativeAppStart?>.value(), - ) as _i6.Future<_i11.NativeAppStart?>); + ) as _i3.SentryId); + @override - _i6.Future beginNativeFramesCollection() => (super.noSuchMethod( - Invocation.method( - #beginNativeFramesCollection, - [], + _i3.Contexts get contexts => (super.noSuchMethod( + Invocation.getter(#contexts), + returnValue: _FakeContexts_6( + this, + Invocation.getter(#contexts), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i3.Contexts); + @override - _i6.Future<_i11.NativeFrames?> endNativeFramesCollection( - _i3.SentryId? traceId) => - (super.noSuchMethod( + Map toJson() => (super.noSuchMethod( Invocation.method( - #endNativeFramesCollection, - [traceId], + #toJson, + [], ), - returnValue: _i6.Future<_i11.NativeFrames?>.value(), - ) as _i6.Future<_i11.NativeFrames?>); + returnValue: {}, + ) as Map); + @override - _i6.Future setContexts( - String? key, - dynamic value, - ) => + _i3.SentryTransaction copyWith({ + _i3.SentryId? eventId, + DateTime? timestamp, + String? platform, + String? logger, + String? serverName, + String? release, + String? dist, + String? environment, + Map? modules, + _i3.SentryMessage? message, + String? transaction, + dynamic throwable, + _i3.SentryLevel? level, + String? culprit, + Map? tags, + Map? extra, + List? fingerprint, + _i3.SentryUser? user, + _i3.Contexts? contexts, + List<_i3.Breadcrumb>? breadcrumbs, + _i3.SdkVersion? sdk, + _i3.SentryRequest? request, + _i3.DebugMeta? debugMeta, + List<_i3.SentryException>? exceptions, + List<_i3.SentryThread>? threads, + String? type, + Map? measurements, + _i3.SentryTransactionInfo? transactionInfo, + }) => (super.noSuchMethod( Invocation.method( - #setContexts, - [ - key, - value, - ], + #copyWith, + [], + { + #eventId: eventId, + #timestamp: timestamp, + #platform: platform, + #logger: logger, + #serverName: serverName, + #release: release, + #dist: dist, + #environment: environment, + #modules: modules, + #message: message, + #transaction: transaction, + #throwable: throwable, + #level: level, + #culprit: culprit, + #tags: tags, + #extra: extra, + #fingerprint: fingerprint, + #user: user, + #contexts: contexts, + #breadcrumbs: breadcrumbs, + #sdk: sdk, + #request: request, + #debugMeta: debugMeta, + #exceptions: exceptions, + #threads: threads, + #type: type, + #measurements: measurements, + #transactionInfo: transactionInfo, + }, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future removeContexts(String? key) => (super.noSuchMethod( - Invocation.method( - #removeContexts, - [key], + returnValue: _FakeSentryTransaction_7( + this, + Invocation.method( + #copyWith, + [], + { + #eventId: eventId, + #timestamp: timestamp, + #platform: platform, + #logger: logger, + #serverName: serverName, + #release: release, + #dist: dist, + #environment: environment, + #modules: modules, + #message: message, + #transaction: transaction, + #throwable: throwable, + #level: level, + #culprit: culprit, + #tags: tags, + #extra: extra, + #fingerprint: fingerprint, + #user: user, + #contexts: contexts, + #breadcrumbs: breadcrumbs, + #sdk: sdk, + #request: request, + #debugMeta: debugMeta, + #exceptions: exceptions, + #threads: threads, + #type: type, + #measurements: measurements, + #transactionInfo: transactionInfo, + }, + ), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i3.SentryTransaction); +} + +/// A class which mocks [MethodChannel]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockMethodChannel extends _i1.Mock implements _i10.MethodChannel { + MockMethodChannel() { + _i1.throwOnMissingStub(this); + } + @override - _i6.Future setUser(_i3.SentryUser? sentryUser) => (super.noSuchMethod( - Invocation.method( - #setUser, - [sentryUser], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + @override - _i6.Future addBreadcrumb(_i3.Breadcrumb? breadcrumb) => - (super.noSuchMethod( - Invocation.method( - #addBreadcrumb, - [breadcrumb], + _i5.MethodCodec get codec => (super.noSuchMethod( + Invocation.getter(#codec), + returnValue: _FakeMethodCodec_8( + this, + Invocation.getter(#codec), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i5.MethodCodec); + @override - _i6.Future clearBreadcrumbs() => (super.noSuchMethod( - Invocation.method( - #clearBreadcrumbs, - [], + _i6.BinaryMessenger get binaryMessenger => (super.noSuchMethod( + Invocation.getter(#binaryMessenger), + returnValue: _FakeBinaryMessenger_9( + this, + Invocation.getter(#binaryMessenger), ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + ) as _i6.BinaryMessenger); + @override - _i6.Future setExtra( - String? key, - dynamic value, - ) => + _i7.Future invokeMethod( + String? method, [ + dynamic arguments, + ]) => (super.noSuchMethod( Invocation.method( - #setExtra, + #invokeMethod, [ - key, - value, + method, + arguments, ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future removeExtra(String? key) => (super.noSuchMethod( - Invocation.method( - #removeExtra, - [key], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future.value(), + ) as _i7.Future); + @override - _i6.Future setTag( - String? key, - String? value, - ) => + _i7.Future?> invokeListMethod( + String? method, [ + dynamic arguments, + ]) => (super.noSuchMethod( Invocation.method( - #setTag, + #invokeListMethod, [ - key, - value, + method, + arguments, ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future?>.value(), + ) as _i7.Future?>); + @override - _i6.Future removeTag(String? key) => (super.noSuchMethod( + _i7.Future?> invokeMapMethod( + String? method, [ + dynamic arguments, + ]) => + (super.noSuchMethod( Invocation.method( - #removeTag, - [key], + #invokeMapMethod, + [ + method, + arguments, + ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future?>.value(), + ) as _i7.Future?>); + @override - void reset() => super.noSuchMethod( + void setMethodCallHandler( + _i7.Future Function(_i5.MethodCall)? handler) => + super.noSuchMethod( Invocation.method( - #reset, - [], + #setMethodCallHandler, + [handler], ), returnValueForMissingStub: null, ); @@ -676,26 +814,47 @@ class MockHub extends _i1.Mock implements _i2.Hub { @override _i2.SentryOptions get options => (super.noSuchMethod( Invocation.getter(#options), - returnValue: _FakeSentryOptions_6( + returnValue: _FakeSentryOptions_10( this, Invocation.getter(#options), ), ) as _i2.SentryOptions); + @override bool get isEnabled => (super.noSuchMethod( Invocation.getter(#isEnabled), returnValue: false, ) as bool); + @override _i3.SentryId get lastEventId => (super.noSuchMethod( Invocation.getter(#lastEventId), - returnValue: _FakeSentryId_7( + returnValue: _FakeSentryId_5( this, Invocation.getter(#lastEventId), ), ) as _i3.SentryId); + + @override + _i2.Scope get scope => (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_11( + this, + Invocation.getter(#scope), + ), + ) as _i2.Scope); + @override - _i6.Future<_i3.SentryId> captureEvent( + set profilerFactory(_i9.SentryProfilerFactory? value) => super.noSuchMethod( + Invocation.setter( + #profilerFactory, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i7.Future<_i3.SentryId> captureEvent( _i3.SentryEvent? event, { dynamic stackTrace, _i2.Hint? hint, @@ -711,7 +870,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { #withScope: withScope, }, ), - returnValue: _i6.Future<_i3.SentryId>.value(_FakeSentryId_7( + returnValue: _i7.Future<_i3.SentryId>.value(_FakeSentryId_5( this, Invocation.method( #captureEvent, @@ -723,9 +882,10 @@ class MockHub extends _i1.Mock implements _i2.Hub { }, ), )), - ) as _i6.Future<_i3.SentryId>); + ) as _i7.Future<_i3.SentryId>); + @override - _i6.Future<_i3.SentryId> captureException( + _i7.Future<_i3.SentryId> captureException( dynamic throwable, { dynamic stackTrace, _i2.Hint? hint, @@ -741,7 +901,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { #withScope: withScope, }, ), - returnValue: _i6.Future<_i3.SentryId>.value(_FakeSentryId_7( + returnValue: _i7.Future<_i3.SentryId>.value(_FakeSentryId_5( this, Invocation.method( #captureException, @@ -753,9 +913,10 @@ class MockHub extends _i1.Mock implements _i2.Hub { }, ), )), - ) as _i6.Future<_i3.SentryId>); + ) as _i7.Future<_i3.SentryId>); + @override - _i6.Future<_i3.SentryId> captureMessage( + _i7.Future<_i3.SentryId> captureMessage( String? message, { _i3.SentryLevel? level, String? template, @@ -775,7 +936,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { #withScope: withScope, }, ), - returnValue: _i6.Future<_i3.SentryId>.value(_FakeSentryId_7( + returnValue: _i7.Future<_i3.SentryId>.value(_FakeSentryId_5( this, Invocation.method( #captureMessage, @@ -789,19 +950,21 @@ class MockHub extends _i1.Mock implements _i2.Hub { }, ), )), - ) as _i6.Future<_i3.SentryId>); + ) as _i7.Future<_i3.SentryId>); + @override - _i6.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => + _i7.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => (super.noSuchMethod( Invocation.method( #captureUserFeedback, [userFeedback], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + @override - _i6.Future addBreadcrumb( + _i7.Future addBreadcrumb( _i3.Breadcrumb? crumb, { _i2.Hint? hint, }) => @@ -811,9 +974,10 @@ class MockHub extends _i1.Mock implements _i2.Hub { [crumb], {#hint: hint}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + @override void bindClient(_i2.SentryClient? client) => super.noSuchMethod( Invocation.method( @@ -822,13 +986,14 @@ class MockHub extends _i1.Mock implements _i2.Hub { ), returnValueForMissingStub: null, ); + @override _i2.Hub clone() => (super.noSuchMethod( Invocation.method( #clone, [], ), - returnValue: _FakeHub_8( + returnValue: _FakeHub_12( this, Invocation.method( #clone, @@ -836,21 +1001,24 @@ class MockHub extends _i1.Mock implements _i2.Hub { ), ), ) as _i2.Hub); + @override - _i6.Future close() => (super.noSuchMethod( + _i7.Future close() => (super.noSuchMethod( Invocation.method( #close, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i7.Future.value(), + returnValueForMissingStub: _i7.Future.value(), + ) as _i7.Future); + @override - _i6.FutureOr configureScope(_i2.ScopeCallback? callback) => + _i7.FutureOr configureScope(_i2.ScopeCallback? callback) => (super.noSuchMethod(Invocation.method( #configureScope, [callback], - )) as _i6.FutureOr); + )) as _i7.FutureOr); + @override _i2.ISentrySpan startTransaction( String? name, @@ -882,7 +1050,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { #customSamplingContext: customSamplingContext, }, ), - returnValue: _i12.startTransactionShim( + returnValue: _i11.startTransactionShim( name, operation, description: description, @@ -895,6 +1063,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { customSamplingContext: customSamplingContext, ), ) as _i2.ISentrySpan); + @override _i2.ISentrySpan startTransactionWithContext( _i2.SentryTransactionContext? transactionContext, { @@ -937,8 +1106,9 @@ class MockHub extends _i1.Mock implements _i2.Hub { ), ), ) as _i2.ISentrySpan); + @override - _i6.Future<_i3.SentryId> captureTransaction( + _i7.Future<_i3.SentryId> captureTransaction( _i3.SentryTransaction? transaction, { _i2.SentryTraceContextHeader? traceContext, }) => @@ -948,7 +1118,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { [transaction], {#traceContext: traceContext}, ), - returnValue: _i6.Future<_i3.SentryId>.value(_FakeSentryId_7( + returnValue: _i7.Future<_i3.SentryId>.value(_FakeSentryId_5( this, Invocation.method( #captureTransaction, @@ -956,7 +1126,8 @@ class MockHub extends _i1.Mock implements _i2.Hub { {#traceContext: traceContext}, ), )), - ) as _i6.Future<_i3.SentryId>); + ) as _i7.Future<_i3.SentryId>); + @override void setSpanContext( dynamic throwable, diff --git a/flutter/test/native_scope_observer_test.dart b/flutter/test/native_scope_observer_test.dart index 0efb22a2c1..916bd4b7be 100644 --- a/flutter/test/native_scope_observer_test.dart +++ b/flutter/test/native_scope_observer_test.dart @@ -2,7 +2,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:sentry/sentry.dart'; -import 'package:sentry_flutter/src/native_scope_observer.dart'; +import 'package:sentry_flutter/src/native/native_scope_observer.dart'; import 'mocks.dart'; diff --git a/flutter/test/profiling_test.dart b/flutter/test/profiling_test.dart new file mode 100644 index 0000000000..eddb391313 --- /dev/null +++ b/flutter/test/profiling_test.dart @@ -0,0 +1,95 @@ +@TestOn('vm') + +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:sentry_flutter/src/profiling.dart'; +import 'mocks.dart'; +import 'mocks.mocks.dart'; +import 'sentry_flutter_test.dart'; + +void main() { + group('$SentryNativeProfilerFactory', () { + Hub hubWithSampleRate(double profilesSampleRate) { + final o = SentryFlutterOptions(dsn: fakeDsn); + o.platformChecker = getPlatformChecker(platform: MockPlatform.iOs()); + o.profilesSampleRate = profilesSampleRate; + + final hub = MockHub(); + when(hub.options).thenAnswer((_) => o); + return hub; + } + + test('attachTo() respects sampling rate', () async { + var hub = hubWithSampleRate(0.0); + SentryNativeProfilerFactory.attachTo(hub, TestMockSentryNative()); + // ignore: invalid_use_of_internal_member + verifyNever(hub.profilerFactory = any); + + hub = hubWithSampleRate(0.1); + SentryNativeProfilerFactory.attachTo(hub, TestMockSentryNative()); + // ignore: invalid_use_of_internal_member + verify(hub.profilerFactory = any); + }); + + test('creates a profiler', () async { + final nativeMock = TestMockSentryNative(); + // ignore: invalid_use_of_internal_member + final sut = SentryNativeProfilerFactory(nativeMock, getUtcDateTime); + final profiler = sut.startProfiler(SentryTransactionContext( + 'name', + 'op', + )); + expect(nativeMock.numberOfStartProfilerCalls, 1); + expect(profiler, isNotNull); + }); + }); + + group('$SentryNativeProfiler', () { + late TestMockSentryNative nativeMock; + late SentryNativeProfiler sut; + + setUp(() { + nativeMock = TestMockSentryNative(); + // ignore: invalid_use_of_internal_member + final factory = SentryNativeProfilerFactory(nativeMock, getUtcDateTime); + final profiler = factory.startProfiler(SentryTransactionContext( + 'name', + 'op', + )); + expect(nativeMock.numberOfStartProfilerCalls, 1); + expect(profiler, isNotNull); + sut = profiler!; + }); + + test('dispose() calls native discard() exactly once', () async { + sut.dispose(); + sut.dispose(); // Additional calls must not have an effect. + + // Yield to let the .then() in .dispose() execute. + await null; + await null; + + expect(nativeMock.numberOfDiscardProfilerCalls, 1); + + // finishFor() mustn't work after disposing + expect(await sut.finishFor(MockSentryTransaction()), isNull); + expect(nativeMock.numberOfCollectProfileCalls, 0); + }); + + test('dispose() does not call discard() after finishing', () async { + final mockTransaction = MockSentryTransaction(); + when(mockTransaction.startTimestamp).thenReturn(DateTime.now()); + when(mockTransaction.timestamp).thenReturn(DateTime.now()); + expect(await sut.finishFor(mockTransaction), isNull); + + sut.dispose(); + + // Yield to let the .then() in .dispose() execute. + await null; + + expect(nativeMock.numberOfDiscardProfilerCalls, 0); + expect(nativeMock.numberOfCollectProfileCalls, 1); + }); + }); +} diff --git a/flutter/test/screenshot/sentry_screenshot_widget_test.dart b/flutter/test/screenshot/sentry_screenshot_widget_test.dart new file mode 100644 index 0000000000..fd4603c794 --- /dev/null +++ b/flutter/test/screenshot/sentry_screenshot_widget_test.dart @@ -0,0 +1,79 @@ +@TestOn('vm') +// ignore_for_file: invalid_use_of_internal_member + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; + +import '../mocks.dart'; + +void main() { + late Fixture fixture; + setUp(() { + fixture = Fixture(); + TestWidgetsFlutterBinding.ensureInitialized(); + }); + + testWidgets( + '$SentryScreenshotWidget does not apply when attachScreenshot is false', + (tester) async { + await tester.pumpWidget( + fixture.getSut( + attachScreenshot: false, + ), + ); + + final widget = find.byType(MyApp); + final repaintBoundaryFinder = find.descendant( + of: widget, + matching: find.byType(RepaintBoundary), + ); + expect(repaintBoundaryFinder, findsNothing); + }, + ); + + testWidgets( + '$SentryScreenshotWidget applies when attachScreenshot is true', + (tester) async { + await tester.pumpWidget( + fixture.getSut( + attachScreenshot: true, + ), + ); + + final widget = find.byType(MyApp); + final repaintBoundaryFinder = find.ancestor( + of: widget, + matching: find.byKey(sentryScreenshotWidgetGlobalKey), + ); + expect(repaintBoundaryFinder, findsOneWidget); + }, + ); +} + +class Fixture { + final _options = SentryFlutterOptions(dsn: fakeDsn); + late Hub hub; + + SentryScreenshotWidget getSut({ + bool attachScreenshot = false, + }) { + _options.attachScreenshot = attachScreenshot; + + hub = Hub(_options); + + return SentryScreenshotWidget( + hub: hub, + child: MaterialApp(home: MyApp()), + ); + } +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return const Text('test'); + } +} diff --git a/flutter/test/sentry_flutter_options_test.dart b/flutter/test/sentry_flutter_options_test.dart index a6d871318b..ed4a3ea7f7 100644 --- a/flutter/test/sentry_flutter_options_test.dart +++ b/flutter/test/sentry_flutter_options_test.dart @@ -32,7 +32,7 @@ void main() { expect(options.enableAutoNativeBreadcrumbs, isFalse); }); - testWidgets('useFlutterBreadcrumbTracking', (WidgetTester tester) async { + testWidgets('useNativeBreadcrumbTracking', (WidgetTester tester) async { final options = SentryFlutterOptions(); options.useNativeBreadcrumbTracking(); diff --git a/flutter/test/sentry_flutter_test.dart b/flutter/test/sentry_flutter_test.dart index 9a7df7d063..e06938da90 100644 --- a/flutter/test/sentry_flutter_test.dart +++ b/flutter/test/sentry_flutter_test.dart @@ -3,10 +3,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:sentry_flutter/src/integrations/connectivity/connectivity_integration.dart'; import 'package:sentry_flutter/src/integrations/integrations.dart'; import 'package:sentry_flutter/src/integrations/screenshot_integration.dart'; +import 'package:sentry_flutter/src/profiling.dart'; import 'package:sentry_flutter/src/renderer/renderer.dart'; -import 'package:sentry_flutter/src/sentry_native.dart'; import 'package:sentry_flutter/src/version.dart'; import 'package:sentry_flutter/src/view_hierarchy/view_hierarchy_integration.dart'; import 'mocks.dart'; @@ -23,6 +24,10 @@ final platformAgnosticIntegrations = [ SentryViewHierarchyIntegration, ]; +final webIntegrations = [ + ConnectivityIntegration, +]; + final nonWebIntegrations = [ OnErrorIntegration, ]; @@ -51,9 +56,7 @@ void main() { setUp(() async { loadTestPackage(); await Sentry.close(); - final sentryNative = SentryNative(); - sentryNative.nativeChannel = null; - sentryNative.reset(); + SentryFlutter.native = null; }); test('Android', () async { @@ -65,7 +68,8 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; + options.profilesSampleRate = 1.0; integrations = options.integrations; transport = options.transport; sentryFlutterOptions = options; @@ -83,14 +87,18 @@ void main() { options: sentryFlutterOptions!, expectedHasNativeScopeObserver: true); testConfiguration( - integrations: integrations, - shouldHaveIntegrations: [ - ...androidIntegrations, - ...nativeIntegrations, - ...platformAgnosticIntegrations, - ...nonWebIntegrations, - ], - shouldNotHaveIntegrations: iOsAndMacOsIntegrations); + integrations: integrations, + shouldHaveIntegrations: [ + ...androidIntegrations, + ...nativeIntegrations, + ...platformAgnosticIntegrations, + ...nonWebIntegrations, + ], + shouldNotHaveIntegrations: [ + ...iOsAndMacOsIntegrations, + ...nonWebIntegrations, + ], + ); integrations .indexWhere((element) => element is WidgetsFlutterBindingIntegration); @@ -100,7 +108,8 @@ void main() { beforeIntegration: WidgetsFlutterBindingIntegration, afterIntegration: OnErrorIntegration); - expect(SentryNative().nativeChannel, isNotNull); + expect(SentryFlutter.native, isNotNull); + expect(Sentry.currentHub.profilerFactory, isNull); await Sentry.close(); }, testOn: 'vm'); @@ -113,7 +122,8 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; + options.profilesSampleRate = 1.0; integrations = options.integrations; transport = options.transport; sentryFlutterOptions = options; @@ -138,7 +148,10 @@ void main() { ...platformAgnosticIntegrations, ...nonWebIntegrations, ], - shouldNotHaveIntegrations: androidIntegrations, + shouldNotHaveIntegrations: [ + ...androidIntegrations, + ...nonWebIntegrations, + ], ); testBefore( @@ -146,7 +159,9 @@ void main() { beforeIntegration: WidgetsFlutterBindingIntegration, afterIntegration: OnErrorIntegration); - expect(SentryNative().nativeChannel, isNotNull); + expect(SentryFlutter.native, isNotNull); + expect(Sentry.currentHub.profilerFactory, + isInstanceOf()); await Sentry.close(); }, testOn: 'vm'); @@ -159,7 +174,8 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; + options.profilesSampleRate = 1.0; integrations = options.integrations; transport = options.transport; sentryFlutterOptions = options; @@ -176,23 +192,24 @@ void main() { testScopeObserver( options: sentryFlutterOptions!, expectedHasNativeScopeObserver: true); - testConfiguration( - integrations: integrations, - shouldHaveIntegrations: [ - ...iOsAndMacOsIntegrations, - ...nativeIntegrations, - ...platformAgnosticIntegrations, - ...nonWebIntegrations, - ], - shouldNotHaveIntegrations: androidIntegrations, - ); + testConfiguration(integrations: integrations, shouldHaveIntegrations: [ + ...iOsAndMacOsIntegrations, + ...nativeIntegrations, + ...platformAgnosticIntegrations, + ...nonWebIntegrations, + ], shouldNotHaveIntegrations: [ + ...androidIntegrations, + ...nonWebIntegrations, + ]); testBefore( integrations: integrations, beforeIntegration: WidgetsFlutterBindingIntegration, afterIntegration: OnErrorIntegration); - expect(SentryNative().nativeChannel, isNotNull); + expect(SentryFlutter.native, isNotNull); + expect(Sentry.currentHub.profilerFactory, + isInstanceOf()); await Sentry.close(); }, testOn: 'vm'); @@ -205,7 +222,8 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; + options.profilesSampleRate = 1.0; integrations = options.integrations; transport = options.transport; sentryFlutterOptions = options; @@ -233,6 +251,7 @@ void main() { ...androidIntegrations, ...iOsAndMacOsIntegrations, ...nativeIntegrations, + ...webIntegrations, ], ); @@ -241,7 +260,8 @@ void main() { beforeIntegration: WidgetsFlutterBindingIntegration, afterIntegration: OnErrorIntegration); - expect(SentryNative().nativeChannel, isNull); + expect(SentryFlutter.native, isNull); + expect(Sentry.currentHub.profilerFactory, isNull); await Sentry.close(); }, testOn: 'vm'); @@ -254,7 +274,8 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; + options.profilesSampleRate = 1.0; integrations = options.integrations; transport = options.transport; sentryFlutterOptions = options; @@ -282,6 +303,7 @@ void main() { ...androidIntegrations, ...iOsAndMacOsIntegrations, ...nativeIntegrations, + ...webIntegrations, ], ); @@ -290,7 +312,8 @@ void main() { beforeIntegration: WidgetsFlutterBindingIntegration, afterIntegration: OnErrorIntegration); - expect(SentryNative().nativeChannel, isNull); + expect(SentryFlutter.native, isNull); + expect(Sentry.currentHub.profilerFactory, isNull); await Sentry.close(); }, testOn: 'vm'); @@ -303,7 +326,8 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; + options.profilesSampleRate = 1.0; integrations = options.integrations; transport = options.transport; sentryFlutterOptions = options; @@ -326,7 +350,10 @@ void main() { testConfiguration( integrations: integrations, - shouldHaveIntegrations: platformAgnosticIntegrations, + shouldHaveIntegrations: [ + ...platformAgnosticIntegrations, + ...webIntegrations, + ], shouldNotHaveIntegrations: [ ...androidIntegrations, ...iOsAndMacOsIntegrations, @@ -340,7 +367,8 @@ void main() { beforeIntegration: RunZonedGuardedIntegration, afterIntegration: WidgetsFlutterBindingIntegration); - expect(SentryNative().nativeChannel, isNull); + expect(SentryFlutter.native, isNull); + expect(Sentry.currentHub.profilerFactory, isNull); await Sentry.close(); }); @@ -354,7 +382,7 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; integrations = options.integrations; transport = options.transport; }, @@ -372,7 +400,10 @@ void main() { testConfiguration( integrations: integrations, - shouldHaveIntegrations: platformAgnosticIntegrations, + shouldHaveIntegrations: [ + ...platformAgnosticIntegrations, + ...webIntegrations, + ], shouldNotHaveIntegrations: [ ...androidIntegrations, ...iOsAndMacOsIntegrations, @@ -398,7 +429,7 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; integrations = options.integrations; transport = options.transport; }, @@ -416,7 +447,10 @@ void main() { testConfiguration( integrations: integrations, - shouldHaveIntegrations: platformAgnosticIntegrations, + shouldHaveIntegrations: [ + ...platformAgnosticIntegrations, + ...webIntegrations, + ], shouldNotHaveIntegrations: [ ...androidIntegrations, ...iOsAndMacOsIntegrations, @@ -430,6 +464,8 @@ void main() { beforeIntegration: RunZonedGuardedIntegration, afterIntegration: WidgetsFlutterBindingIntegration); + expect(Sentry.currentHub.profilerFactory, isNull); + await Sentry.close(); }); @@ -441,7 +477,7 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; integrations = options.integrations; transport = options.transport; }, @@ -459,7 +495,10 @@ void main() { testConfiguration( integrations: integrations, - shouldHaveIntegrations: platformAgnosticIntegrations, + shouldHaveIntegrations: [ + ...platformAgnosticIntegrations, + ...webIntegrations, + ], shouldNotHaveIntegrations: [ ...androidIntegrations, ...iOsAndMacOsIntegrations, @@ -482,17 +521,18 @@ void main() { await Sentry.close(); }); - test('installed with skia renderer', () async { + test('installed on io platforms', () async { List integrations = []; await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; integrations = options.integrations; }, appRunner: appRunner, - platformChecker: getPlatformChecker(platform: MockPlatform.iOs()), + platformChecker: + getPlatformChecker(platform: MockPlatform.iOs(), isWeb: false), rendererWrapper: MockRendererWrapper(FlutterRenderer.skia), ); @@ -511,11 +551,12 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; integrations = options.integrations; }, appRunner: appRunner, - platformChecker: getPlatformChecker(platform: MockPlatform.iOs()), + platformChecker: + getPlatformChecker(platform: MockPlatform.iOs(), isWeb: true), rendererWrapper: MockRendererWrapper(FlutterRenderer.canvasKit), ); @@ -534,11 +575,12 @@ void main() { await SentryFlutter.init( (options) async { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; integrations = options.integrations; }, appRunner: appRunner, - platformChecker: getPlatformChecker(platform: MockPlatform.iOs()), + platformChecker: + getPlatformChecker(platform: MockPlatform.iOs(), isWeb: true), rendererWrapper: MockRendererWrapper(FlutterRenderer.html), ); @@ -550,29 +592,6 @@ void main() { await Sentry.close(); }, testOn: 'vm'); - - test('not installed with unknown renderer', () async { - List integrations = []; - - await SentryFlutter.init( - (options) async { - options.dsn = fakeDsn; - options.devMode = true; - integrations = options.integrations; - }, - appRunner: appRunner, - platformChecker: getPlatformChecker(platform: MockPlatform.iOs()), - rendererWrapper: MockRendererWrapper(FlutterRenderer.unknown), - ); - - expect( - integrations - .map((e) => e.runtimeType) - .contains(ScreenshotIntegration), - false); - - await Sentry.close(); - }, testOn: 'vm'); }); group('initial values', () { @@ -585,7 +604,7 @@ void main() { await SentryFlutter.init( (options) { options.dsn = fakeDsn; - options.devMode = true; + options.automatedTestMode = true; expect(false, options.debug); expect('debug', options.environment); diff --git a/flutter/test/sentry_flutter_util.dart b/flutter/test/sentry_flutter_util.dart index dcff13c054..7397c4a6a5 100644 --- a/flutter/test/sentry_flutter_util.dart +++ b/flutter/test/sentry_flutter_util.dart @@ -1,7 +1,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/file_system_transport.dart'; -import 'package:sentry_flutter/src/native_scope_observer.dart'; +import 'package:sentry_flutter/src/native/native_scope_observer.dart'; void testTransport({ required Transport transport, diff --git a/flutter/test/sentry_native_channel_test.dart b/flutter/test/sentry_native_channel_test.dart index 1d99ba2779..04ec723feb 100644 --- a/flutter/test/sentry_native_channel_test.dart +++ b/flutter/test/sentry_native_channel_test.dart @@ -5,8 +5,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; -import 'package:sentry_flutter/src/sentry_native.dart'; -import 'package:sentry_flutter/src/sentry_native_channel.dart'; +import 'package:sentry_flutter/src/native/method_channel_helper.dart'; +import 'package:sentry_flutter/src/native/sentry_native.dart'; +import 'package:sentry_flutter/src/native/sentry_native_channel.dart'; import 'mocks.mocks.dart'; void main() { @@ -37,6 +38,8 @@ void main() { test('beginNativeFrames', () async { final sut = fixture.getSut(); + when(fixture.methodChannel.invokeMethod('beginNativeFrames')) + .thenAnswer((realInvocation) async {}); await sut.beginNativeFrames(); verify(fixture.methodChannel.invokeMethod('beginNativeFrames')); @@ -64,26 +67,40 @@ void main() { }); test('setUser', () async { - when(fixture.methodChannel.invokeMethod('setUser', {'user': null})) + final user = SentryUser( + id: "fixture-id", + data: {'object': Object()}, + ); + final normalizedUser = user.copyWith( + data: MethodChannelHelper.normalizeMap(user.data), + ); + when(fixture.methodChannel + .invokeMethod('setUser', {'user': normalizedUser.toJson()})) .thenAnswer((_) => Future.value()); final sut = fixture.getSut(); - await sut.setUser(null); + await sut.setUser(user); - verify(fixture.methodChannel.invokeMethod('setUser', {'user': null})); + verify(fixture.methodChannel + .invokeMethod('setUser', {'user': normalizedUser.toJson()})); }); test('addBreadcrumb', () async { - final breadcrumb = Breadcrumb(); + final breadcrumb = Breadcrumb( + data: {'object': Object()}, + ); + final normalizedBreadcrumb = breadcrumb.copyWith( + data: MethodChannelHelper.normalizeMap(breadcrumb.data)); + when(fixture.methodChannel.invokeMethod( - 'addBreadcrumb', {'breadcrumb': breadcrumb.toJson()})) + 'addBreadcrumb', {'breadcrumb': normalizedBreadcrumb.toJson()})) .thenAnswer((_) => Future.value()); final sut = fixture.getSut(); await sut.addBreadcrumb(breadcrumb); - verify(fixture.methodChannel - .invokeMethod('addBreadcrumb', {'breadcrumb': breadcrumb.toJson()})); + verify(fixture.methodChannel.invokeMethod( + 'addBreadcrumb', {'breadcrumb': normalizedBreadcrumb.toJson()})); }); test('clearBreadcrumbs', () async { @@ -97,15 +114,17 @@ void main() { }); test('setContexts', () async { + final value = {'object': Object()}; + final normalizedValue = MethodChannelHelper.normalize(value); when(fixture.methodChannel.invokeMethod( - 'setContexts', {'key': 'fixture-key', 'value': 'fixture-value'})) + 'setContexts', {'key': 'fixture-key', 'value': normalizedValue})) .thenAnswer((_) => Future.value()); final sut = fixture.getSut(); - await sut.setContexts('fixture-key', 'fixture-value'); + await sut.setContexts('fixture-key', value); verify(fixture.methodChannel.invokeMethod( - 'setContexts', {'key': 'fixture-key', 'value': 'fixture-value'})); + 'setContexts', {'key': 'fixture-key', 'value': normalizedValue})); }); test('removeContexts', () async { @@ -121,15 +140,17 @@ void main() { }); test('setExtra', () async { + final value = {'object': Object()}; + final normalizedValue = MethodChannelHelper.normalize(value); when(fixture.methodChannel.invokeMethod( - 'setExtra', {'key': 'fixture-key', 'value': 'fixture-value'})) + 'setExtra', {'key': 'fixture-key', 'value': normalizedValue})) .thenAnswer((_) => Future.value()); final sut = fixture.getSut(); - await sut.setExtra('fixture-key', 'fixture-value'); + await sut.setExtra('fixture-key', value); verify(fixture.methodChannel.invokeMethod( - 'setExtra', {'key': 'fixture-key', 'value': 'fixture-value'})); + 'setExtra', {'key': 'fixture-key', 'value': normalizedValue})); }); test('removeExtra', () async { @@ -167,14 +188,53 @@ void main() { verify(fixture.methodChannel .invokeMethod('removeTag', {'key': 'fixture-key'})); }); + + test('startProfiler', () { + final sut = fixture.getSut(); + expect(() => sut.startProfiler(SentryId.newId()), throwsUnsupportedError); + verifyZeroInteractions(fixture.methodChannel); + }); + + test('discardProfiler', () async { + final traceId = SentryId.newId(); + when(fixture.methodChannel + .invokeMethod('discardProfiler', traceId.toString())) + .thenAnswer((_) async {}); + + final sut = fixture.getSut(); + await sut.discardProfiler(traceId); + + verify(fixture.methodChannel + .invokeMethod('discardProfiler', traceId.toString())); + }); + + test('collectProfile', () async { + final traceId = SentryId.newId(); + const startTime = 42; + const endTime = 50; + when(fixture.methodChannel + .invokeMapMethod('collectProfile', { + 'traceId': traceId.toString(), + 'startTime': startTime, + 'endTime': endTime, + })).thenAnswer((_) => Future.value()); + + final sut = fixture.getSut(); + await sut.collectProfile(traceId, startTime, endTime); + + verify(fixture.methodChannel.invokeMapMethod('collectProfile', { + 'traceId': traceId.toString(), + 'startTime': startTime, + 'endTime': endTime, + })); + }); }); } class Fixture { final methodChannel = MockMethodChannel(); - final options = SentryFlutterOptions(); SentryNativeChannel getSut() { - return SentryNativeChannel(methodChannel, options); + return SentryNativeChannel(methodChannel); } } diff --git a/flutter/test/sentry_native_test.dart b/flutter/test/sentry_native_test.dart index 4d38a45122..68dc16fdfa 100644 --- a/flutter/test/sentry_native_test.dart +++ b/flutter/test/sentry_native_test.dart @@ -2,27 +2,22 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; -import 'package:sentry_flutter/src/sentry_native.dart'; -import 'package:sentry_flutter/src/sentry_native_channel.dart'; +import 'package:sentry_flutter/src/native/sentry_native.dart'; import 'mocks.dart'; void main() { group('$SentryNative', () { - late Fixture fixture; - - setUp(() { - fixture = Fixture(); - }); + final channel = MockNativeChannel(); + final options = SentryFlutterOptions(dsn: fakeDsn); + late final sut = SentryNative(options, channel); tearDown(() { - fixture.getSut().reset(); + sut.reset(); }); test('fetchNativeAppStart sets didFetchAppStart', () async { final nativeAppStart = NativeAppStart(0.0, true); - fixture.channel.nativeAppStart = nativeAppStart; - - final sut = fixture.getSut(); + channel.nativeAppStart = nativeAppStart; expect(sut.didFetchAppStart, false); @@ -33,110 +28,88 @@ void main() { }); test('beginNativeFramesCollection', () async { - final sut = fixture.getSut(); - await sut.beginNativeFramesCollection(); - - expect(fixture.channel.numberOfBeginNativeFramesCalls, 1); + expect(channel.numberOfBeginNativeFramesCalls, 1); }); test('endNativeFramesCollection', () async { final nativeFrames = NativeFrames(3, 2, 1); final traceId = SentryId.empty(); - fixture.channel.nativeFrames = nativeFrames; - - final sut = fixture.getSut(); + channel.nativeFrames = nativeFrames; final actual = await sut.endNativeFramesCollection(traceId); expect(actual, nativeFrames); - expect(fixture.channel.id, traceId); - expect(fixture.channel.numberOfEndNativeFramesCalls, 1); + expect(channel.id, traceId); + expect(channel.numberOfEndNativeFramesCalls, 1); }); test('setUser', () async { - final sut = fixture.getSut(); await sut.setUser(null); - - expect(fixture.channel.numberOfSetUserCalls, 1); + expect(channel.numberOfSetUserCalls, 1); }); test('addBreadcrumb', () async { - final sut = fixture.getSut(); await sut.addBreadcrumb(Breadcrumb()); - - expect(fixture.channel.numberOfAddBreadcrumbCalls, 1); + expect(channel.numberOfAddBreadcrumbCalls, 1); }); test('clearBreadcrumbs', () async { - final sut = fixture.getSut(); await sut.clearBreadcrumbs(); - - expect(fixture.channel.numberOfClearBreadcrumbCalls, 1); + expect(channel.numberOfClearBreadcrumbCalls, 1); }); test('setContexts', () async { - final sut = fixture.getSut(); await sut.setContexts('fixture-key', 'fixture-value'); - - expect(fixture.channel.numberOfSetContextsCalls, 1); + expect(channel.numberOfSetContextsCalls, 1); }); test('removeContexts', () async { - final sut = fixture.getSut(); await sut.removeContexts('fixture-key'); - - expect(fixture.channel.numberOfRemoveContextsCalls, 1); + expect(channel.numberOfRemoveContextsCalls, 1); }); test('setExtra', () async { - final sut = fixture.getSut(); await sut.setExtra('fixture-key', 'fixture-value'); - - expect(fixture.channel.numberOfSetExtraCalls, 1); + expect(channel.numberOfSetExtraCalls, 1); }); test('removeExtra', () async { - final sut = fixture.getSut(); await sut.removeExtra('fixture-key'); - - expect(fixture.channel.numberOfRemoveExtraCalls, 1); + expect(channel.numberOfRemoveExtraCalls, 1); }); test('setTag', () async { - final sut = fixture.getSut(); await sut.setTag('fixture-key', 'fixture-value'); - - expect(fixture.channel.numberOfSetTagCalls, 1); + expect(channel.numberOfSetTagCalls, 1); }); test('removeTag', () async { - final sut = fixture.getSut(); await sut.removeTag('fixture-key'); + expect(channel.numberOfRemoveTagCalls, 1); + }); - expect(fixture.channel.numberOfRemoveTagCalls, 1); + test('startProfiler', () async { + sut.startProfiler(SentryId.newId()); + expect(channel.numberOfStartProfilerCalls, 1); }); - test('reset', () async { - final sut = fixture.getSut(); + test('discardProfiler', () async { + await sut.discardProfiler(SentryId.newId()); + expect(channel.numberOfDiscardProfilerCalls, 1); + }); + + test('collectProfile', () async { + await sut.collectProfile(SentryId.newId(), 1, 2); + expect(channel.numberOfCollectProfileCalls, 1); + }); + test('reset', () async { sut.appStartEnd = DateTime.now(); await sut.fetchNativeAppStart(); - sut.reset(); - expect(sut.appStartEnd, null); expect(sut.didFetchAppStart, false); }); }); } - -class Fixture { - final channel = MockNativeChannel(); - - SentryNative getSut() { - final sut = SentryNative(); - sut.nativeChannel = channel; - return sut; - } -} diff --git a/flutter/test/sentry_navigator_observer_test.dart b/flutter/test/sentry_navigator_observer_test.dart index d3871b4390..c49588ab85 100644 --- a/flutter/test/sentry_navigator_observer_test.dart +++ b/flutter/test/sentry_navigator_observer_test.dart @@ -5,8 +5,7 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; -import 'package:sentry_flutter/src/sentry_native.dart'; -import 'package:sentry_flutter/src/sentry_native_channel.dart'; +import 'package:sentry_flutter/src/native/sentry_native.dart'; import 'package:sentry/src/sentry_tracer.dart'; import 'mocks.dart'; @@ -34,21 +33,25 @@ void main() { } setUp(() { - SentryNative().reset(); fixture = Fixture(); }); - tearDown(() { - SentryNative().reset(); - }); - group('NativeFrames', () { + late MockNativeChannel mockNativeChannel; + + setUp(() { + mockNativeChannel = MockNativeChannel(); + SentryFlutter.native = + SentryNative(SentryFlutterOptions(dsn: fakeDsn), mockNativeChannel); + }); + + tearDown(() { + SentryFlutter.native = null; + }); + test('transaction start begins frames collection', () async { final currentRoute = route(RouteSettings(name: 'Current Route')); final mockHub = _MockHub(); - final native = SentryNative(); - final mockNativeChannel = MockNativeChannel(); - native.nativeChannel = mockNativeChannel; final tracer = getMockSentryTracer(); _whenAnyStart(mockHub, tracer); @@ -66,17 +69,13 @@ void main() { test('transaction finish adds native frames to tracer', () async { final currentRoute = route(RouteSettings(name: 'Current Route')); - final options = SentryOptions(dsn: fakeDsn); + final options = defaultTestOptions(); options.tracesSampleRate = 1; final hub = Hub(options); final nativeFrames = NativeFrames(3, 2, 1); - final mockNativeChannel = MockNativeChannel(); mockNativeChannel.nativeFrames = nativeFrames; - final mockNative = SentryNative(); - mockNative.nativeChannel = mockNativeChannel; - final sut = fixture.getSut( hub: hub, autoFinishAfter: Duration(milliseconds: 50), @@ -368,6 +367,73 @@ void main() { expect(scope.span, span); }); }); + + test('didPush sets current route name', () { + const name = 'Current Route'; + final currentRoute = route(RouteSettings(name: name)); + + const op = 'navigation'; + final hub = _MockHub(); + final span = getMockSentryTracer(name: name); + when(span.context).thenReturn(SentrySpanContext(operation: op)); + _whenAnyStart(hub, span); + + final sut = fixture.getSut( + hub: hub, + autoFinishAfter: Duration(seconds: 5), + ); + + sut.didPush(currentRoute, null); + + expect(SentryNavigatorObserver.currentRouteName, 'Current Route'); + }); + + test('didReplace sets new route name', () { + const oldRouteName = 'Old Route'; + final oldRoute = route(RouteSettings(name: oldRouteName)); + const newRouteName = 'New Route'; + final newRoute = route(RouteSettings(name: newRouteName)); + + const op = 'navigation'; + final hub = _MockHub(); + final span = getMockSentryTracer(name: oldRouteName); + when(span.context).thenReturn(SentrySpanContext(operation: op)); + _whenAnyStart(hub, span); + + final sut = fixture.getSut( + hub: hub, + autoFinishAfter: Duration(seconds: 5), + ); + + sut.didPush(oldRoute, null); + sut.didReplace(newRoute: newRoute, oldRoute: oldRoute); + + expect(SentryNavigatorObserver.currentRouteName, 'New Route'); + }); + + test('popRoute sets previous route name', () { + const oldRouteName = 'Old Route'; + final oldRoute = route(RouteSettings(name: oldRouteName)); + const newRouteName = 'New Route'; + final newRoute = route(RouteSettings(name: newRouteName)); + + const op = 'navigation'; + final hub = _MockHub(); + final span = getMockSentryTracer(name: oldRouteName); + when(span.context).thenReturn(SentrySpanContext(operation: op)); + when(span.status).thenReturn(null); + _whenAnyStart(hub, span); + + final sut = fixture.getSut( + hub: hub, + autoFinishAfter: Duration(seconds: 5), + ); + + sut.didPush(oldRoute, null); + sut.didPop(newRoute, oldRoute); + + expect(SentryNavigatorObserver.currentRouteName, 'Old Route'); + }); }); group('RouteObserverBreadcrumb', () { @@ -729,6 +795,8 @@ void main() { } class Fixture { + final mockNativeChannel = MockNativeChannel(); + SentryNavigatorObserver getSut({ required Hub hub, bool enableAutoTransactions = true, @@ -754,8 +822,9 @@ class Fixture { class _MockHub extends MockHub { @override - final options = SentryOptions(dsn: fakeDsn); + final options = defaultTestOptions(); + @override late final scope = Scope(options); @override diff --git a/flutter/test/sentry_widget_test.dart b/flutter/test/sentry_widget_test.dart new file mode 100644 index 0000000000..a64fded42f --- /dev/null +++ b/flutter/test/sentry_widget_test.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; + +void main() { + group('SentryWidget', () { + const testChild = Text('Test Child'); + + setUp(() async { + TestWidgetsFlutterBinding.ensureInitialized(); + }); + + testWidgets('SentryWidget wraps child with SentryUserInteractionWidget', + (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + home: SentryWidget(child: testChild), + ), + ); + + expect(find.byType(SentryUserInteractionWidget), findsOneWidget); + expect(find.byWidget(testChild), findsOneWidget); + }); + + testWidgets('SentryWidget wraps child with SentryScreenshotWidget', + (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + home: SentryWidget(child: testChild), + ), + ); + + expect(find.byType(SentryScreenshotWidget), findsOneWidget); + expect(find.byWidget(testChild), findsOneWidget); + }); + }); +} diff --git a/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart b/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart index 02d1022157..0fb73cb930 100644 --- a/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart +++ b/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart @@ -32,6 +32,75 @@ void main() { }, ); + testWidgets( + '$SentryUserInteractionWidget does not apply when enableUserInteractionTracing and enableUserInteractionBreadcrumbs is false', + (tester) async { + await tester.runAsync(() async { + await tester.pumpWidget( + fixture.getSut( + enableUserInteractionTracing: false, + enableUserInteractionBreadcrumbs: false, + ), + ); + final specificChildFinder = find.byType(MyApp); + + expect( + find.ancestor( + of: specificChildFinder, + matching: find.byType(Listener), + ), + findsNothing, + ); + }); + }, + ); + + testWidgets( + '$SentryUserInteractionWidget does apply when enableUserInteractionTracing is true', + (tester) async { + await tester.runAsync(() async { + await tester.pumpWidget( + fixture.getSut( + enableUserInteractionTracing: true, + enableUserInteractionBreadcrumbs: false, + ), + ); + final specificChildFinder = find.byType(MyApp); + + expect( + find.ancestor( + of: specificChildFinder, + matching: find.byType(Listener), + ), + findsOne, + ); + }); + }, + ); + + testWidgets( + '$SentryUserInteractionWidget does apply when enableUserInteractionBreadcrumbs is true', + (tester) async { + await tester.runAsync(() async { + await tester.pumpWidget( + fixture.getSut( + enableUserInteractionTracing: false, + enableUserInteractionBreadcrumbs: true, + ), + ); + final specificChildFinder = find.byType(MyApp); + + expect( + find.ancestor( + of: specificChildFinder, + matching: find.byType(Listener), + ), + findsOne, + ); + }); + }, + ); + group('$SentryUserInteractionWidget crumbs', () { testWidgets('Add crumb for MaterialButton', (tester) async { await tester.runAsync(() async { @@ -327,7 +396,7 @@ class Fixture { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -340,7 +409,7 @@ class MyApp extends StatelessWidget { } class Page1 extends StatelessWidget { - const Page1({Key? key}) : super(key: key); + const Page1({super.key}); @override Widget build(BuildContext context) { @@ -416,7 +485,7 @@ class Page1 extends StatelessWidget { } class Page2 extends StatelessWidget { - const Page2({Key? key}) : super(key: key); + const Page2({super.key}); @override Widget build(BuildContext context) { diff --git a/flutter/test/view_hierarchy/sentry_tree_walker_test.dart b/flutter/test/view_hierarchy/sentry_tree_walker_test.dart index c2048c3492..52d775529b 100644 --- a/flutter/test/view_hierarchy/sentry_tree_walker_test.dart +++ b/flutter/test/view_hierarchy/sentry_tree_walker_test.dart @@ -172,7 +172,7 @@ bool _findWidget( } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/flutter/test/view_hierarchy/view_hierarchy_event_processor_test.dart b/flutter/test/view_hierarchy/view_hierarchy_event_processor_test.dart index a409d1a293..7743e8ebc6 100644 --- a/flutter/test/view_hierarchy/view_hierarchy_event_processor_test.dart +++ b/flutter/test/view_hierarchy/view_hierarchy_event_processor_test.dart @@ -107,7 +107,7 @@ class Fixture { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/hive/.gitignore b/hive/.gitignore new file mode 100644 index 0000000000..ba521d5a39 --- /dev/null +++ b/hive/.gitignore @@ -0,0 +1,14 @@ +# Omit committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ diff --git a/hive/CHANGELOG.md b/hive/CHANGELOG.md new file mode 120000 index 0000000000..04c99a55ca --- /dev/null +++ b/hive/CHANGELOG.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/hive/LICENSE b/hive/LICENSE new file mode 100644 index 0000000000..2a6964d84d --- /dev/null +++ b/hive/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/hive/README.md b/hive/README.md new file mode 100644 index 0000000000..14f26d9ce8 --- /dev/null +++ b/hive/README.md @@ -0,0 +1,86 @@ +

+ + + +
+

+ +Sentry integration for `hive` package +=========== + +| package | build | pub | likes | popularity | pub points | +|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------| ------- | +| sentry_hive | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-hive) | [![pub package](https://img.shields.io/pub/v/sentry_hive.svg)](https://pub.dev/packages/sentry_hive) | [![likes](https://img.shields.io/pub/likes/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![pub points](https://img.shields.io/pub/points/sentry_hive)](https://pub.dev/packages/sentry_hive/score) + +Integration for the [`hive`](https://pub.dev/packages/hive) package. + +#### Usage + +- Sign up for a Sentry.io account and get a DSN at https://sentry.io. + +- Follow the installing instructions on [pub.dev](https://pub.dev/packages/sentry/install). + +- Initialize the Sentry SDK using the DSN issued by Sentry.io. + +- Call... + +```dart +import 'package:sentry/sentry.dart'; +import 'package:hive/hive.dart'; +import 'package:sentry_hive/sentry_hive.dart'; +import 'package:path_provider/path_provider.dart'; + +Future main() async { + await SentryFlutter.init( + (options) { + options.dsn = 'https://example@sentry.io/add-your-dsn-here'; + options.tracesSampleRate = 1.0; + }, + appRunner: () => runApp(YourApp()), + ); +} + +Future insertUser() async { + // Use [SentryHive] where you would use [Hive] + final appDir = await getApplicationDocumentsDirectory(); + SentryHive + ..init(appDir.path) + ..registerAdapter(PersonAdapter()); + + var box = await SentryHive.openBox('testBox'); + + var person = Person( + name: 'Dave', + age: 22, + ); + + await box.put('dave', person); + + print(box.get('dave')); // Dave: 22 +} + +@HiveType(typeId: 1) +class Person { + Person({required this.name, required this.age}); + + @HiveField(0) + String name; + + @HiveField(1) + int age; + + @override + String toString() { + return '$name: $age'; + } +} +``` + +#### Resources + +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) +* [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/hive/analysis_options.yaml b/hive/analysis_options.yaml new file mode 100644 index 0000000000..28ddbe2636 --- /dev/null +++ b/hive/analysis_options.yaml @@ -0,0 +1,34 @@ +include: package:lints/recommended.yaml + +analyzer: + language: + strict-casts: true + strict-inference: true + strict-raw-types: true + errors: + # treat missing required parameters as a warning (not a hint) + missing_required_param: error + # treat missing returns as a warning (not a hint) + missing_return: error + # allow having TODOs in the code + todo: ignore + # allow self-reference to deprecated members (we do this because otherwise we have + # to annotate every member in every test, assert, etc, when we deprecate something) + deprecated_member_use_from_same_package: warning + # ignore sentry/path on pubspec as we change it on deployment + invalid_dependency: ignore + unnecessary_import: ignore + exclude: + - example/** + - test/mocks/mocks.mocks.dart + +linter: + rules: + - prefer_final_locals + - public_member_api_docs + - prefer_single_quotes + - prefer_relative_imports + - unnecessary_brace_in_string_interps + - implementation_imports + - require_trailing_commas + - unawaited_futures diff --git a/hive/boxes_bad_keys.hive b/hive/boxes_bad_keys.hive new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hive/dartdoc_options.yaml b/hive/dartdoc_options.yaml new file mode 120000 index 0000000000..7cbb8c0d74 --- /dev/null +++ b/hive/dartdoc_options.yaml @@ -0,0 +1 @@ +../dart/dartdoc_options.yaml \ No newline at end of file diff --git a/hive/example/example.dart b/hive/example/example.dart new file mode 100644 index 0000000000..b6d824e576 --- /dev/null +++ b/hive/example/example.dart @@ -0,0 +1,54 @@ +import 'package:sentry/sentry.dart'; +import 'package:hive/hive.dart'; +import 'package:sentry_hive/sentry_hive.dart'; + +part 'main.g.dart'; + +Future main() async { + // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io + const dsn = + 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; + + await Sentry.init( + (options) { + options.dsn = dsn; + options.tracesSampleRate = 1.0; + options.debug = true; + }, + appRunner: runApp, // Init your App. + ); +} + +Future runApp() async { + // Use [SentryHive] where you would use [Hive] + SentryHive + ..init(Directory.current.path) + ..registerAdapter(PersonAdapter()); + + var box = await SentryHive.openBox('testBox'); + + var person = Person( + name: 'Dave', + age: 22, + ); + + await box.put('dave', person); + + print(box.get('dave')); // Dave: 22 +} + +@HiveType(typeId: 1) +class Person { + Person({required this.name, required this.age}); + + @HiveField(0) + String name; + + @HiveField(1) + int age; + + @override + String toString() { + return '$name: $age'; + } +} diff --git a/hive/lib/sentry_hive.dart b/hive/lib/sentry_hive.dart new file mode 100644 index 0000000000..03be720ca1 --- /dev/null +++ b/hive/lib/sentry_hive.dart @@ -0,0 +1,15 @@ +library sentry_hive; + +import 'package:meta/meta.dart'; +import 'package:hive/hive.dart'; +import 'src/sentry_hive_impl.dart'; +import 'src/sentry_hive_interface.dart'; + +export 'src/sentry_hive_interface.dart'; +export 'src/sentry_box_collection.dart'; + +/// Use [SentryHive] constant instead of [Hive] to get automatic performance +/// monitoring. +@experimental +// ignore: non_constant_identifier_names +SentryHiveInterface SentryHive = SentryHiveImpl(Hive); diff --git a/hive/lib/src/default_compaction_strategy.dart b/hive/lib/src/default_compaction_strategy.dart new file mode 100644 index 0000000000..0bcd0ecdb7 --- /dev/null +++ b/hive/lib/src/default_compaction_strategy.dart @@ -0,0 +1,9 @@ +const _deletedRatio = 0.15; +const _deletedThreshold = 60; + +/// Default compaction strategy compacts if 15% of total values and at least 60 +/// values have been deleted +bool defaultCompactionStrategy(int entries, int deletedEntries) { + return deletedEntries > _deletedThreshold && + deletedEntries / entries > _deletedRatio; +} diff --git a/hive/lib/src/default_key_comparator.dart b/hive/lib/src/default_key_comparator.dart new file mode 100644 index 0000000000..d7833ff536 --- /dev/null +++ b/hive/lib/src/default_key_comparator.dart @@ -0,0 +1,20 @@ +/// Efficient default implementation to compare keys +int defaultKeyComparator(dynamic k1, dynamic k2) { + if (k1 is int) { + if (k2 is int) { + if (k1 > k2) { + return 1; + } else if (k1 < k2) { + return -1; + } else { + return 0; + } + } else { + return -1; + } + } else if (k2 is String) { + return (k1 as String).compareTo(k2); + } else { + return 1; + } +} diff --git a/hive/lib/src/sentry_box.dart b/hive/lib/src/sentry_box.dart new file mode 100644 index 0000000000..f405307d43 --- /dev/null +++ b/hive/lib/src/sentry_box.dart @@ -0,0 +1,37 @@ +import 'package:meta/meta.dart'; +import 'package:hive/hive.dart'; +import 'package:sentry/sentry.dart'; + +import 'sentry_box_base.dart'; + +/// @nodoc +@internal +class SentryBox extends SentryBoxBase implements Box { + final Box _box; + + /// @nodoc + SentryBox(this._box, @internal Hub hub) : super(_box, hub); + + @override + E? get(key, {E? defaultValue}) { + return _box.get(key, defaultValue: defaultValue); + } + + @override + E? getAt(int index) { + return _box.getAt(index); + } + + @override + Map toMap() { + return _box.toMap(); + } + + @override + Iterable get values => _box.values; + + @override + Iterable valuesBetween({startKey, endKey}) { + return _box.valuesBetween(startKey: startKey, endKey: endKey); + } +} diff --git a/hive/lib/src/sentry_box_base.dart b/hive/lib/src/sentry_box_base.dart new file mode 100644 index 0000000000..6623fed5ad --- /dev/null +++ b/hive/lib/src/sentry_box_base.dart @@ -0,0 +1,203 @@ +import 'package:hive/hive.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'sentry_span_helper.dart'; + +/// @nodoc +@internal +class SentryBoxBase implements BoxBase { + final BoxBase _boxBase; + final Hub _hub; + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbHiveBoxBase, + ); + + /// @nodoc + SentryBoxBase(this._boxBase, this._hub) { + _spanHelper.setHub(this._hub); + } + + @override + Future add(E value) async { + return _spanHelper.asyncWrapInSpan( + 'add', + () { + return _boxBase.add(value); + }, + dbName: name, + ); + } + + @override + Future> addAll(Iterable values) { + return _spanHelper.asyncWrapInSpan( + 'addAll', + () { + return _boxBase.addAll(values); + }, + dbName: name, + ); + } + + @override + Future clear() { + return _spanHelper.asyncWrapInSpan( + 'clear', + () { + return _boxBase.clear(); + }, + dbName: name, + ); + } + + @override + Future close() { + return _spanHelper.asyncWrapInSpan( + 'close', + () { + return _boxBase.close(); + }, + dbName: name, + ); + } + + @override + Future compact() { + return _spanHelper.asyncWrapInSpan( + 'compact', + () { + return _boxBase.compact(); + }, + dbName: name, + ); + } + + @override + bool containsKey(key) { + return _boxBase.containsKey(key); + } + + @override + Future delete(key) { + return _spanHelper.asyncWrapInSpan( + 'delete', + () { + return _boxBase.delete(key); + }, + dbName: name, + ); + } + + @override + Future deleteAll(Iterable keys) { + return _spanHelper.asyncWrapInSpan( + 'deleteAll', + () { + return _boxBase.deleteAll(keys); + }, + dbName: name, + ); + } + + @override + Future deleteAt(int index) { + return _spanHelper.asyncWrapInSpan( + 'deleteAt', + () { + return _boxBase.deleteAt(index); + }, + dbName: name, + ); + } + + @override + Future deleteFromDisk() { + return _spanHelper.asyncWrapInSpan( + 'deleteFromDisk', + () { + return _boxBase.deleteFromDisk(); + }, + dbName: name, + ); + } + + @override + Future flush() { + return _spanHelper.asyncWrapInSpan( + 'flush', + () { + return _boxBase.flush(); + }, + dbName: name, + ); + } + + @override + bool get isEmpty => _boxBase.isEmpty; + + @override + bool get isNotEmpty => _boxBase.isNotEmpty; + + @override + bool get isOpen => _boxBase.isOpen; + + @override + keyAt(int index) { + return _boxBase.keyAt(index); + } + + @override + Iterable get keys => _boxBase.keys; + + @override + bool get lazy => _boxBase.lazy; + + @override + int get length => _boxBase.length; + + @override + String get name => _boxBase.name; + + @override + String? get path => _boxBase.path; + + @override + Future put(key, value) { + return _spanHelper.asyncWrapInSpan( + 'put', + () { + return _boxBase.put(key, value); + }, + dbName: name, + ); + } + + @override + Future putAll(Map entries) { + return _spanHelper.asyncWrapInSpan( + 'putAll', + () { + return _boxBase.putAll(entries); + }, + dbName: name, + ); + } + + @override + Future putAt(int index, value) { + return _spanHelper.asyncWrapInSpan( + 'putAt', + () { + return _boxBase.putAt(index, value); + }, + dbName: name, + ); + } + + @override + Stream watch({key}) { + return _boxBase.watch(key: key); + } +} diff --git a/hive/lib/src/sentry_box_collection.dart b/hive/lib/src/sentry_box_collection.dart new file mode 100644 index 0000000000..d4c605efe2 --- /dev/null +++ b/hive/lib/src/sentry_box_collection.dart @@ -0,0 +1,125 @@ +import 'package:hive/hive.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; + +import 'sentry_span_helper.dart'; + +// ignore: implementation_imports +import 'package:hive/src/box_collection/box_collection_stub.dart' as stub; + +// ignore: implementation_imports +import 'package:hive/src/box_collection/box_collection_stub.dart' + if (dart.library.html) 'package:hive/src/box_collection/box_collection_indexed_db.dart' + if (dart.library.io) 'package:hive/src/box_collection/box_collection.dart' + as impl; + +/// Use instead of [BoxCollection] to add automatic tracing. +class SentryBoxCollection implements stub.BoxCollection { + final impl.BoxCollection _boxCollection; + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbHiveBoxCollection, + ); + + /// Init with [impl.BoxCollection] + SentryBoxCollection(this._boxCollection); + + @override + Set get boxNames => _boxCollection.boxNames; + + @override + void close() { + _boxCollection.close(); + } + + /// @nodoc + @internal + void setHub(Hub hub) { + _spanHelper.setHub(hub); + } + + @override + Future deleteFromDisk() { + return _spanHelper.asyncWrapInSpan( + 'deleteFromDisk', + () { + return _boxCollection.deleteFromDisk(); + }, + dbName: name, + ); + } + + @override + String get name => _boxCollection.name; + + // ignore: public_member_api_docs + static Future open( + String name, + Set boxNames, { + String? path, + HiveCipher? key, + Hub? hub, + }) async { + final spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbHiveBoxCollection, + ); + spanHelper.setHub(hub ?? HubAdapter()); + + return await spanHelper.asyncWrapInSpan( + 'open', + () async { + final boxCollection = await impl.BoxCollection.open( + name, + boxNames, + path: path, + key: key, + ); + final sbc = SentryBoxCollection(boxCollection); + sbc.setHub(hub ?? HubAdapter()); + return sbc; + }, + dbName: name, + ); + } + + @override + Future> openBox( + String name, { + bool preload = false, + stub.CollectionBox Function(String p1, stub.BoxCollection p2)? + boxCreator, + }) { + return _spanHelper.asyncWrapInSpan( + 'openBox', + () { + return _boxCollection.openBox( + name, + preload: preload, + boxCreator: boxCreator, + ); + }, + dbName: this.name, + ); + } + + @override + Future transaction( + Future Function() action, { + List? boxNames, + bool readOnly = false, + }) async { + return await _spanHelper.asyncWrapInSpan( + 'transaction', + () { + return _boxCollection.transaction( + action, + boxNames: boxNames, + readOnly: readOnly, + ); + }, + dbName: name, + ); + } +} diff --git a/hive/lib/src/sentry_hive_impl.dart b/hive/lib/src/sentry_hive_impl.dart new file mode 100644 index 0000000000..83e0e2234a --- /dev/null +++ b/hive/lib/src/sentry_hive_impl.dart @@ -0,0 +1,208 @@ +import 'dart:typed_data'; + +import 'package:hive/hive.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'version.dart'; +import 'sentry_box.dart'; +import 'sentry_lazy_box.dart'; +import 'sentry_hive_interface.dart'; + +import 'default_compaction_strategy.dart'; +import 'default_key_comparator.dart'; +import 'sentry_span_helper.dart'; + +/// @nodoc +@internal +class SentryHiveImpl implements SentryHiveInterface { + @internal + // ignore: public_member_api_docs + static const dbOp = 'db'; + + @internal + // ignore: public_member_api_docs + static const dbSystemKey = 'db.system'; + @internal + // ignore: public_member_api_docs + static const dbSystem = 'flutter_hive'; + + @internal + // ignore: public_member_api_docs + static const dbNameKey = 'db.name'; + + final HiveInterface _hive; + Hub _hub = HubAdapter(); + + /// @nodoc + SentryHiveImpl(this._hive); + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbHive, + ); + + // SentryHiveInterface + + @override + void setHub(Hub hub) { + // ignore: invalid_use_of_internal_member + final options = hub.options; + options.sdk.addIntegration('SentryHiveTracing'); + options.sdk.addPackage(packageName, sdkVersion); + _hub = hub; + _spanHelper.setHub(hub); + } + + // HiveInterface + + @override + void init( + String? path, { + HiveStorageBackendPreference backendPreference = + HiveStorageBackendPreference.native, + }) { + return Hive.init(path, backendPreference: backendPreference); + } + + @override + Box box(String name) { + return _hive.box(name); + } + + @override + Future boxExists(String name, {String? path}) { + return _spanHelper.asyncWrapInSpan('boxExists', () { + return _hive.boxExists(name, path: path); + }); + } + + @override + Future close() { + return _spanHelper.asyncWrapInSpan('close', () { + return _hive.close(); + }); + } + + @override + Future deleteBoxFromDisk(String name, {String? path}) { + return _spanHelper.asyncWrapInSpan('deleteBoxFromDisk', () { + return _hive.deleteBoxFromDisk(name, path: path); + }); + } + + @override + Future deleteFromDisk() { + return _spanHelper.asyncWrapInSpan('deleteFromDisk', () { + return _hive.deleteFromDisk(); + }); + } + + @override + List generateSecureKey() { + return _hive.generateSecureKey(); + } + + @override + void ignoreTypeId(int typeId) { + return _hive.ignoreTypeId(typeId); + } + + @override + bool isAdapterRegistered(int typeId) { + return _hive.isAdapterRegistered(typeId); + } + + @override + bool isBoxOpen(String name) { + return _hive.isBoxOpen(name); + } + + @override + LazyBox lazyBox(String name) { + return _hive.lazyBox(name); + } + + @override + Future> openBox( + String name, { + HiveCipher? encryptionCipher, + KeyComparator keyComparator = defaultKeyComparator, + CompactionStrategy compactionStrategy = defaultCompactionStrategy, + bool crashRecovery = true, + String? path, + Uint8List? bytes, + String? collection, + @Deprecated('Use encryptionCipher instead') List? encryptionKey, + }) { + return _spanHelper.asyncWrapInSpan( + 'openBox', + () async { + final Box box = await _hive.openBox( + name, + encryptionCipher: encryptionCipher, + keyComparator: keyComparator, + compactionStrategy: compactionStrategy, + crashRecovery: crashRecovery, + path: path, + bytes: bytes, + collection: collection, + // ignore: deprecated_member_use + encryptionKey: encryptionKey, + ); + return SentryBox(box, _hub); + }, + dbName: name, + ); + } + + @override + Future> openLazyBox( + String name, { + HiveCipher? encryptionCipher, + KeyComparator keyComparator = defaultKeyComparator, + CompactionStrategy compactionStrategy = defaultCompactionStrategy, + bool crashRecovery = true, + String? path, + String? collection, + @Deprecated('Use encryptionCipher instead') List? encryptionKey, + }) { + return _spanHelper.asyncWrapInSpan( + 'openLazyBox', + () async { + final LazyBox lazyBox = await _hive.openLazyBox( + name, + encryptionCipher: encryptionCipher, + keyComparator: keyComparator, + compactionStrategy: compactionStrategy, + crashRecovery: crashRecovery, + path: path, + collection: collection, + // ignore: deprecated_member_use + encryptionKey: encryptionKey, + ); + return SentryLazyBox(lazyBox, _hub); + }, + dbName: name, + ); + } + + @override + void registerAdapter( + TypeAdapter adapter, { + bool internal = false, + bool override = false, + }) { + return _hive.registerAdapter( + adapter, + internal: internal, + override: override, + ); + } + + @visibleForTesting + @override + void resetAdapters() { + // ignore: invalid_use_of_visible_for_testing_member + return _hive.resetAdapters(); + } +} diff --git a/hive/lib/src/sentry_hive_interface.dart b/hive/lib/src/sentry_hive_interface.dart new file mode 100644 index 0000000000..18c76611e8 --- /dev/null +++ b/hive/lib/src/sentry_hive_interface.dart @@ -0,0 +1,11 @@ +import 'package:hive/hive.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; + +/// The main API interface of SentryHive. Available through the `SentryHive` +/// constant. +@experimental +abstract class SentryHiveInterface implements HiveInterface { + /// Set the Sentry [Hub] + void setHub(Hub hub); +} diff --git a/hive/lib/src/sentry_lazy_box.dart b/hive/lib/src/sentry_lazy_box.dart new file mode 100644 index 0000000000..86eabb9fdd --- /dev/null +++ b/hive/lib/src/sentry_lazy_box.dart @@ -0,0 +1,45 @@ +import 'package:hive/hive.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; + +import 'sentry_box_base.dart'; +import 'sentry_span_helper.dart'; + +/// @nodoc +@internal +class SentryLazyBox extends SentryBoxBase implements LazyBox { + final LazyBox _lazyBox; + final Hub _hub; + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbHiveLazyBox, + ); + + /// @nodoc + SentryLazyBox(this._lazyBox, @internal this._hub) : super(_lazyBox, _hub) { + _spanHelper.setHub(_hub); + } + + @override + Future get(key, {E? defaultValue}) { + return _spanHelper.asyncWrapInSpan( + 'get', + () { + return _lazyBox.get(key, defaultValue: defaultValue); + }, + dbName: name, + ); + } + + @override + Future getAt(int index) { + return _spanHelper.asyncWrapInSpan( + 'getAt', + () { + return _lazyBox.getAt(index); + }, + dbName: name, + ); + } +} diff --git a/hive/lib/src/sentry_span_helper.dart b/hive/lib/src/sentry_span_helper.dart new file mode 100644 index 0000000000..38a67501a4 --- /dev/null +++ b/hive/lib/src/sentry_span_helper.dart @@ -0,0 +1,78 @@ +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'sentry_hive_impl.dart'; + +/// @nodoc +@internal +class SentrySpanHelper { + /// @nodoc + Hub _hub = HubAdapter(); + + /// @nodoc + final String _origin; + + /// @nodoc + SentrySpanHelper(this._origin); + + /// @nodoc + void setHub(Hub hub) { + _hub = hub; + } + + /// @nodoc + @internal + Future asyncWrapInSpan( + String description, + Future Function() execute, { + String? dbName, + }) async { + final currentSpan = _hub.getSpan(); + final span = currentSpan?.startChild( + SentryHiveImpl.dbOp, + description: description, + ); + + // ignore: invalid_use_of_internal_member + span?.origin = _origin; + + var breadcrumb = Breadcrumb( + message: description, + data: {}, + type: 'query', + ); + + span?.setData(SentryHiveImpl.dbSystemKey, SentryHiveImpl.dbSystem); + if (dbName != null) { + span?.setData(SentryHiveImpl.dbNameKey, dbName); + } + + breadcrumb.data?[SentryHiveImpl.dbSystemKey] = SentryHiveImpl.dbSystem; + if (dbName != null) { + breadcrumb.data?[SentryHiveImpl.dbNameKey] = dbName; + } + + try { + final result = await execute(); + + span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + + return result; + } catch (exception) { + span?.throwable = exception; + span?.status = SpanStatus.internalError(); + + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); + + rethrow; + } finally { + await span?.finish(); + + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); + } + } +} diff --git a/hive/lib/src/version.dart b/hive/lib/src/version.dart new file mode 100644 index 0000000000..ac6247b5a5 --- /dev/null +++ b/hive/lib/src/version.dart @@ -0,0 +1,5 @@ +/// The SDK version reported to Sentry.io in the submitted events. +const String sdkVersion = '7.16.0'; + +/// The package name reported to Sentry.io in the submitted events. +const String packageName = 'pub:sentry_hive'; diff --git a/hive/people-box-collection_bad_keys.hive b/hive/people-box-collection_bad_keys.hive new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hive/pubspec.yaml b/hive/pubspec.yaml new file mode 100644 index 0000000000..cbcb5b16e6 --- /dev/null +++ b/hive/pubspec.yaml @@ -0,0 +1,22 @@ +name: sentry_hive +description: An integration which adds support for performance tracing for the hive package. +version: 7.16.0 +homepage: https://docs.sentry.io/platforms/flutter/ +repository: https://github.com/getsentry/sentry-dart +issue_tracker: https://github.com/getsentry/sentry-dart/issues + +environment: + sdk: '>=2.17.0 <4.0.0' + +dependencies: + sentry: 7.16.0 + hive: ^2.2.3 + meta: ^1.3.0 + +dev_dependencies: + lints: ^2.0.0 + test: ^1.21.0 + yaml: ^3.1.0 # needed for version match (code and pubspec) + mockito: ^5.1.0 + build_runner: ^2.4.2 + coverage: ^1.3.0 diff --git a/hive/pubspec_overrides.yaml b/hive/pubspec_overrides.yaml new file mode 100644 index 0000000000..16e71d16f0 --- /dev/null +++ b/hive/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + sentry: + path: ../dart diff --git a/hive/test/mocks/mocks.dart b/hive/test/mocks/mocks.dart new file mode 100644 index 0000000000..9b2db0e30d --- /dev/null +++ b/hive/test/mocks/mocks.dart @@ -0,0 +1,18 @@ +import 'package:hive/hive.dart'; +import 'package:mockito/annotations.dart'; +import 'package:sentry/sentry.dart'; + +import 'package:hive/src/box_collection/box_collection_stub.dart' + if (dart.library.html) 'package:hive/src/box_collection/box_collection_indexed_db.dart' + if (dart.library.io) 'package:hive/src/box_collection/box_collection.dart' + as impl; + +@GenerateMocks([ + Hub, + Box, + LazyBox, + HiveInterface, + // Edit generated code to make sure correct impl/stub class is used + impl.BoxCollection, +]) +void main() {} diff --git a/hive/test/mocks/mocks.mocks.dart b/hive/test/mocks/mocks.mocks.dart new file mode 100644 index 0000000000..6d1bb907d7 --- /dev/null +++ b/hive/test/mocks/mocks.mocks.dart @@ -0,0 +1,1307 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in sentry_hive/test/mocks/mocks.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; +import 'dart:typed_data' as _i8; + +import 'package:hive/hive.dart' as _i3; +import 'package:hive/src/box/default_compaction_strategy.dart' as _i7; +import 'package:hive/src/box/default_key_comparator.dart' as _i6; +import 'package:mockito/mockito.dart' as _i1; +import 'package:sentry/sentry.dart' as _i2; +import 'package:sentry/src/profiling.dart' as _i4; + +import 'package:hive/src/box_collection/box_collection_stub.dart' as stub; + +// ignore: implementation_imports +import 'package:hive/src/box_collection/box_collection_stub.dart' + if (dart.library.html) 'package:hive/src/box_collection/box_collection_indexed_db.dart' + if (dart.library.io) 'package:hive/src/box_collection/box_collection.dart' + as impl; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeSentryOptions_0 extends _i1.SmartFake implements _i2.SentryOptions { + _FakeSentryOptions_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSentryId_1 extends _i1.SmartFake implements _i2.SentryId { + _FakeSentryId_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeScope_2 extends _i1.SmartFake implements _i2.Scope { + _FakeScope_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeHub_3 extends _i1.SmartFake implements _i2.Hub { + _FakeHub_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeISentrySpan_4 extends _i1.SmartFake implements _i2.ISentrySpan { + _FakeISentrySpan_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBox_5 extends _i1.SmartFake implements _i3.Box { + _FakeBox_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeLazyBox_6 extends _i1.SmartFake implements _i3.LazyBox { + _FakeLazyBox_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeCollectionBox_7 extends _i1.SmartFake + implements _i3.CollectionBox { + _FakeCollectionBox_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Hub]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockHub extends _i1.Mock implements _i2.Hub { + MockHub() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.SentryOptions get options => (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeSentryOptions_0( + this, + Invocation.getter(#options), + ), + ) as _i2.SentryOptions); + + @override + bool get isEnabled => (super.noSuchMethod( + Invocation.getter(#isEnabled), + returnValue: false, + ) as bool); + + @override + _i2.SentryId get lastEventId => (super.noSuchMethod( + Invocation.getter(#lastEventId), + returnValue: _FakeSentryId_1( + this, + Invocation.getter(#lastEventId), + ), + ) as _i2.SentryId); + + @override + _i2.Scope get scope => (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_2( + this, + Invocation.getter(#scope), + ), + ) as _i2.Scope); + + @override + set profilerFactory(_i4.SentryProfilerFactory? value) => super.noSuchMethod( + Invocation.setter( + #profilerFactory, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future<_i2.SentryId> captureEvent( + dynamic event, { + dynamic stackTrace, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureEvent, + [event], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureEvent, + [event], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + _i5.Future<_i2.SentryId> captureException( + dynamic throwable, { + dynamic stackTrace, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureException, + [throwable], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureException, + [throwable], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + _i5.Future<_i2.SentryId> captureMessage( + String? message, { + _i2.SentryLevel? level, + String? template, + List? params, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + _i5.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => + (super.noSuchMethod( + Invocation.method( + #captureUserFeedback, + [userFeedback], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future addBreadcrumb( + _i2.Breadcrumb? crumb, { + _i2.Hint? hint, + }) => + (super.noSuchMethod( + Invocation.method( + #addBreadcrumb, + [crumb], + {#hint: hint}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + void bindClient(_i2.SentryClient? client) => super.noSuchMethod( + Invocation.method( + #bindClient, + [client], + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Hub clone() => (super.noSuchMethod( + Invocation.method( + #clone, + [], + ), + returnValue: _FakeHub_3( + this, + Invocation.method( + #clone, + [], + ), + ), + ) as _i2.Hub); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.FutureOr configureScope(_i2.ScopeCallback? callback) => + (super.noSuchMethod(Invocation.method( + #configureScope, + [callback], + )) as _i5.FutureOr); + + @override + _i2.ISentrySpan startTransaction( + String? name, + String? operation, { + String? description, + DateTime? startTimestamp, + bool? bindToScope, + bool? waitForChildren, + Duration? autoFinishAfter, + bool? trimEnd, + _i2.OnTransactionFinish? onFinish, + Map? customSamplingContext, + }) => + (super.noSuchMethod( + Invocation.method( + #startTransaction, + [ + name, + operation, + ], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + returnValue: _FakeISentrySpan_4( + this, + Invocation.method( + #startTransaction, + [ + name, + operation, + ], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + ), + ) as _i2.ISentrySpan); + + @override + _i2.ISentrySpan startTransactionWithContext( + _i2.SentryTransactionContext? transactionContext, { + Map? customSamplingContext, + DateTime? startTimestamp, + bool? bindToScope, + bool? waitForChildren, + Duration? autoFinishAfter, + bool? trimEnd, + _i2.OnTransactionFinish? onFinish, + }) => + (super.noSuchMethod( + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + returnValue: _FakeISentrySpan_4( + this, + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + ), + ) as _i2.ISentrySpan); + + @override + _i5.Future<_i2.SentryId> captureTransaction( + _i2.SentryTransaction? transaction, { + _i2.SentryTraceContextHeader? traceContext, + }) => + (super.noSuchMethod( + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext}, + ), + returnValue: _i5.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext}, + ), + )), + ) as _i5.Future<_i2.SentryId>); + + @override + void setSpanContext( + dynamic throwable, + _i2.ISentrySpan? span, + String? transaction, + ) => + super.noSuchMethod( + Invocation.method( + #setSpanContext, + [ + throwable, + span, + transaction, + ], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [Box]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockBox extends _i1.Mock implements _i3.Box { + MockBox() { + _i1.throwOnMissingStub(this); + } + + @override + Iterable get values => (super.noSuchMethod( + Invocation.getter(#values), + returnValue: [], + ) as Iterable); + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + bool get isOpen => (super.noSuchMethod( + Invocation.getter(#isOpen), + returnValue: false, + ) as bool); + + @override + bool get lazy => (super.noSuchMethod( + Invocation.getter(#lazy), + returnValue: false, + ) as bool); + + @override + Iterable get keys => (super.noSuchMethod( + Invocation.getter(#keys), + returnValue: [], + ) as Iterable); + + @override + int get length => (super.noSuchMethod( + Invocation.getter(#length), + returnValue: 0, + ) as int); + + @override + bool get isEmpty => (super.noSuchMethod( + Invocation.getter(#isEmpty), + returnValue: false, + ) as bool); + + @override + bool get isNotEmpty => (super.noSuchMethod( + Invocation.getter(#isNotEmpty), + returnValue: false, + ) as bool); + + @override + Iterable valuesBetween({ + dynamic startKey, + dynamic endKey, + }) => + (super.noSuchMethod( + Invocation.method( + #valuesBetween, + [], + { + #startKey: startKey, + #endKey: endKey, + }, + ), + returnValue: [], + ) as Iterable); + + @override + E? getAt(int? index) => (super.noSuchMethod(Invocation.method( + #getAt, + [index], + )) as E?); + + @override + Map toMap() => (super.noSuchMethod( + Invocation.method( + #toMap, + [], + ), + returnValue: {}, + ) as Map); + + @override + dynamic keyAt(int? index) => super.noSuchMethod(Invocation.method( + #keyAt, + [index], + )); + + @override + _i5.Stream<_i3.BoxEvent> watch({dynamic key}) => (super.noSuchMethod( + Invocation.method( + #watch, + [], + {#key: key}, + ), + returnValue: _i5.Stream<_i3.BoxEvent>.empty(), + ) as _i5.Stream<_i3.BoxEvent>); + + @override + bool containsKey(dynamic key) => (super.noSuchMethod( + Invocation.method( + #containsKey, + [key], + ), + returnValue: false, + ) as bool); + + @override + _i5.Future put( + dynamic key, + E? value, + ) => + (super.noSuchMethod( + Invocation.method( + #put, + [ + key, + value, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future putAt( + int? index, + E? value, + ) => + (super.noSuchMethod( + Invocation.method( + #putAt, + [ + index, + value, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future putAll(Map? entries) => (super.noSuchMethod( + Invocation.method( + #putAll, + [entries], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future add(E? value) => (super.noSuchMethod( + Invocation.method( + #add, + [value], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future> addAll(Iterable? values) => (super.noSuchMethod( + Invocation.method( + #addAll, + [values], + ), + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); + + @override + _i5.Future delete(dynamic key) => (super.noSuchMethod( + Invocation.method( + #delete, + [key], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteAt(int? index) => (super.noSuchMethod( + Invocation.method( + #deleteAt, + [index], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteAll(Iterable? keys) => (super.noSuchMethod( + Invocation.method( + #deleteAll, + [keys], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future compact() => (super.noSuchMethod( + Invocation.method( + #compact, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future clear() => (super.noSuchMethod( + Invocation.method( + #clear, + [], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteFromDisk() => (super.noSuchMethod( + Invocation.method( + #deleteFromDisk, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future flush() => (super.noSuchMethod( + Invocation.method( + #flush, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} + +/// A class which mocks [LazyBox]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockLazyBox extends _i1.Mock implements _i3.LazyBox { + MockLazyBox() { + _i1.throwOnMissingStub(this); + } + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + bool get isOpen => (super.noSuchMethod( + Invocation.getter(#isOpen), + returnValue: false, + ) as bool); + + @override + bool get lazy => (super.noSuchMethod( + Invocation.getter(#lazy), + returnValue: false, + ) as bool); + + @override + Iterable get keys => (super.noSuchMethod( + Invocation.getter(#keys), + returnValue: [], + ) as Iterable); + + @override + int get length => (super.noSuchMethod( + Invocation.getter(#length), + returnValue: 0, + ) as int); + + @override + bool get isEmpty => (super.noSuchMethod( + Invocation.getter(#isEmpty), + returnValue: false, + ) as bool); + + @override + bool get isNotEmpty => (super.noSuchMethod( + Invocation.getter(#isNotEmpty), + returnValue: false, + ) as bool); + + @override + _i5.Future get( + dynamic key, { + E? defaultValue, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [key], + {#defaultValue: defaultValue}, + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future getAt(int? index) => (super.noSuchMethod( + Invocation.method( + #getAt, + [index], + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + + @override + dynamic keyAt(int? index) => super.noSuchMethod(Invocation.method( + #keyAt, + [index], + )); + + @override + _i5.Stream<_i3.BoxEvent> watch({dynamic key}) => (super.noSuchMethod( + Invocation.method( + #watch, + [], + {#key: key}, + ), + returnValue: _i5.Stream<_i3.BoxEvent>.empty(), + ) as _i5.Stream<_i3.BoxEvent>); + + @override + bool containsKey(dynamic key) => (super.noSuchMethod( + Invocation.method( + #containsKey, + [key], + ), + returnValue: false, + ) as bool); + + @override + _i5.Future put( + dynamic key, + E? value, + ) => + (super.noSuchMethod( + Invocation.method( + #put, + [ + key, + value, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future putAt( + int? index, + E? value, + ) => + (super.noSuchMethod( + Invocation.method( + #putAt, + [ + index, + value, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future putAll(Map? entries) => (super.noSuchMethod( + Invocation.method( + #putAll, + [entries], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future add(E? value) => (super.noSuchMethod( + Invocation.method( + #add, + [value], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future> addAll(Iterable? values) => (super.noSuchMethod( + Invocation.method( + #addAll, + [values], + ), + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); + + @override + _i5.Future delete(dynamic key) => (super.noSuchMethod( + Invocation.method( + #delete, + [key], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteAt(int? index) => (super.noSuchMethod( + Invocation.method( + #deleteAt, + [index], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteAll(Iterable? keys) => (super.noSuchMethod( + Invocation.method( + #deleteAll, + [keys], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future compact() => (super.noSuchMethod( + Invocation.method( + #compact, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future clear() => (super.noSuchMethod( + Invocation.method( + #clear, + [], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteFromDisk() => (super.noSuchMethod( + Invocation.method( + #deleteFromDisk, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future flush() => (super.noSuchMethod( + Invocation.method( + #flush, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} + +/// A class which mocks [HiveInterface]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockHiveInterface extends _i1.Mock implements _i3.HiveInterface { + MockHiveInterface() { + _i1.throwOnMissingStub(this); + } + + @override + void init( + String? path, { + _i3.HiveStorageBackendPreference? backendPreference = + _i3.HiveStorageBackendPreference.native, + }) => + super.noSuchMethod( + Invocation.method( + #init, + [path], + {#backendPreference: backendPreference}, + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future<_i3.Box> openBox( + String? name, { + _i3.HiveCipher? encryptionCipher, + _i3.KeyComparator? keyComparator = _i6.defaultKeyComparator, + _i3.CompactionStrategy? compactionStrategy = _i7.defaultCompactionStrategy, + bool? crashRecovery = true, + String? path, + _i8.Uint8List? bytes, + String? collection, + List? encryptionKey, + }) => + (super.noSuchMethod( + Invocation.method( + #openBox, + [name], + { + #encryptionCipher: encryptionCipher, + #keyComparator: keyComparator, + #compactionStrategy: compactionStrategy, + #crashRecovery: crashRecovery, + #path: path, + #bytes: bytes, + #collection: collection, + #encryptionKey: encryptionKey, + }, + ), + returnValue: _i5.Future<_i3.Box>.value(_FakeBox_5( + this, + Invocation.method( + #openBox, + [name], + { + #encryptionCipher: encryptionCipher, + #keyComparator: keyComparator, + #compactionStrategy: compactionStrategy, + #crashRecovery: crashRecovery, + #path: path, + #bytes: bytes, + #collection: collection, + #encryptionKey: encryptionKey, + }, + ), + )), + ) as _i5.Future<_i3.Box>); + + @override + _i5.Future<_i3.LazyBox> openLazyBox( + String? name, { + _i3.HiveCipher? encryptionCipher, + _i3.KeyComparator? keyComparator = _i6.defaultKeyComparator, + _i3.CompactionStrategy? compactionStrategy = _i7.defaultCompactionStrategy, + bool? crashRecovery = true, + String? path, + String? collection, + List? encryptionKey, + }) => + (super.noSuchMethod( + Invocation.method( + #openLazyBox, + [name], + { + #encryptionCipher: encryptionCipher, + #keyComparator: keyComparator, + #compactionStrategy: compactionStrategy, + #crashRecovery: crashRecovery, + #path: path, + #collection: collection, + #encryptionKey: encryptionKey, + }, + ), + returnValue: _i5.Future<_i3.LazyBox>.value(_FakeLazyBox_6( + this, + Invocation.method( + #openLazyBox, + [name], + { + #encryptionCipher: encryptionCipher, + #keyComparator: keyComparator, + #compactionStrategy: compactionStrategy, + #crashRecovery: crashRecovery, + #path: path, + #collection: collection, + #encryptionKey: encryptionKey, + }, + ), + )), + ) as _i5.Future<_i3.LazyBox>); + + @override + _i3.Box box(String? name) => (super.noSuchMethod( + Invocation.method( + #box, + [name], + ), + returnValue: _FakeBox_5( + this, + Invocation.method( + #box, + [name], + ), + ), + ) as _i3.Box); + + @override + _i3.LazyBox lazyBox(String? name) => (super.noSuchMethod( + Invocation.method( + #lazyBox, + [name], + ), + returnValue: _FakeLazyBox_6( + this, + Invocation.method( + #lazyBox, + [name], + ), + ), + ) as _i3.LazyBox); + + @override + bool isBoxOpen(String? name) => (super.noSuchMethod( + Invocation.method( + #isBoxOpen, + [name], + ), + returnValue: false, + ) as bool); + + @override + _i5.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteBoxFromDisk( + String? name, { + String? path, + }) => + (super.noSuchMethod( + Invocation.method( + #deleteBoxFromDisk, + [name], + {#path: path}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future deleteFromDisk() => (super.noSuchMethod( + Invocation.method( + #deleteFromDisk, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + List generateSecureKey() => (super.noSuchMethod( + Invocation.method( + #generateSecureKey, + [], + ), + returnValue: [], + ) as List); + + @override + _i5.Future boxExists( + String? name, { + String? path, + }) => + (super.noSuchMethod( + Invocation.method( + #boxExists, + [name], + {#path: path}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + + @override + void resetAdapters() => super.noSuchMethod( + Invocation.method( + #resetAdapters, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void registerAdapter( + _i3.TypeAdapter? adapter, { + bool? internal = false, + bool? override = false, + }) => + super.noSuchMethod( + Invocation.method( + #registerAdapter, + [adapter], + { + #internal: internal, + #override: override, + }, + ), + returnValueForMissingStub: null, + ); + + @override + bool isAdapterRegistered(int? typeId) => (super.noSuchMethod( + Invocation.method( + #isAdapterRegistered, + [typeId], + ), + returnValue: false, + ) as bool); + + @override + void ignoreTypeId(int? typeId) => super.noSuchMethod( + Invocation.method( + #ignoreTypeId, + [typeId], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [BoxCollection]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockBoxCollection extends _i1.Mock implements impl.BoxCollection { + MockBoxCollection() { + _i1.throwOnMissingStub(this); + } + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + Set get boxNames => (super.noSuchMethod( + Invocation.getter(#boxNames), + returnValue: {}, + ) as Set); + + @override + _i5.Future> openBox( + String? name, { + bool? preload = false, + stub.CollectionBox Function( + String, + impl.BoxCollection, + )? boxCreator, + }) => + (super.noSuchMethod( + Invocation.method( + #openBox, + [name], + { + #preload: preload, + #boxCreator: boxCreator, + }, + ), + returnValue: + _i5.Future>.value(_FakeCollectionBox_7( + this, + Invocation.method( + #openBox, + [name], + { + #preload: preload, + #boxCreator: boxCreator, + }, + ), + )), + ) as _i5.Future>); + + @override + _i5.Future transaction( + _i5.Future Function()? action, { + List? boxNames, + bool? readOnly = false, + }) => + (super.noSuchMethod( + Invocation.method( + #transaction, + [action], + { + #boxNames: boxNames, + #readOnly: readOnly, + }, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future deleteFromDisk() => (super.noSuchMethod( + Invocation.method( + #deleteFromDisk, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} diff --git a/hive/test/person.dart b/hive/test/person.dart new file mode 100644 index 0000000000..9e9e06e13e --- /dev/null +++ b/hive/test/person.dart @@ -0,0 +1,24 @@ +import 'package:hive/hive.dart'; + +@HiveType(typeId: 0) +class Person extends HiveObject { + @HiveField(0) + final String name; + + Person(this.name); +} + +class PersonAdapter extends TypeAdapter { + @override + final typeId = 0; + + @override + Person read(BinaryReader reader) { + return Person(reader.read() as String); + } + + @override + void write(BinaryWriter writer, Person obj) { + writer.write(obj.name); + } +} diff --git a/hive/test/sentry_box_base_test.dart b/hive/test/sentry_box_base_test.dart new file mode 100644 index 0000000000..3821b8b341 --- /dev/null +++ b/hive/test/sentry_box_base_test.dart @@ -0,0 +1,569 @@ +@TestOn('vm') + +import 'dart:io'; + +import 'package:hive/hive.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_hive/src/sentry_box_base.dart'; +import 'package:sentry_hive/src/sentry_hive_impl.dart'; +import 'package:test/test.dart'; +import 'package:sentry/src/sentry_tracer.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'person.dart'; + +void main() { + void verifySpan(String description, SentrySpan? span) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.ok()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHiveBoxBase); + expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + + void verifyErrorSpan( + String description, + Exception exception, + SentrySpan? span, + ) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHiveBoxBase); + expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + + expect(span?.throwable, exception); + } + + void verifyBreadcrumb( + String message, + Breadcrumb? crumb, { + bool checkName = false, + String status = 'ok', + }) { + expect( + crumb?.message, + message, + ); + expect(crumb?.type, 'query'); + if (checkName) { + expect(crumb?.data?[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + expect(crumb?.data?['status'], status); + } + + group('adds span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('add adds span', () async { + final sut = fixture.getSut(); + + await sut.add(Person('Joe Dirt')); + + verifySpan('add', fixture.getCreatedSpan()); + }); + + test('addAll adds span', () async { + final sut = fixture.getSut(); + + await sut.addAll([Person('Joe Dirt')]); + + verifySpan('addAll', fixture.getCreatedSpan()); + }); + + test('clear adds span', () async { + final sut = fixture.getSut(); + + await sut.clear(); + + verifySpan('clear', fixture.getCreatedSpan()); + }); + + test('close adds span', () async { + final sut = fixture.getSut(); + + await sut.close(); + + verifySpan('close', fixture.getCreatedSpan()); + }); + + test('compact adds span', () async { + final sut = fixture.getSut(); + + await sut.compact(); + + verifySpan('compact', fixture.getCreatedSpan()); + }); + + test('delete adds span', () async { + final sut = fixture.getSut(); + + await sut.delete('fixture-key'); + + verifySpan('delete', fixture.getCreatedSpan()); + }); + + test('deleteAll adds span', () async { + final sut = fixture.getSut(); + + await sut.deleteAll(['fixture-key']); + + verifySpan('deleteAll', fixture.getCreatedSpan()); + }); + + test('deleteAt adds span', () async { + final sut = fixture.getSut(); + + await sut.add(Person('Joe Dirt')); + await sut.deleteAt(0); + + verifySpan('deleteAt', fixture.getCreatedSpan()); + }); + }); + + group('adds error span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockBox.name).thenReturn(Fixture.dbName); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing add adds error span', () async { + when(fixture.mockBox.add(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.add(Person('Joe Dirt')); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('add', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing addAll adds error span', () async { + when(fixture.mockBox.addAll(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.addAll([Person('Joe Dirt')]); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('addAll', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing clear adds error span', () async { + when(fixture.mockBox.clear()).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.clear(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('clear', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing close adds error span', () async { + when(fixture.mockBox.close()).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.close(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('close', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing compact adds error span', () async { + when(fixture.mockBox.compact()).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.compact(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('compact', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing delete adds error span', () async { + when(fixture.mockBox.delete(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.delete('fixture-key'); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('delete', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing deleteAll adds error span', () async { + when(fixture.mockBox.deleteAll(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.deleteAll(['fixture-key']); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('deleteAll', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing deleteAt adds error span', () async { + when(fixture.mockBox.add(any)).thenAnswer((_) async { + return 1; + }); + when(fixture.mockBox.deleteAt(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + await sut.add(Person('Joe Dirt')); + try { + await sut.deleteAt(0); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('deleteAt', fixture.exception, fixture.getCreatedSpan()); + }); + }); + + group('adds breadcrumb', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('add adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.add(Person('Joe Dirt')); + + verifyBreadcrumb('add', fixture.getCreatedBreadcrumb()); + }); + + test('addAll adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.addAll([Person('Joe Dirt')]); + + verifyBreadcrumb('addAll', fixture.getCreatedBreadcrumb()); + }); + + test('clear adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.clear(); + + verifyBreadcrumb('clear', fixture.getCreatedBreadcrumb()); + }); + + test('close adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.close(); + + verifyBreadcrumb('close', fixture.getCreatedBreadcrumb()); + }); + + test('compact adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.compact(); + + verifyBreadcrumb('compact', fixture.getCreatedBreadcrumb()); + }); + + test('delete adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.delete('fixture-key'); + + verifyBreadcrumb('delete', fixture.getCreatedBreadcrumb()); + }); + + test('deleteAll adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.deleteAll(['fixture-key']); + + verifyBreadcrumb('deleteAll', fixture.getCreatedBreadcrumb()); + }); + + test('deleteAt adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.add(Person('Joe Dirt')); + await sut.deleteAt(0); + + verifyBreadcrumb('deleteAt', fixture.getCreatedBreadcrumb()); + }); + }); + + group('adds error breadcrumb', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockBox.name).thenReturn(Fixture.dbName); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing add adds error breadcrumb', () async { + when(fixture.mockBox.add(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.add(Person('Joe Dirt')); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'add', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing addAll adds error breadcrumb', () async { + when(fixture.mockBox.addAll(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.addAll([Person('Joe Dirt')]); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'addAll', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing clear adds error breadcrumb', () async { + when(fixture.mockBox.clear()).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.clear(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'clear', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing close adds error breadcrumb', () async { + when(fixture.mockBox.close()).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.close(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'close', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing compact adds error breadcrumb', () async { + when(fixture.mockBox.compact()).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.compact(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'compact', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing delete adds error breadcrumb', () async { + when(fixture.mockBox.delete(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.delete('fixture-key'); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'delete', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteAll adds error breadcrumb', () async { + when(fixture.mockBox.deleteAll(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + try { + await sut.deleteAll(['fixture-key']); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'deleteAll', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteAt adds error breadcrumb', () async { + when(fixture.mockBox.add(any)).thenAnswer((_) async { + return 1; + }); + when(fixture.mockBox.deleteAt(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + await sut.add(Person('Joe Dirt')); + try { + await sut.deleteAt(0); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'deleteAt', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + }); +} + +class Fixture { + late final Box box; + late final mockBox = MockBox(); + final options = SentryOptions(); + final hub = MockHub(); + final exception = Exception('fixture-exception'); + + static final dbName = 'people-box-base'; + + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late final scope = Scope(options); + + Future setUp() async { + Hive.init(Directory.systemTemp.path); + if (!Hive.isAdapterRegistered(0)) { + Hive.registerAdapter(PersonAdapter()); + } + box = await Hive.openBox(dbName); + } + + Future tearDown() async { + if (box.isOpen) { + await box.deleteFromDisk(); + await box.close(); + } + await Hive.close(); + } + + SentryBoxBase getSut({bool injectMockBox = false}) { + if (injectMockBox) { + return SentryBoxBase(mockBox, hub); + } else { + return SentryBoxBase(box, hub); + } + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + Breadcrumb? getCreatedBreadcrumb() { + return hub.scope.breadcrumbs.last; + } +} diff --git a/hive/test/sentry_box_collection_test.dart b/hive/test/sentry_box_collection_test.dart new file mode 100644 index 0000000000..f13b95e1c8 --- /dev/null +++ b/hive/test/sentry_box_collection_test.dart @@ -0,0 +1,398 @@ +@TestOn('vm') + +import 'dart:io'; + +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_hive/sentry_hive.dart'; +import 'package:sentry_hive/src/sentry_box_collection.dart'; +import 'package:sentry_hive/src/sentry_hive_impl.dart'; +import 'package:test/test.dart'; +import 'package:sentry/src/sentry_tracer.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'person.dart'; + +import 'package:hive/src/box_collection/box_collection_stub.dart' as stub; + +void main() { + void verifySpan(String description, SentrySpan? span) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.ok()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHiveBoxCollection); + expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + + void verifyErrorSpan( + String description, + Exception exception, + SentrySpan? span, + ) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHiveBoxCollection); + expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + + expect(span?.throwable, exception); + } + + void verifyBreadcrumb( + String message, + Breadcrumb? crumb, { + bool checkName = false, + String status = 'ok', + }) { + expect( + crumb?.message, + message, + ); + expect(crumb?.type, 'query'); + if (checkName) { + expect(crumb?.data?[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + expect(crumb?.data?['status'], status); + } + + group('adds span when calling', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('open', () async { + await SentryBoxCollection.open( + Fixture.dbName, + {'people'}, + hub: fixture.hub, + ); + + final span = fixture.getCreatedSpan(); + verifySpan('open', span); + }); + + test('openBox', () async { + final sut = await fixture.getSut(); + + await sut.openBox('people'); + + final span = fixture.getCreatedSpan(); + verifySpan('openBox', span); + }); + + test('transaction', () async { + final sut = await fixture.getSut(); + + final people = await sut.openBox('people'); + await sut.transaction( + () async { + print(people.name); + }, + boxNames: ['people'], + ); + final span = fixture.getCreatedSpan(); + verifySpan('transaction', span); + }); + + test('deleteFromDisk', () async { + final sut = await fixture.getSut(); + + await sut.deleteFromDisk(); + + final span = fixture.getCreatedSpan(); + verifySpan('deleteFromDisk', span); + }); + }); + + group('adds error span when calling', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockBoxCollection.name).thenReturn(Fixture.dbName); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + // open is static and cannot be mocked + + test('throwing openBox', () async { + when( + // ignore: inference_failure_on_function_invocation + fixture.mockBoxCollection.openBox( + any, + preload: anyNamed('preload'), + boxCreator: anyNamed('boxCreator'), + ), + ).thenThrow(fixture.exception); + + final sut = await fixture.getSut(injectMock: true); + + try { + // ignore: inference_failure_on_function_invocation + await sut.openBox('people'); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('openBox', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing transaction', () async { + when( + fixture.mockBoxCollection.transaction( + any, + boxNames: anyNamed('boxNames'), + readOnly: anyNamed('readOnly'), + ), + ).thenThrow(fixture.exception); + + final sut = await fixture.getSut(injectMock: true); + + try { + await sut.transaction(() async {}); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan( + 'transaction', + fixture.exception, + fixture.getCreatedSpan(), + ); + }); + + test('throwing deleteFromDisk', () async { + when(fixture.mockBoxCollection.deleteFromDisk()) + .thenThrow(fixture.exception); + + final sut = await fixture.getSut(injectMock: true); + + try { + await sut.deleteFromDisk(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan( + 'deleteFromDisk', + fixture.exception, + fixture.getCreatedSpan(), + ); + }); + }); + + group('adds breadcrumb when calling', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('open', () async { + await SentryBoxCollection.open( + Fixture.dbName, + {'people'}, + hub: fixture.hub, + ); + + final span = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('open', span); + }); + + test('openBox', () async { + final sut = await fixture.getSut(); + + await sut.openBox('people'); + + final span = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('openBox', span); + }); + + test('transaction', () async { + final sut = await fixture.getSut(); + + final people = await sut.openBox('people'); + await sut.transaction( + () async { + print(people.name); + }, + boxNames: ['people'], + ); + final span = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('transaction', span); + }); + + test('deleteFromDisk', () async { + final sut = await fixture.getSut(); + + await sut.deleteFromDisk(); + + final span = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('deleteFromDisk', span); + }); + }); + + group('adds error breadcrumb when calling', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockBoxCollection.name).thenReturn(Fixture.dbName); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + // open is static and cannot be mocked + + test('throwing openBox', () async { + when( + // ignore: inference_failure_on_function_invocation + fixture.mockBoxCollection.openBox( + any, + preload: anyNamed('preload'), + boxCreator: anyNamed('boxCreator'), + ), + ).thenThrow(fixture.exception); + + final sut = await fixture.getSut(injectMock: true); + + try { + // ignore: inference_failure_on_function_invocation + await sut.openBox('people'); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'openBox', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing transaction', () async { + when( + fixture.mockBoxCollection.transaction( + any, + boxNames: anyNamed('boxNames'), + readOnly: anyNamed('readOnly'), + ), + ).thenThrow(fixture.exception); + + final sut = await fixture.getSut(injectMock: true); + + try { + await sut.transaction(() async {}); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'transaction', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteFromDisk', () async { + when(fixture.mockBoxCollection.deleteFromDisk()) + .thenThrow(fixture.exception); + + final sut = await fixture.getSut(injectMock: true); + + try { + await sut.deleteFromDisk(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'deleteFromDisk', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + }); +} + +class Fixture { + final options = SentryOptions(); + final hub = MockHub(); + final exception = Exception('fixture-exception'); + + late final mockBoxCollection = MockBoxCollection(); + + static final dbName = 'people-box-collection'; + + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late final scope = Scope(options); + + Future setUp() async { + SentryHive.init(Directory.systemTemp.path); + if (!SentryHive.isAdapterRegistered(0)) { + SentryHive.registerAdapter(PersonAdapter()); + } + } + + Future tearDown() async { + await SentryHive.close(); + } + + Future getSut({bool injectMock = false}) async { + if (injectMock) { + final sbc = SentryBoxCollection(mockBoxCollection); + sbc.setHub(hub); + return sbc; + } else { + return await SentryBoxCollection.open(dbName, {'people'}, hub: hub); + } + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + Breadcrumb? getCreatedBreadcrumb() { + return hub.scope.breadcrumbs.last; + } +} diff --git a/hive/test/sentry_hive_impl_test.dart b/hive/test/sentry_hive_impl_test.dart new file mode 100644 index 0000000000..521415d1ed --- /dev/null +++ b/hive/test/sentry_hive_impl_test.dart @@ -0,0 +1,625 @@ +@TestOn('vm') + +import 'dart:io'; + +import 'package:hive/hive.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry/src/sentry_tracer.dart'; +import 'package:sentry_hive/src/sentry_box.dart'; +import 'package:sentry_hive/src/sentry_hive_impl.dart'; +import 'package:sentry_hive/src/sentry_lazy_box.dart'; +import 'package:sentry_hive/src/version.dart'; +import 'package:test/test.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'person.dart'; + +void main() { + void verifySpan( + String description, + SentrySpan? span, { + bool checkName = false, + }) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.ok()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHive); + // expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + if (checkName) { + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + } + + void verifyErrorSpan(String description, SentrySpan? span, Exception error) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHive); + expect(span?.throwable, error); + } + + void verifyBreadcrumb( + String message, + Breadcrumb? crumb, { + bool checkName = false, + String status = 'ok', + }) { + expect( + crumb?.message, + message, + ); + expect(crumb?.type, 'query'); + if (checkName) { + expect(crumb?.data?[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + expect(crumb?.data?['status'], status); + } + + group('adds span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('boxExists adds span', () async { + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + await sut.boxExists(Fixture.dbName); + + verifySpan('boxExists', fixture.getCreatedSpan()); + }); + + test('close adds span', () async { + final sut = fixture.getSut(); + + await sut.close(); + + verifySpan('close', fixture.getCreatedSpan()); + }); + + test('deleteBoxFromDisk adds span', () async { + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + await sut.deleteBoxFromDisk(Fixture.dbName); + + verifySpan('deleteBoxFromDisk', fixture.getCreatedSpan()); + }); + + test('deleteFromDisk adds span', () async { + final sut = fixture.getSut(); + + await sut.deleteFromDisk(); + + verifySpan('deleteFromDisk', fixture.getCreatedSpan()); + }); + + test('openBox adds span', () async { + final sut = fixture.getSut(); + + final box = await sut.openBox(Fixture.dbName); + + expect(box is SentryBox, true); + verifySpan('openBox', fixture.getCreatedSpan(), checkName: true); + }); + + test('openLazyBox adds span', () async { + final sut = fixture.getSut(); + + final box = await sut.openLazyBox(Fixture.dbName); + + expect(box is SentryLazyBox, true); + verifySpan('openLazyBox', fixture.getCreatedSpan(), checkName: true); + }); + }); + + group('adds error span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockHive.close()).thenAnswer((_) async => {}); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(injectMockHive: true); + }); + + test('throwing boxExists adds error span', () async { + final Box box = MockBox(); + when( + fixture.mockHive.openBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + bytes: anyNamed('bytes'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenAnswer((_) => Future(() => box)); + when(fixture.mockHive.boxExists(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + try { + await sut.boxExists(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('boxExists', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing close adds error span', () async { + when(fixture.mockHive.close()).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.close(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('close', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing deleteBoxFromDisk adds error span', () async { + final Box box = MockBox(); + when( + fixture.mockHive.openBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + bytes: anyNamed('bytes'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenAnswer((_) => Future(() => box)); + when(fixture.mockHive.deleteBoxFromDisk(any)) + .thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + try { + await sut.deleteBoxFromDisk(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan( + 'deleteBoxFromDisk', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing deleteFromDisk adds error span', () async { + when(fixture.mockHive.deleteFromDisk()).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.deleteFromDisk(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan( + 'deleteFromDisk', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing openBox adds error span', () async { + when( + fixture.mockHive.openBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + bytes: anyNamed('bytes'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.openBox(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('openBox', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing openLazyBox adds error span', () async { + when( + fixture.mockHive.openLazyBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.openLazyBox(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan( + 'openLazyBox', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + }); + + group('adds breadcrumbs', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('boxExists adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + await sut.boxExists(Fixture.dbName); + + verifyBreadcrumb('boxExists', fixture.getCreatedBreadcrumb()); + }); + + test('close adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.close(); + + verifyBreadcrumb('close', fixture.getCreatedBreadcrumb()); + }); + + test('deleteBoxFromDisk adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + await sut.deleteBoxFromDisk(Fixture.dbName); + + verifyBreadcrumb('deleteBoxFromDisk', fixture.getCreatedBreadcrumb()); + }); + + test('deleteFromDisk adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.deleteFromDisk(); + + verifyBreadcrumb('deleteFromDisk', fixture.getCreatedBreadcrumb()); + }); + + test('openBox adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + + verifyBreadcrumb( + 'openBox', + fixture.getCreatedBreadcrumb(), + checkName: true, + ); + }); + + test('openLazyBox adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.openLazyBox(Fixture.dbName); + + verifyBreadcrumb( + 'openLazyBox', + fixture.getCreatedBreadcrumb(), + checkName: true, + ); + }); + }); + + group('adds error breadcrumb', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockHive.close()).thenAnswer((_) async => {}); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(injectMockHive: true); + }); + + test('throwing boxExists adds error span', () async { + final Box box = MockBox(); + when( + fixture.mockHive.openBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + bytes: anyNamed('bytes'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenAnswer((_) => Future(() => box)); + when(fixture.mockHive.boxExists(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + try { + await sut.boxExists(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'boxExists', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing close adds error span', () async { + when(fixture.mockHive.close()).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.close(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'close', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteBoxFromDisk adds error span', () async { + final Box box = MockBox(); + when( + fixture.mockHive.openBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + bytes: anyNamed('bytes'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenAnswer((_) => Future(() => box)); + when(fixture.mockHive.deleteBoxFromDisk(any)) + .thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + await sut.openBox(Fixture.dbName); + try { + await sut.deleteBoxFromDisk(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'deleteBoxFromDisk', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteFromDisk adds error span', () async { + when(fixture.mockHive.deleteFromDisk()).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.deleteFromDisk(); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'deleteFromDisk', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing openBox adds error span', () async { + when( + fixture.mockHive.openBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + bytes: anyNamed('bytes'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.openBox(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'openBox', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing openLazyBox adds error span', () async { + when( + fixture.mockHive.openLazyBox( + any, + encryptionCipher: anyNamed('encryptionCipher'), + keyComparator: anyNamed('keyComparator'), + compactionStrategy: anyNamed('compactionStrategy'), + crashRecovery: anyNamed('crashRecovery'), + path: anyNamed('path'), + collection: anyNamed('collection'), + encryptionKey: anyNamed('encryptionKey'), + ), + ).thenThrow(fixture.exception); + + final sut = fixture.getSut(); + + try { + await sut.openLazyBox(Fixture.dbName); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'openLazyBox', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + }); + + group('integrations', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('adds integration', () { + expect( + fixture.options.sdk.integrations.contains('SentryHiveTracing'), + true, + ); + }); + + test('adds package', () { + expect( + fixture.options.sdk.packages.any( + (element) => + element.name == packageName && element.version == sdkVersion, + ), + true, + ); + }); + }); +} + +class Fixture { + final options = SentryOptions(); + late final mockHive = MockHiveInterface(); + final hub = MockHub(); + static final dbName = 'people-hive-impl'; + final exception = Exception('fixture-exception'); + + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late SentryHiveImpl sut; + late final scope = Scope(options); + + Future setUp({bool injectMockHive = false}) async { + if (injectMockHive) { + sut = SentryHiveImpl(mockHive); + } else { + sut = SentryHiveImpl(Hive); + sut.init(Directory.systemTemp.path); + if (!sut.isAdapterRegistered(0)) { + sut.registerAdapter(PersonAdapter()); + } + } + sut.setHub(hub); + } + + Future tearDown() async { + await sut.close(); + } + + SentryHiveImpl getSut() { + return sut; + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + Breadcrumb? getCreatedBreadcrumb() { + return hub.scope.breadcrumbs.last; + } +} diff --git a/hive/test/sentry_lazy_box_test.dart b/hive/test/sentry_lazy_box_test.dart new file mode 100644 index 0000000000..291dc3fc20 --- /dev/null +++ b/hive/test/sentry_lazy_box_test.dart @@ -0,0 +1,291 @@ +@TestOn('vm') + +import 'dart:io'; + +import 'package:hive/hive.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry/src/sentry_tracer.dart'; +import 'package:sentry_hive/src/sentry_hive_impl.dart'; +import 'package:sentry_hive/src/sentry_lazy_box.dart'; +import 'package:test/test.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'person.dart'; + +void main() { + void verifySpan(String description, SentrySpan? span) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.ok()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHiveLazyBox); + expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + + void verifyErrorSpan( + String description, + Exception exception, + SentrySpan? span, + ) { + expect(span?.context.operation, SentryHiveImpl.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbHiveLazyBox); + expect(span?.data[SentryHiveImpl.dbSystemKey], SentryHiveImpl.dbSystem); + expect(span?.data[SentryHiveImpl.dbNameKey], Fixture.dbName); + + expect(span?.throwable, exception); + } + + void verifyBreadcrumb( + String message, + Breadcrumb? crumb, { + bool checkName = false, + String status = 'ok', + }) { + expect( + crumb?.message, + message, + ); + expect(crumb?.type, 'query'); + if (checkName) { + expect(crumb?.data?[SentryHiveImpl.dbNameKey], Fixture.dbName); + } + expect(crumb?.data?['status'], status); + } + + group('adds span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('get adds span', () async { + final sut = fixture.getSut(); + + await sut.put('fixture-key', Person('John Malkovich')); + await sut.get('fixture-key'); + + verifySpan('get', fixture.getCreatedSpan()); + }); + + test('getAt adds span', () async { + final sut = fixture.getSut(); + + await sut.add(Person('John Malkovich')); + await sut.getAt(0); + + verifySpan('getAt', fixture.getCreatedSpan()); + }); + }); + + group('adds error span', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockBox.name).thenReturn(Fixture.dbName); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing get adds error span', () async { + when(fixture.mockBox.add(any)).thenAnswer((_) async { + return 1; + }); + when(fixture.mockBox.get(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + await sut.put('fixture-key', Person('John Malkovich')); + try { + await sut.get('fixture-key'); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('get', fixture.exception, fixture.getCreatedSpan()); + }); + + test('throwing getAt adds error span', () async { + when(fixture.mockBox.add(any)).thenAnswer((_) async { + return 1; + }); + when(fixture.mockBox.getAt(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + await sut.add(Person('John Malkovich')); + try { + await sut.getAt(0); + } catch (error) { + expect(error, fixture.exception); + } + + verifyErrorSpan('getAt', fixture.exception, fixture.getCreatedSpan()); + }); + }); + + group('adds breadcrumb', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('get adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.put('fixture-key', Person('John Malkovich')); + await sut.get('fixture-key'); + + verifyBreadcrumb('get', fixture.getCreatedBreadcrumb()); + }); + + test('getAt adds breadcrumb', () async { + final sut = fixture.getSut(); + + await sut.add(Person('John Malkovich')); + await sut.getAt(0); + + verifyBreadcrumb('getAt', fixture.getCreatedBreadcrumb()); + }); + }); + + group('adds error breadcrumbs', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + await fixture.setUp(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.mockBox.name).thenReturn(Fixture.dbName); + when(fixture.hub.scope).thenReturn(fixture.scope); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing get adds error breadcrumbs', () async { + when(fixture.mockBox.add(any)).thenAnswer((_) async { + return 1; + }); + when(fixture.mockBox.get(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + await sut.put('fixture-key', Person('John Malkovich')); + try { + await sut.get('fixture-key'); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'get', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing getAt adds error breadcrumbs', () async { + when(fixture.mockBox.add(any)).thenAnswer((_) async { + return 1; + }); + when(fixture.mockBox.getAt(any)).thenThrow(fixture.exception); + + final sut = fixture.getSut(injectMockBox: true); + + await sut.add(Person('John Malkovich')); + try { + await sut.getAt(0); + } catch (error) { + expect(error, fixture.exception); + } + + verifyBreadcrumb( + 'getAt', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + }); +} + +class Fixture { + late final LazyBox box; + late final mockBox = MockLazyBox(); + final options = SentryOptions(); + final hub = MockHub(); + final exception = Exception('fixture-exception'); + + static final dbName = 'people-lazy-box'; + + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late final scope = Scope(options); + + Future setUp() async { + Hive.init(Directory.systemTemp.path); + if (!Hive.isAdapterRegistered(0)) { + Hive.registerAdapter(PersonAdapter()); + } + box = await Hive.openLazyBox(dbName); + } + + Future tearDown() async { + if (box.isOpen) { + await box.deleteFromDisk(); + await box.close(); + } + await Hive.close(); + } + + SentryLazyBox getSut({bool injectMockBox = false}) { + if (injectMockBox) { + return SentryLazyBox(mockBox, hub); + } else { + return SentryLazyBox(box, hub); + } + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + Breadcrumb? getCreatedBreadcrumb() { + return hub.scope.breadcrumbs.last; + } +} diff --git a/isar/.gitignore b/isar/.gitignore new file mode 100644 index 0000000000..fdd96ceb43 --- /dev/null +++ b/isar/.gitignore @@ -0,0 +1,17 @@ +# Omit committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Downloaded on demand by tests for correct architecture. +libisar.dylib diff --git a/isar/.metadata b/isar/.metadata new file mode 100644 index 0000000000..eea17bc4a0 --- /dev/null +++ b/isar/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "2f708eb8396e362e280fac22cf171c2cb467343c" + channel: "stable" + +project_type: package diff --git a/isar/CHANGELOG.md b/isar/CHANGELOG.md new file mode 120000 index 0000000000..04c99a55ca --- /dev/null +++ b/isar/CHANGELOG.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/isar/LICENSE b/isar/LICENSE new file mode 100644 index 0000000000..2a6964d84d --- /dev/null +++ b/isar/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/isar/README.md b/isar/README.md new file mode 100644 index 0000000000..06fa32dd48 --- /dev/null +++ b/isar/README.md @@ -0,0 +1,84 @@ +

+ + + +
+

+ +Sentry integration for `isar` package +=========== + +| package | build | pub | likes | popularity | pub points | +| ------- | ------- | ------- | ------- | ------- | ------- | +| sentry_isar | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-isar) | [![pub package](https://img.shields.io/pub/v/sentry_isar.svg)](https://pub.dev/packages/sentry_isar) | [![likes](https://img.shields.io/pub/likes/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![pub points](https://img.shields.io/pub/points/sentry_isar)](https://pub.dev/packages/sentry_isar/score) + +Integration for the [`isar`](https://pub.dev/packages/isar) package. + +#### Usage + +- Sign up for a Sentry.io account and get a DSN at https://sentry.io. + +- Follow the installing instructions on [pub.dev](https://pub.dev/packages/sentry/install). + +- Initialize the Sentry SDK using the DSN issued by Sentry.io. + +- Call... + +```dart +import 'package:path_provider/path_provider.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:sentry_isar/sentry_isar.dart'; + +import 'user.dart'; + +Future main() async { + await SentryFlutter.init( + (options) { + options.dsn = 'https://example@sentry.io/add-your-dsn-here'; + options.tracesSampleRate = 1.0; + }, + // Init your App. + appRunner: () => runApp(MyApp()), + ); +} + +Future runApp() async { + final tr = Sentry.startTransaction( + 'isarTest', + 'db', + bindToScope: true, + ); + + final dir = await getApplicationDocumentsDirectory(); + + final isar = await SentryIsar.open( + [UserSchema], + directory: dir.path, + ); + + final newUser = User() + ..name = 'Joe Dirt' + ..age = 36; + + await isar.writeTxn(() async { + await isar.users.put(newUser); // insert & update + }); + + final existingUser = await isar.users.get(newUser.id); // get + + await isar.writeTxn(() async { + await isar.users.delete(existingUser!.id); // delete + }); + + await tr.finish(status: const SpanStatus.ok()); +} +``` + +#### Resources + +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) +* [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/isar/analysis_options.yaml b/isar/analysis_options.yaml new file mode 100644 index 0000000000..92c8931384 --- /dev/null +++ b/isar/analysis_options.yaml @@ -0,0 +1,33 @@ +include: package:lints/recommended.yaml + +analyzer: + language: + strict-casts: true + strict-inference: true + strict-raw-types: true + errors: + # treat missing required parameters as a warning (not a hint) + missing_required_param: error + # treat missing returns as a warning (not a hint) + missing_return: error + # allow having TODOs in the code + todo: ignore + # allow self-reference to deprecated members (we do this because otherwise we have + # to annotate every member in every test, assert, etc, when we deprecate something) + deprecated_member_use_from_same_package: warning + # ignore sentry/path on pubspec as we change it on deployment + invalid_dependency: ignore + unnecessary_import: ignore + exclude: + - example/** + +linter: + rules: + - prefer_final_locals + - public_member_api_docs + - prefer_single_quotes + - prefer_relative_imports + - unnecessary_brace_in_string_interps + - implementation_imports + - require_trailing_commas + - unawaited_futures diff --git a/isar/dartdoc_options.yaml b/isar/dartdoc_options.yaml new file mode 120000 index 0000000000..7cbb8c0d74 --- /dev/null +++ b/isar/dartdoc_options.yaml @@ -0,0 +1 @@ +../dart/dartdoc_options.yaml \ No newline at end of file diff --git a/isar/example/main.dart b/isar/example/main.dart new file mode 100644 index 0000000000..7c9972b50d --- /dev/null +++ b/isar/example/main.dart @@ -0,0 +1,47 @@ +import 'package:path_provider/path_provider.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:sentry_isar/sentry_isar.dart'; + +import 'user.dart'; + +Future main() async { + // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io + const dsn = + 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; + + await SentryFlutter.init( + (options) { + options.dsn = dsn; + options.tracesSampleRate = 1.0; + options.debug = true; + }, + appRunner: runApp, // Init your App. + ); +} + +Future runApp() async { + final tr = Sentry.startTransaction('isar', 'db', bindToScope: true); + + final dir = await getApplicationDocumentsDirectory(); + + final isar = await SentryIsar.open( + [UserSchema], + directory: dir.path, + ); + + final newUser = User() + ..name = 'Joe Dirt' + ..age = 36; + + await isar.writeTxn(() async { + await isar.users.put(newUser); // insert & update + }); + + final existingUser = await isar.users.get(newUser.id); // get + + await isar.writeTxn(() async { + await isar.users.delete(existingUser!.id); // delete + }); + + await tr.finish(status: const SpanStatus.ok()); +} diff --git a/isar/example/user.dart b/isar/example/user.dart new file mode 100644 index 0000000000..f255d2389d --- /dev/null +++ b/isar/example/user.dart @@ -0,0 +1,12 @@ +import 'package:isar/isar.dart'; + +part 'user.g.dart'; + +@collection +class User { + Id id = Isar.autoIncrement; + + String? name; + + int? age; +} diff --git a/isar/example/user.g.dart b/isar/example/user.g.dart new file mode 100644 index 0000000000..370c40860f --- /dev/null +++ b/isar/example/user.g.dart @@ -0,0 +1,553 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types + +extension GetUserCollection on Isar { + IsarCollection get users => this.collection(); +} + +const UserSchema = CollectionSchema( + name: r'User', + id: -7838171048429979076, + properties: { + r'age': PropertySchema( + id: 0, + name: r'age', + type: IsarType.long, + ), + r'name': PropertySchema( + id: 1, + name: r'name', + type: IsarType.string, + ) + }, + estimateSize: _userEstimateSize, + serialize: _userSerialize, + deserialize: _userDeserialize, + deserializeProp: _userDeserializeProp, + idName: r'id', + indexes: {}, + links: {}, + embeddedSchemas: {}, + getId: _userGetId, + getLinks: _userGetLinks, + attach: _userAttach, + version: '3.1.0+1', +); + +int _userEstimateSize( + User object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.name; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + return bytesCount; +} + +void _userSerialize( + User object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeLong(offsets[0], object.age); + writer.writeString(offsets[1], object.name); +} + +User _userDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = User(); + object.age = reader.readLongOrNull(offsets[0]); + object.id = id; + object.name = reader.readStringOrNull(offsets[1]); + return object; +} + +P _userDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readLongOrNull(offset)) as P; + case 1: + return (reader.readStringOrNull(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _userGetId(User object) { + return object.id; +} + +List> _userGetLinks(User object) { + return []; +} + +void _userAttach(IsarCollection col, Id id, User object) { + object.id = id; +} + +extension UserQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension UserQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension UserQueryFilter on QueryBuilder { + QueryBuilder ageIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'age', + )); + }); + } + + QueryBuilder ageIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'age', + )); + }); + } + + QueryBuilder ageEqualTo(int? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'age', + value: value, + )); + }); + } + + QueryBuilder ageGreaterThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'age', + value: value, + )); + }); + } + + QueryBuilder ageLessThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'age', + value: value, + )); + }); + } + + QueryBuilder ageBetween( + int? lower, + int? upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'age', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder nameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'name', + )); + }); + } + + QueryBuilder nameIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'name', + )); + }); + } + + QueryBuilder nameEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'name', + value: '', + )); + }); + } + + QueryBuilder nameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'name', + value: '', + )); + }); + } +} + +extension UserQueryObject on QueryBuilder {} + +extension UserQueryLinks on QueryBuilder {} + +extension UserQuerySortBy on QueryBuilder { + QueryBuilder sortByAge() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.asc); + }); + } + + QueryBuilder sortByAgeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.desc); + }); + } + + QueryBuilder sortByName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.asc); + }); + } + + QueryBuilder sortByNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.desc); + }); + } +} + +extension UserQuerySortThenBy on QueryBuilder { + QueryBuilder thenByAge() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.asc); + }); + } + + QueryBuilder thenByAgeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'age', Sort.desc); + }); + } + + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.asc); + }); + } + + QueryBuilder thenByNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.desc); + }); + } +} + +extension UserQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByAge() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'age'); + }); + } + + QueryBuilder distinctByName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'name', caseSensitive: caseSensitive); + }); + } +} + +extension UserQueryProperty on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder ageProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'age'); + }); + } + + QueryBuilder nameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'name'); + }); + } +} diff --git a/isar/lib/sentry_isar.dart b/isar/lib/sentry_isar.dart new file mode 100644 index 0000000000..75e63c47ea --- /dev/null +++ b/isar/lib/sentry_isar.dart @@ -0,0 +1,4 @@ +library sentry_isar; + +export 'src/sentry_isar.dart'; +export 'src/sentry_isar_collection.dart'; diff --git a/isar/lib/src/sentry_isar.dart b/isar/lib/src/sentry_isar.dart new file mode 100644 index 0000000000..e6e174a8eb --- /dev/null +++ b/isar/lib/src/sentry_isar.dart @@ -0,0 +1,253 @@ +import 'package:isar/isar.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'version.dart'; + +import 'sentry_isar_collection.dart'; +import 'sentry_span_helper.dart'; + +/// A sentry wrapper around the Isar Database +@experimental +class SentryIsar implements Isar { + @internal + // ignore: public_member_api_docs + static const dbOp = 'db'; + + @internal + // ignore: public_member_api_docs + static const dbSystemKey = 'db.system'; + @internal + // ignore: public_member_api_docs + static const dbSystem = 'isar'; + + @internal + // ignore: public_member_api_docs + static const dbNameKey = 'db.name'; + + @internal + // ignore: public_member_api_docs + static const dbCollectionKey = 'db.collection'; + + final Isar _isar; + final Hub _hub; + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbIsar, + ); + + /// ctor of SentryIsar + SentryIsar(this._isar, this._hub) { + _spanHelper.setHub(_hub); + + // ignore: invalid_use_of_internal_member + final options = _hub.options; + options.sdk.addIntegration('SentryIsarTracing'); + options.sdk.addPackage(packageName, sdkVersion); + } + + /// Open a new Isar instance, wrapped by SentryIsar + static Future open( + List> schemas, { + required String directory, + String name = Isar.defaultName, + int maxSizeMiB = Isar.defaultMaxSizeMiB, + bool relaxedDurability = true, + CompactCondition? compactOnLaunch, + bool inspector = true, + Hub? hub, + }) async { + final spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbIsar, + ); + final hubToUse = hub ?? HubAdapter(); + spanHelper.setHub(hubToUse); + + final isar = await spanHelper.asyncWrapInSpan( + 'open', + () async { + return await Isar.open( + schemas, + directory: directory, + name: name, + maxSizeMiB: maxSizeMiB, + relaxedDurability: relaxedDurability, + compactOnLaunch: compactOnLaunch, + inspector: inspector, + ); + }, + dbName: name, + ); + + return SentryIsar(isar, hubToUse); + } + + /// Open a new Isar instance, wrapped by SentryIsar + static Isar openSync( + List> schemas, { + required String directory, + String name = Isar.defaultName, + int maxSizeMiB = Isar.defaultMaxSizeMiB, + bool relaxedDurability = true, + CompactCondition? compactOnLaunch, + bool inspector = true, + Hub? hub, + }) { + final isar = Isar.openSync( + schemas, + directory: directory, + name: name, + maxSizeMiB: maxSizeMiB, + relaxedDurability: relaxedDurability, + compactOnLaunch: compactOnLaunch, + inspector: inspector, + ); + return SentryIsar(isar, hub ?? HubAdapter()); + } + + @override + void attachCollections(Map> collections) { + _isar.attachCollections(collections); + } + + @override + Future clear() { + return _spanHelper.asyncWrapInSpan( + 'clear', + () { + return _isar.clear(); + }, + dbName: name, + ); + } + + @override + void clearSync() { + _isar.clearSync(); + } + + @override + Future close({bool deleteFromDisk = false}) { + return _spanHelper.asyncWrapInSpan( + 'close', + () { + return _isar.close(deleteFromDisk: deleteFromDisk); + }, + dbName: name, + ); + } + + @override + IsarCollection collection() { + return SentryIsarCollection(_isar.collection(), _hub, name); + } + + @override + Future copyToFile(String targetPath) { + return _spanHelper.asyncWrapInSpan( + 'copyToFile', + () { + return _isar.copyToFile(targetPath); + }, + dbName: name, + ); + } + + @override + String? get directory => _isar.directory; + + @override + IsarCollection? getCollectionByNameInternal(String name) { + final collection = _isar.getCollectionByNameInternal(name); + if (collection != null) { + return SentryIsarCollection(collection, _hub, name); + } else { + return null; + } + } + + @override + Future getSize({ + bool includeIndexes = false, + bool includeLinks = false, + }) { + return _spanHelper.asyncWrapInSpan( + 'getSize', + () { + return _isar.getSize( + includeIndexes: includeIndexes, + includeLinks: includeLinks, + ); + }, + dbName: name, + ); + } + + @override + int getSizeSync({bool includeIndexes = false, bool includeLinks = false}) { + return _isar.getSizeSync( + includeIndexes: includeIndexes, + includeLinks: includeLinks, + ); + } + + @override + bool get isOpen => _isar.isOpen; + + @override + String get name => _isar.name; + + @override + String? get path => _isar.path; + + @override + void requireOpen() { + _isar.requireOpen(); + } + + @override + Future txn(Future Function() callback) { + return _spanHelper.asyncWrapInSpan( + 'txn', + () { + return _isar.txn(callback); + }, + dbName: name, + ); + } + + @override + T txnSync(T Function() callback) { + return _isar.txnSync(callback); + } + + @override + @visibleForTesting + @experimental + Future verify() { + return _spanHelper.asyncWrapInSpan( + 'verify', + () { + // ignore: invalid_use_of_visible_for_testing_member + return _isar.verify(); + }, + dbName: name, + ); + } + + @override + Future writeTxn(Future Function() callback, {bool silent = false}) { + return _spanHelper.asyncWrapInSpan( + 'writeTxn', + () { + return _isar.writeTxn(callback, silent: silent); + }, + dbName: name, + ); + } + + @override + T writeTxnSync(T Function() callback, {bool silent = false}) { + return _isar.writeTxnSync(callback, silent: silent); + } +} diff --git a/isar/lib/src/sentry_isar_collection.dart b/isar/lib/src/sentry_isar_collection.dart new file mode 100644 index 0000000000..3f85242bbe --- /dev/null +++ b/isar/lib/src/sentry_isar_collection.dart @@ -0,0 +1,433 @@ +import 'dart:typed_data'; +import 'package:isar/isar.dart'; +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; + +import 'sentry_span_helper.dart'; + +/// Sentry wrapper around IsarCollection +@experimental +class SentryIsarCollection implements IsarCollection { + final IsarCollection _isarCollection; + final Hub _hub; + final String _dbName; + + final _spanHelper = SentrySpanHelper( + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbIsarCollection, + ); + + /// ctor of SentryIsarCollection + SentryIsarCollection(this._isarCollection, this._hub, this._dbName) { + _spanHelper.setHub(_hub); + } + + @override + Query buildQuery({ + List whereClauses = const [], + bool whereDistinct = false, + Sort whereSort = Sort.asc, + FilterOperation? filter, + List sortBy = const [], + List distinctBy = const [], + int? offset, + int? limit, + String? property, + }) { + return _isarCollection.buildQuery( + whereClauses: whereClauses, + whereDistinct: whereDistinct, + whereSort: whereSort, + filter: filter, + sortBy: sortBy, + distinctBy: distinctBy, + offset: offset, + limit: limit, + property: property, + ); + } + + @override + Future clear() { + return _spanHelper.asyncWrapInSpan( + 'clear', + () { + return _isarCollection.clear(); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + void clearSync() { + _isarCollection.clearSync(); + } + + @override + Future count() { + return _spanHelper.asyncWrapInSpan( + 'count', + () { + return _isarCollection.count(); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + int countSync() { + return _isarCollection.countSync(); + } + + @override + Future delete(Id id) { + return _spanHelper.asyncWrapInSpan( + 'delete', + () { + return _isarCollection.delete(id); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future deleteAll(List ids) { + return _spanHelper.asyncWrapInSpan( + 'deleteAll', + () { + return _isarCollection.deleteAll(ids); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future deleteAllByIndex(String indexName, List keys) { + return _spanHelper.asyncWrapInSpan( + 'deleteAllByIndex', + () { + return _isarCollection.deleteAllByIndex(indexName, keys); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + int deleteAllByIndexSync(String indexName, List keys) { + return _isarCollection.deleteAllByIndexSync(indexName, keys); + } + + @override + int deleteAllSync(List ids) { + return _isarCollection.deleteAllSync(ids); + } + + @override + Future deleteByIndex(String indexName, IndexKey key) { + return _spanHelper.asyncWrapInSpan( + 'deleteByIndex', + () { + return _isarCollection.deleteByIndex(indexName, key); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + bool deleteByIndexSync(String indexName, IndexKey key) { + return _isarCollection.deleteByIndexSync(indexName, key); + } + + @override + bool deleteSync(Id id) { + return _isarCollection.deleteSync(id); + } + + @override + QueryBuilder filter() { + return _isarCollection.filter(); + } + + @override + Future get(Id id) { + return _spanHelper.asyncWrapInSpan( + 'get', + () { + return _isarCollection.get(id); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future> getAll(List ids) { + return _spanHelper.asyncWrapInSpan( + 'getAll', + () { + return _isarCollection.getAll(ids); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future> getAllByIndex(String indexName, List keys) { + return _spanHelper.asyncWrapInSpan( + 'getAllByIndex', + () { + return _isarCollection.getAllByIndex(indexName, keys); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + List getAllByIndexSync(String indexName, List keys) { + return _isarCollection.getAllByIndexSync(indexName, keys); + } + + @override + List getAllSync(List ids) { + return _isarCollection.getAllSync(ids); + } + + @override + Future getByIndex(String indexName, IndexKey key) { + return _spanHelper.asyncWrapInSpan( + 'getByIndex', + () { + return _isarCollection.getByIndex(indexName, key); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + OBJ? getByIndexSync(String indexName, IndexKey key) { + return _isarCollection.getByIndexSync(indexName, key); + } + + @override + Future getSize({ + bool includeIndexes = false, + bool includeLinks = false, + }) { + return _spanHelper.asyncWrapInSpan( + 'getSize', + () { + return _isarCollection.getSize( + includeIndexes: includeIndexes, + includeLinks: includeLinks, + ); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + int getSizeSync({bool includeIndexes = false, bool includeLinks = false}) { + return _isarCollection.getSizeSync( + includeIndexes: includeIndexes, + includeLinks: includeLinks, + ); + } + + @override + OBJ? getSync(Id id) { + return _isarCollection.getSync(id); + } + + @override + Future importJson(List> json) { + return _spanHelper.asyncWrapInSpan( + 'importJson', + () { + return _isarCollection.importJson(json); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future importJsonRaw(Uint8List jsonBytes) { + return _spanHelper.asyncWrapInSpan( + 'importJsonRaw', + () { + return _isarCollection.importJsonRaw(jsonBytes); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + void importJsonRawSync(Uint8List jsonBytes) { + _isarCollection.importJsonRawSync(jsonBytes); + } + + @override + void importJsonSync(List> json) { + _isarCollection.importJsonSync(json); + } + + @override + Isar get isar => _isarCollection.isar; + + @override + String get name => _isarCollection.name; + + @override + Future put(OBJ object) { + return _spanHelper.asyncWrapInSpan( + 'put', + () { + return _isarCollection.put(object); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future> putAll(List objects) { + return _spanHelper.asyncWrapInSpan( + 'putAll', + () { + return _isarCollection.putAll(objects); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Future> putAllByIndex(String indexName, List objects) { + return _spanHelper.asyncWrapInSpan( + 'putAllByIndex', + () { + return _isarCollection.putAllByIndex(indexName, objects); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + List putAllByIndexSync( + String indexName, + List objects, { + bool saveLinks = true, + }) { + return _isarCollection.putAllByIndexSync( + indexName, + objects, + saveLinks: saveLinks, + ); + } + + @override + List putAllSync(List objects, {bool saveLinks = true}) { + return _isarCollection.putAllSync(objects, saveLinks: saveLinks); + } + + @override + Future putByIndex(String indexName, OBJ object) { + return _spanHelper.asyncWrapInSpan( + 'putByIndex', + () { + return _isarCollection.putByIndex(indexName, object); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Id putByIndexSync(String indexName, OBJ object, {bool saveLinks = true}) { + return _isarCollection.putByIndexSync( + indexName, + object, + saveLinks: saveLinks, + ); + } + + @override + Id putSync(OBJ object, {bool saveLinks = true}) { + return _isarCollection.putSync(object, saveLinks: saveLinks); + } + + @override + CollectionSchema get schema => _isarCollection.schema; + + @override + @visibleForTesting + @experimental + Future verify(List objects) { + return _spanHelper.asyncWrapInSpan( + 'verify', + () { + // ignore: invalid_use_of_visible_for_testing_member + return _isarCollection.verify(objects); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + @visibleForTesting + @experimental + Future verifyLink( + String linkName, + List sourceIds, + List targetIds, + ) { + return _spanHelper.asyncWrapInSpan( + 'verifyLink', + () { + // ignore: invalid_use_of_visible_for_testing_member + return _isarCollection.verifyLink(linkName, sourceIds, targetIds); + }, + dbName: _dbName, + collectionName: name, + ); + } + + @override + Stream watchLazy({bool fireImmediately = false}) { + return _isarCollection.watchLazy(fireImmediately: fireImmediately); + } + + @override + Stream watchObject(Id id, {bool fireImmediately = false}) { + return _isarCollection.watchObject(id, fireImmediately: fireImmediately); + } + + @override + Stream watchObjectLazy(Id id, {bool fireImmediately = false}) { + return _isarCollection.watchObjectLazy( + id, + fireImmediately: fireImmediately, + ); + } + + @override + QueryBuilder where({ + bool distinct = false, + Sort sort = Sort.asc, + }) { + return _isarCollection.where(distinct: distinct, sort: sort); + } +} diff --git a/isar/lib/src/sentry_span_helper.dart b/isar/lib/src/sentry_span_helper.dart new file mode 100644 index 0000000000..ec1823c7ca --- /dev/null +++ b/isar/lib/src/sentry_span_helper.dart @@ -0,0 +1,83 @@ +// ignore_for_file: invalid_internal_annotation + +import 'package:meta/meta.dart'; +import 'package:sentry/sentry.dart'; +import 'sentry_isar.dart'; + +/// @nodoc +@internal +class SentrySpanHelper { + /// @nodoc + Hub _hub = HubAdapter(); + + /// @nodoc + final String _origin; + + /// @nodoc + SentrySpanHelper(this._origin); + + /// @nodoc + void setHub(Hub hub) { + _hub = hub; + } + + /// @nodoc + @internal + Future asyncWrapInSpan( + String description, + Future Function() execute, { + String? dbName, + String? collectionName, + }) async { + final currentSpan = _hub.getSpan(); + final span = currentSpan?.startChild( + SentryIsar.dbOp, + description: description, + ); + + // ignore: invalid_use_of_internal_member + span?.origin = _origin; + + var breadcrumb = Breadcrumb( + message: description, + data: {}, + type: 'query', + ); + + span?.setData(SentryIsar.dbSystemKey, SentryIsar.dbSystem); + + if (dbName != null) { + span?.setData(SentryIsar.dbNameKey, dbName); + breadcrumb.data?[SentryIsar.dbNameKey] = dbName; + } + + if (collectionName != null) { + span?.setData(SentryIsar.dbCollectionKey, collectionName); + breadcrumb.data?[SentryIsar.dbCollectionKey] = collectionName; + } + + try { + final result = await execute(); + + span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + + return result; + } catch (exception) { + span?.throwable = exception; + span?.status = SpanStatus.internalError(); + + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); + + rethrow; + } finally { + await span?.finish(); + + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); + } + } +} diff --git a/isar/lib/src/version.dart b/isar/lib/src/version.dart new file mode 100644 index 0000000000..0e551e8349 --- /dev/null +++ b/isar/lib/src/version.dart @@ -0,0 +1,5 @@ +/// The SDK version reported to Sentry.io in the submitted events. +const String sdkVersion = '7.16.0'; + +/// The package name reported to Sentry.io in the submitted events. +const String packageName = 'pub:sentry_isar'; diff --git a/isar/pubspec.yaml b/isar/pubspec.yaml new file mode 100644 index 0000000000..81770c4d52 --- /dev/null +++ b/isar/pubspec.yaml @@ -0,0 +1,28 @@ +name: sentry_isar +description: An integration which adds support for performance tracing for the isar package. +version: 7.16.0 +homepage: https://docs.sentry.io/platforms/flutter/ +repository: https://github.com/getsentry/sentry-dart +issue_tracker: https://github.com/getsentry/sentry-dart/issues + +environment: + sdk: '>=2.17.0 <4.0.0' + flutter: '>=3.3.0' + +dependencies: + isar: ^3.1.0 + isar_flutter_libs: ^3.1.0 # contains Isar Core + sentry: 7.16.0 + meta: ^1.3.0 + path: ^1.8.3 + +dev_dependencies: + isar_generator: ^3.1.0 + build_runner: ^2.4.6 + lints: ^3.0.0 + flutter_test: + sdk: flutter + coverage: ^1.3.0 + mockito: ^5.1.0 + yaml: ^3.1.0 # needed for version match (code and pubspec) + path_provider: ^2.1.1 diff --git a/isar/pubspec_overrides.yaml b/isar/pubspec_overrides.yaml new file mode 100644 index 0000000000..16e71d16f0 --- /dev/null +++ b/isar/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + sentry: + path: ../dart diff --git a/isar/test/mocks/mocks.dart b/isar/test/mocks/mocks.dart new file mode 100644 index 0000000000..55f59b6de3 --- /dev/null +++ b/isar/test/mocks/mocks.dart @@ -0,0 +1,10 @@ +import 'package:isar/isar.dart'; +import 'package:mockito/annotations.dart'; +import 'package:sentry/sentry.dart'; + +@GenerateMocks([ + Hub, + Isar, + IsarCollection, +]) +void main() {} diff --git a/isar/test/mocks/mocks.mocks.dart b/isar/test/mocks/mocks.mocks.dart new file mode 100644 index 0000000000..4f7adfed86 --- /dev/null +++ b/isar/test/mocks/mocks.mocks.dart @@ -0,0 +1,1340 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in sentry_isar/test/mocks/mocks.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes, invalid_use_of_internal_member +import 'dart:async' as _i3; +import 'dart:typed_data' as _i7; + +import 'package:isar/isar.dart' as _i4; +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i6; +import 'package:sentry/sentry.dart' as _i2; +import 'package:sentry/src/profiling.dart' as _i5; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeSentryOptions_0 extends _i1.SmartFake implements _i2.SentryOptions { + _FakeSentryOptions_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSentryId_1 extends _i1.SmartFake implements _i2.SentryId { + _FakeSentryId_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeScope_2 extends _i1.SmartFake implements _i2.Scope { + _FakeScope_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeHub_3 extends _i1.SmartFake implements _i2.Hub { + _FakeHub_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeISentrySpan_4 extends _i1.SmartFake implements _i2.ISentrySpan { + _FakeISentrySpan_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeFuture_5 extends _i1.SmartFake implements _i3.Future { + _FakeFuture_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeIsarCollection_6 extends _i1.SmartFake + implements _i4.IsarCollection { + _FakeIsarCollection_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeIsar_7 extends _i1.SmartFake implements _i4.Isar { + _FakeIsar_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeCollectionSchema_8 extends _i1.SmartFake + implements _i4.CollectionSchema { + _FakeCollectionSchema_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeQueryBuilder_9 extends _i1.SmartFake + implements _i4.QueryBuilder { + _FakeQueryBuilder_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeQuery_10 extends _i1.SmartFake implements _i4.Query { + _FakeQuery_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Hub]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockHub extends _i1.Mock implements _i2.Hub { + MockHub() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.SentryOptions get options => (super.noSuchMethod( + Invocation.getter(#options), + returnValue: _FakeSentryOptions_0( + this, + Invocation.getter(#options), + ), + ) as _i2.SentryOptions); + + @override + bool get isEnabled => (super.noSuchMethod( + Invocation.getter(#isEnabled), + returnValue: false, + ) as bool); + + @override + _i2.SentryId get lastEventId => (super.noSuchMethod( + Invocation.getter(#lastEventId), + returnValue: _FakeSentryId_1( + this, + Invocation.getter(#lastEventId), + ), + ) as _i2.SentryId); + + @override + _i2.Scope get scope => (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_2( + this, + Invocation.getter(#scope), + ), + ) as _i2.Scope); + + @override + set profilerFactory(_i5.SentryProfilerFactory? value) => super.noSuchMethod( + Invocation.setter( + #profilerFactory, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future<_i2.SentryId> captureEvent( + _i2.SentryEvent? event, { + dynamic stackTrace, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureEvent, + [event], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i3.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureEvent, + [event], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i3.Future<_i2.SentryId>); + + @override + _i3.Future<_i2.SentryId> captureException( + dynamic throwable, { + dynamic stackTrace, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureException, + [throwable], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i3.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureException, + [throwable], + { + #stackTrace: stackTrace, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i3.Future<_i2.SentryId>); + + @override + _i3.Future<_i2.SentryId> captureMessage( + String? message, { + _i2.SentryLevel? level, + String? template, + List? params, + _i2.Hint? hint, + _i2.ScopeCallback? withScope, + }) => + (super.noSuchMethod( + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + returnValue: _i3.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureMessage, + [message], + { + #level: level, + #template: template, + #params: params, + #hint: hint, + #withScope: withScope, + }, + ), + )), + ) as _i3.Future<_i2.SentryId>); + + @override + _i3.Future captureUserFeedback(_i2.SentryUserFeedback? userFeedback) => + (super.noSuchMethod( + Invocation.method( + #captureUserFeedback, + [userFeedback], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future addBreadcrumb( + _i2.Breadcrumb? crumb, { + _i2.Hint? hint, + }) => + (super.noSuchMethod( + Invocation.method( + #addBreadcrumb, + [crumb], + {#hint: hint}, + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + void bindClient(_i2.SentryClient? client) => super.noSuchMethod( + Invocation.method( + #bindClient, + [client], + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Hub clone() => (super.noSuchMethod( + Invocation.method( + #clone, + [], + ), + returnValue: _FakeHub_3( + this, + Invocation.method( + #clone, + [], + ), + ), + ) as _i2.Hub); + + @override + _i3.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.FutureOr configureScope(_i2.ScopeCallback? callback) => + (super.noSuchMethod(Invocation.method( + #configureScope, + [callback], + )) as _i3.FutureOr); + + @override + _i2.ISentrySpan startTransaction( + String? name, + String? operation, { + String? description, + DateTime? startTimestamp, + bool? bindToScope, + bool? waitForChildren, + Duration? autoFinishAfter, + bool? trimEnd, + _i2.OnTransactionFinish? onFinish, + Map? customSamplingContext, + }) => + (super.noSuchMethod( + Invocation.method( + #startTransaction, + [ + name, + operation, + ], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + returnValue: _FakeISentrySpan_4( + this, + Invocation.method( + #startTransaction, + [ + name, + operation, + ], + { + #description: description, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + #customSamplingContext: customSamplingContext, + }, + ), + ), + ) as _i2.ISentrySpan); + + @override + _i2.ISentrySpan startTransactionWithContext( + _i2.SentryTransactionContext? transactionContext, { + Map? customSamplingContext, + DateTime? startTimestamp, + bool? bindToScope, + bool? waitForChildren, + Duration? autoFinishAfter, + bool? trimEnd, + _i2.OnTransactionFinish? onFinish, + }) => + (super.noSuchMethod( + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + returnValue: _FakeISentrySpan_4( + this, + Invocation.method( + #startTransactionWithContext, + [transactionContext], + { + #customSamplingContext: customSamplingContext, + #startTimestamp: startTimestamp, + #bindToScope: bindToScope, + #waitForChildren: waitForChildren, + #autoFinishAfter: autoFinishAfter, + #trimEnd: trimEnd, + #onFinish: onFinish, + }, + ), + ), + ) as _i2.ISentrySpan); + + @override + _i3.Future<_i2.SentryId> captureTransaction( + _i2.SentryTransaction? transaction, { + _i2.SentryTraceContextHeader? traceContext, + }) => + (super.noSuchMethod( + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext}, + ), + returnValue: _i3.Future<_i2.SentryId>.value(_FakeSentryId_1( + this, + Invocation.method( + #captureTransaction, + [transaction], + {#traceContext: traceContext}, + ), + )), + ) as _i3.Future<_i2.SentryId>); + + @override + void setSpanContext( + dynamic throwable, + _i2.ISentrySpan? span, + String? transaction, + ) => + super.noSuchMethod( + Invocation.method( + #setSpanContext, + [ + throwable, + span, + transaction, + ], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [Isar]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIsar extends _i1.Mock implements _i4.Isar { + MockIsar() { + _i1.throwOnMissingStub(this); + } + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + bool get isOpen => (super.noSuchMethod( + Invocation.getter(#isOpen), + returnValue: false, + ) as bool); + + @override + void requireOpen() => super.noSuchMethod( + Invocation.method( + #requireOpen, + [], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future txn(_i3.Future Function()? callback) => + (super.noSuchMethod( + Invocation.method( + #txn, + [callback], + ), + returnValue: _i6.ifNotNull( + _i6.dummyValueOrNull( + this, + Invocation.method( + #txn, + [callback], + ), + ), + (T v) => _i3.Future.value(v), + ) ?? + _FakeFuture_5( + this, + Invocation.method( + #txn, + [callback], + ), + ), + ) as _i3.Future); + + @override + _i3.Future writeTxn( + _i3.Future Function()? callback, { + bool? silent = false, + }) => + (super.noSuchMethod( + Invocation.method( + #writeTxn, + [callback], + {#silent: silent}, + ), + returnValue: _i6.ifNotNull( + _i6.dummyValueOrNull( + this, + Invocation.method( + #writeTxn, + [callback], + {#silent: silent}, + ), + ), + (T v) => _i3.Future.value(v), + ) ?? + _FakeFuture_5( + this, + Invocation.method( + #writeTxn, + [callback], + {#silent: silent}, + ), + ), + ) as _i3.Future); + + @override + T txnSync(T Function()? callback) => (super.noSuchMethod( + Invocation.method( + #txnSync, + [callback], + ), + returnValue: _i6.dummyValue( + this, + Invocation.method( + #txnSync, + [callback], + ), + ), + ) as T); + + @override + T writeTxnSync( + T Function()? callback, { + bool? silent = false, + }) => + (super.noSuchMethod( + Invocation.method( + #writeTxnSync, + [callback], + {#silent: silent}, + ), + returnValue: _i6.dummyValue( + this, + Invocation.method( + #writeTxnSync, + [callback], + {#silent: silent}, + ), + ), + ) as T); + + @override + void attachCollections(Map>? collections) => + super.noSuchMethod( + Invocation.method( + #attachCollections, + [collections], + ), + returnValueForMissingStub: null, + ); + + @override + _i4.IsarCollection collection() => (super.noSuchMethod( + Invocation.method( + #collection, + [], + ), + returnValue: _FakeIsarCollection_6( + this, + Invocation.method( + #collection, + [], + ), + ), + ) as _i4.IsarCollection); + + @override + _i4.IsarCollection? getCollectionByNameInternal(String? name) => + (super.noSuchMethod(Invocation.method( + #getCollectionByNameInternal, + [name], + )) as _i4.IsarCollection?); + + @override + _i3.Future clear() => (super.noSuchMethod( + Invocation.method( + #clear, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + void clearSync() => super.noSuchMethod( + Invocation.method( + #clearSync, + [], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future getSize({ + bool? includeIndexes = false, + bool? includeLinks = false, + }) => + (super.noSuchMethod( + Invocation.method( + #getSize, + [], + { + #includeIndexes: includeIndexes, + #includeLinks: includeLinks, + }, + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int getSizeSync({ + bool? includeIndexes = false, + bool? includeLinks = false, + }) => + (super.noSuchMethod( + Invocation.method( + #getSizeSync, + [], + { + #includeIndexes: includeIndexes, + #includeLinks: includeLinks, + }, + ), + returnValue: 0, + ) as int); + + @override + _i3.Future copyToFile(String? targetPath) => (super.noSuchMethod( + Invocation.method( + #copyToFile, + [targetPath], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future close({bool? deleteFromDisk = false}) => (super.noSuchMethod( + Invocation.method( + #close, + [], + {#deleteFromDisk: deleteFromDisk}, + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); + + @override + _i3.Future verify() => (super.noSuchMethod( + Invocation.method( + #verify, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} + +/// A class which mocks [IsarCollection]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIsarCollection extends _i1.Mock + implements _i4.IsarCollection { + MockIsarCollection() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Isar get isar => (super.noSuchMethod( + Invocation.getter(#isar), + returnValue: _FakeIsar_7( + this, + Invocation.getter(#isar), + ), + ) as _i4.Isar); + + @override + _i4.CollectionSchema get schema => (super.noSuchMethod( + Invocation.getter(#schema), + returnValue: _FakeCollectionSchema_8( + this, + Invocation.getter(#schema), + ), + ) as _i4.CollectionSchema); + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + _i3.Future get(int? id) => (super.noSuchMethod( + Invocation.method( + #get, + [id], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + OBJ? getSync(int? id) => (super.noSuchMethod(Invocation.method( + #getSync, + [id], + )) as OBJ?); + + @override + _i3.Future> getAll(List? ids) => (super.noSuchMethod( + Invocation.method( + #getAll, + [ids], + ), + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); + + @override + List getAllSync(List? ids) => (super.noSuchMethod( + Invocation.method( + #getAllSync, + [ids], + ), + returnValue: [], + ) as List); + + @override + _i3.Future getByIndex( + String? indexName, + List? key, + ) => + (super.noSuchMethod( + Invocation.method( + #getByIndex, + [ + indexName, + key, + ], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + OBJ? getByIndexSync( + String? indexName, + List? key, + ) => + (super.noSuchMethod(Invocation.method( + #getByIndexSync, + [ + indexName, + key, + ], + )) as OBJ?); + + @override + _i3.Future> getAllByIndex( + String? indexName, + List>? keys, + ) => + (super.noSuchMethod( + Invocation.method( + #getAllByIndex, + [ + indexName, + keys, + ], + ), + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); + + @override + List getAllByIndexSync( + String? indexName, + List>? keys, + ) => + (super.noSuchMethod( + Invocation.method( + #getAllByIndexSync, + [ + indexName, + keys, + ], + ), + returnValue: [], + ) as List); + + @override + _i3.Future put(OBJ? object) => (super.noSuchMethod( + Invocation.method( + #put, + [object], + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int putSync( + OBJ? object, { + bool? saveLinks = true, + }) => + (super.noSuchMethod( + Invocation.method( + #putSync, + [object], + {#saveLinks: saveLinks}, + ), + returnValue: 0, + ) as int); + + @override + _i3.Future> putAll(List? objects) => (super.noSuchMethod( + Invocation.method( + #putAll, + [objects], + ), + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); + + @override + List putAllSync( + List? objects, { + bool? saveLinks = true, + }) => + (super.noSuchMethod( + Invocation.method( + #putAllSync, + [objects], + {#saveLinks: saveLinks}, + ), + returnValue: [], + ) as List); + + @override + _i3.Future putByIndex( + String? indexName, + OBJ? object, + ) => + (super.noSuchMethod( + Invocation.method( + #putByIndex, + [ + indexName, + object, + ], + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int putByIndexSync( + String? indexName, + OBJ? object, { + bool? saveLinks = true, + }) => + (super.noSuchMethod( + Invocation.method( + #putByIndexSync, + [ + indexName, + object, + ], + {#saveLinks: saveLinks}, + ), + returnValue: 0, + ) as int); + + @override + _i3.Future> putAllByIndex( + String? indexName, + List? objects, + ) => + (super.noSuchMethod( + Invocation.method( + #putAllByIndex, + [ + indexName, + objects, + ], + ), + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); + + @override + List putAllByIndexSync( + String? indexName, + List? objects, { + bool? saveLinks = true, + }) => + (super.noSuchMethod( + Invocation.method( + #putAllByIndexSync, + [ + indexName, + objects, + ], + {#saveLinks: saveLinks}, + ), + returnValue: [], + ) as List); + + @override + _i3.Future delete(int? id) => (super.noSuchMethod( + Invocation.method( + #delete, + [id], + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); + + @override + bool deleteSync(int? id) => (super.noSuchMethod( + Invocation.method( + #deleteSync, + [id], + ), + returnValue: false, + ) as bool); + + @override + _i3.Future deleteAll(List? ids) => (super.noSuchMethod( + Invocation.method( + #deleteAll, + [ids], + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int deleteAllSync(List? ids) => (super.noSuchMethod( + Invocation.method( + #deleteAllSync, + [ids], + ), + returnValue: 0, + ) as int); + + @override + _i3.Future deleteByIndex( + String? indexName, + List? key, + ) => + (super.noSuchMethod( + Invocation.method( + #deleteByIndex, + [ + indexName, + key, + ], + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); + + @override + bool deleteByIndexSync( + String? indexName, + List? key, + ) => + (super.noSuchMethod( + Invocation.method( + #deleteByIndexSync, + [ + indexName, + key, + ], + ), + returnValue: false, + ) as bool); + + @override + _i3.Future deleteAllByIndex( + String? indexName, + List>? keys, + ) => + (super.noSuchMethod( + Invocation.method( + #deleteAllByIndex, + [ + indexName, + keys, + ], + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int deleteAllByIndexSync( + String? indexName, + List>? keys, + ) => + (super.noSuchMethod( + Invocation.method( + #deleteAllByIndexSync, + [ + indexName, + keys, + ], + ), + returnValue: 0, + ) as int); + + @override + _i3.Future clear() => (super.noSuchMethod( + Invocation.method( + #clear, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + void clearSync() => super.noSuchMethod( + Invocation.method( + #clearSync, + [], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future importJsonRaw(_i7.Uint8List? jsonBytes) => + (super.noSuchMethod( + Invocation.method( + #importJsonRaw, + [jsonBytes], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + void importJsonRawSync(_i7.Uint8List? jsonBytes) => super.noSuchMethod( + Invocation.method( + #importJsonRawSync, + [jsonBytes], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future importJson(List>? json) => + (super.noSuchMethod( + Invocation.method( + #importJson, + [json], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + void importJsonSync(List>? json) => super.noSuchMethod( + Invocation.method( + #importJsonSync, + [json], + ), + returnValueForMissingStub: null, + ); + + @override + _i4.QueryBuilder where({ + bool? distinct = false, + _i4.Sort? sort = _i4.Sort.asc, + }) => + (super.noSuchMethod( + Invocation.method( + #where, + [], + { + #distinct: distinct, + #sort: sort, + }, + ), + returnValue: _FakeQueryBuilder_9( + this, + Invocation.method( + #where, + [], + { + #distinct: distinct, + #sort: sort, + }, + ), + ), + ) as _i4.QueryBuilder); + + @override + _i4.QueryBuilder filter() => + (super.noSuchMethod( + Invocation.method( + #filter, + [], + ), + returnValue: _FakeQueryBuilder_9( + this, + Invocation.method( + #filter, + [], + ), + ), + ) as _i4.QueryBuilder); + + @override + _i4.Query buildQuery({ + List<_i4.WhereClause>? whereClauses = const [], + bool? whereDistinct = false, + _i4.Sort? whereSort = _i4.Sort.asc, + _i4.FilterOperation? filter, + List<_i4.SortProperty>? sortBy = const [], + List<_i4.DistinctProperty>? distinctBy = const [], + int? offset, + int? limit, + String? property, + }) => + (super.noSuchMethod( + Invocation.method( + #buildQuery, + [], + { + #whereClauses: whereClauses, + #whereDistinct: whereDistinct, + #whereSort: whereSort, + #filter: filter, + #sortBy: sortBy, + #distinctBy: distinctBy, + #offset: offset, + #limit: limit, + #property: property, + }, + ), + returnValue: _FakeQuery_10( + this, + Invocation.method( + #buildQuery, + [], + { + #whereClauses: whereClauses, + #whereDistinct: whereDistinct, + #whereSort: whereSort, + #filter: filter, + #sortBy: sortBy, + #distinctBy: distinctBy, + #offset: offset, + #limit: limit, + #property: property, + }, + ), + ), + ) as _i4.Query); + + @override + _i3.Future count() => (super.noSuchMethod( + Invocation.method( + #count, + [], + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int countSync() => (super.noSuchMethod( + Invocation.method( + #countSync, + [], + ), + returnValue: 0, + ) as int); + + @override + _i3.Future getSize({ + bool? includeIndexes = false, + bool? includeLinks = false, + }) => + (super.noSuchMethod( + Invocation.method( + #getSize, + [], + { + #includeIndexes: includeIndexes, + #includeLinks: includeLinks, + }, + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + int getSizeSync({ + bool? includeIndexes = false, + bool? includeLinks = false, + }) => + (super.noSuchMethod( + Invocation.method( + #getSizeSync, + [], + { + #includeIndexes: includeIndexes, + #includeLinks: includeLinks, + }, + ), + returnValue: 0, + ) as int); + + @override + _i3.Stream watchLazy({bool? fireImmediately = false}) => + (super.noSuchMethod( + Invocation.method( + #watchLazy, + [], + {#fireImmediately: fireImmediately}, + ), + returnValue: _i3.Stream.empty(), + ) as _i3.Stream); + + @override + _i3.Stream watchObject( + int? id, { + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchObject, + [id], + {#fireImmediately: fireImmediately}, + ), + returnValue: _i3.Stream.empty(), + ) as _i3.Stream); + + @override + _i3.Stream watchObjectLazy( + int? id, { + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchObjectLazy, + [id], + {#fireImmediately: fireImmediately}, + ), + returnValue: _i3.Stream.empty(), + ) as _i3.Stream); + + @override + _i3.Future verify(List? objects) => (super.noSuchMethod( + Invocation.method( + #verify, + [objects], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future verifyLink( + String? linkName, + List? sourceIds, + List? targetIds, + ) => + (super.noSuchMethod( + Invocation.method( + #verifyLink, + [ + linkName, + sourceIds, + targetIds, + ], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} diff --git a/isar/test/person.dart b/isar/test/person.dart new file mode 100644 index 0000000000..385ae69e04 --- /dev/null +++ b/isar/test/person.dart @@ -0,0 +1,11 @@ +import 'package:isar/isar.dart'; + +part 'person.g.dart'; + +@collection +class Person { + Id id = Isar.autoIncrement; + + @Index() + String? name; +} diff --git a/isar/test/person.g.dart b/isar/test/person.g.dart new file mode 100644 index 0000000000..cbd85e6fe5 --- /dev/null +++ b/isar/test/person.g.dart @@ -0,0 +1,518 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'person.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types + +extension GetPersonCollection on Isar { + IsarCollection get persons => this.collection(); +} + +const PersonSchema = CollectionSchema( + name: r'Person', + id: 7854610480646705599, + properties: { + r'name': PropertySchema( + id: 0, + name: r'name', + type: IsarType.string, + ) + }, + estimateSize: _personEstimateSize, + serialize: _personSerialize, + deserialize: _personDeserialize, + deserializeProp: _personDeserializeProp, + idName: r'id', + indexes: { + r'name': IndexSchema( + id: 879695947855722453, + name: r'name', + unique: false, + replace: false, + properties: [ + IndexPropertySchema( + name: r'name', + type: IndexType.hash, + caseSensitive: true, + ) + ], + ) + }, + links: {}, + embeddedSchemas: {}, + getId: _personGetId, + getLinks: _personGetLinks, + attach: _personAttach, + version: '3.1.0+1', +); + +int _personEstimateSize( + Person object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.name; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + return bytesCount; +} + +void _personSerialize( + Person object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.name); +} + +Person _personDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = Person(); + object.id = id; + object.name = reader.readStringOrNull(offsets[0]); + return object; +} + +P _personDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readStringOrNull(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _personGetId(Person object) { + return object.id; +} + +List> _personGetLinks(Person object) { + return []; +} + +void _personAttach(IsarCollection col, Id id, Person object) { + object.id = id; +} + +extension PersonQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension PersonQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder nameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IndexWhereClause.equalTo( + indexName: r'name', + value: [null], + )); + }); + } + + QueryBuilder nameIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IndexWhereClause.between( + indexName: r'name', + lower: [null], + includeLower: false, + upper: [], + )); + }); + } + + QueryBuilder nameEqualTo(String? name) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IndexWhereClause.equalTo( + indexName: r'name', + value: [name], + )); + }); + } + + QueryBuilder nameNotEqualTo(String? name) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause(IndexWhereClause.between( + indexName: r'name', + lower: [], + upper: [name], + includeUpper: false, + )) + .addWhereClause(IndexWhereClause.between( + indexName: r'name', + lower: [name], + includeLower: false, + upper: [], + )); + } else { + return query + .addWhereClause(IndexWhereClause.between( + indexName: r'name', + lower: [name], + includeLower: false, + upper: [], + )) + .addWhereClause(IndexWhereClause.between( + indexName: r'name', + lower: [], + upper: [name], + includeUpper: false, + )); + } + }); + } +} + +extension PersonQueryFilter on QueryBuilder { + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder nameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'name', + )); + }); + } + + QueryBuilder nameIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'name', + )); + }); + } + + QueryBuilder nameEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'name', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'name', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'name', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder nameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'name', + value: '', + )); + }); + } + + QueryBuilder nameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'name', + value: '', + )); + }); + } +} + +extension PersonQueryObject on QueryBuilder {} + +extension PersonQueryLinks on QueryBuilder {} + +extension PersonQuerySortBy on QueryBuilder { + QueryBuilder sortByName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.asc); + }); + } + + QueryBuilder sortByNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.desc); + }); + } +} + +extension PersonQuerySortThenBy on QueryBuilder { + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.asc); + }); + } + + QueryBuilder thenByNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'name', Sort.desc); + }); + } +} + +extension PersonQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'name', caseSensitive: caseSensitive); + }); + } +} + +extension PersonQueryProperty on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder nameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'name'); + }); + } +} diff --git a/isar/test/sentry_isar_collection_test.dart b/isar/test/sentry_isar_collection_test.dart new file mode 100644 index 0000000000..de55ac5989 --- /dev/null +++ b/isar/test/sentry_isar_collection_test.dart @@ -0,0 +1,928 @@ +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:isar/isar.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_isar/sentry_isar.dart'; +import 'package:sentry_isar/src/sentry_isar.dart'; + +import 'package:sentry/src/sentry_tracer.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'person.dart'; + +void main() { + void verifySpan( + String description, + SentrySpan? span, + ) { + expect(span?.context.operation, SentryIsar.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.ok()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbIsarCollection); + expect(span?.data[SentryIsar.dbNameKey], Fixture.dbName); + expect(span?.data[SentryIsar.dbCollectionKey], 'Person'); + } + + void verifyErrorSpan(String description, SentrySpan? span, Exception error) { + expect(span?.context.operation, SentryIsar.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbIsarCollection); + expect(span?.throwable, error); + } + + void verifyBreadcrumb( + String message, + Breadcrumb? crumb, { + String status = 'ok', + }) { + expect( + crumb?.message, + message, + ); + expect(crumb?.type, 'query'); + expect(crumb?.data?['status'], status); + if (status != 'ok') { + expect(crumb?.level, SentryLevel.warning); + } + } + + group('add spans', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('clear adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().clear(); + }); + final span = fixture.getCreatedSpan(); + verifySpan('clear', span); + }); + + test('count adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().count(); + }); + final span = fixture.getCreatedSpan(); + verifySpan('count', span); + }); + + test('delete adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().delete(0); + }); + final span = fixture.getCreatedSpan(); + verifySpan('delete', span); + }); + + test('deleteAll adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().deleteAll([0]); + }); + final span = fixture.getCreatedSpan(); + verifySpan('deleteAll', span); + }); + + test('deleteAllByIndex adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putByIndex('name', Person()..name = 'Joe'); + await fixture.getSut().deleteAllByIndex('name', []); + }); + final span = fixture.getCreatedSpan(); + verifySpan('deleteAllByIndex', span); + }); + + test('deleteByIndex adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putByIndex('name', Person()..name = 'Joe'); + await fixture.getSut().deleteByIndex('name', []); + }); + final span = fixture.getCreatedSpan(); + verifySpan('deleteByIndex', span); + }); + + test('get adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().get(1); + }); + final span = fixture.getCreatedSpan(); + verifySpan('get', span); + }); + + test('getAll adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getAll([1]); + }); + final span = fixture.getCreatedSpan(); + verifySpan('getAll', span); + }); + + test('getAllByIndex adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getAllByIndex('name', []); + }); + final span = fixture.getCreatedSpan(); + verifySpan('getAllByIndex', span); + }); + + test('getByIndex adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getByIndex('name', []); + }); + final span = fixture.getCreatedSpan(); + verifySpan('getByIndex', span); + }); + + test('getSize adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getSize(); + }); + final span = fixture.getCreatedSpan(); + verifySpan('getSize', span); + }); + + test('importJson adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().importJson([]); + }); + final span = fixture.getCreatedSpan(); + verifySpan('importJson', span); + }); + + test('importJsonRaw adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + final query = fixture.getSut().buildQuery(); + Uint8List jsonRaw = Uint8List.fromList([]); + await query.exportJsonRaw((raw) { + jsonRaw = Uint8List.fromList(raw); + }); + await fixture.getSut().importJsonRaw(jsonRaw); + }); + final span = fixture.getCreatedSpan(); + verifySpan('importJsonRaw', span); + }); + + test('put adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().put(Person()); + }); + final span = fixture.getCreatedSpan(); + verifySpan('put', span); + }); + + test('putAll adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putAll([Person()]); + }); + final span = fixture.getCreatedSpan(); + verifySpan('putAll', span); + }); + + test('putAllByIndex adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putAllByIndex('name', [Person()]); + }); + final span = fixture.getCreatedSpan(); + verifySpan('putAllByIndex', span); + }); + + test('putByIndex adds span', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putByIndex('name', Person()); + }); + final span = fixture.getCreatedSpan(); + verifySpan('putByIndex', span); + }); + }); + + group('add error spans', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + when(fixture.isarCollection.name).thenReturn(Fixture.dbCollection); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing clear adds error span', () async { + when(fixture.isarCollection.clear()).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).clear(); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('clear', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing count adds error span', () async { + when(fixture.isarCollection.count()).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).count(); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('count', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing delete adds error span', () async { + when(fixture.isarCollection.delete(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).delete(0); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('delete', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing deleteAll adds error span', () async { + when(fixture.isarCollection.deleteAll(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).deleteAll([0]); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('deleteAll', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing deleteAllByIndex adds error span', () async { + when(fixture.isarCollection.deleteAllByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).deleteAllByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'deleteAllByIndex', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing deleteByIndex adds error span', () async { + when(fixture.isarCollection.deleteByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).deleteByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'deleteByIndex', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing get adds error span', () async { + when(fixture.isarCollection.get(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).get(1); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('get', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing getAll adds error span', () async { + when(fixture.isarCollection.getAll(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getAll([1]); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('getAll', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing getAllByIndex adds error span', () async { + when(fixture.isarCollection.getAllByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getAllByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'getAllByIndex', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing getByIndex adds error span', () async { + when(fixture.isarCollection.getByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'getByIndex', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing getSize adds error span', () async { + when(fixture.isarCollection.getSize()).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getSize(); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('getSize', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing importJson adds error span', () async { + when(fixture.isarCollection.importJson(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).importJson([]); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'importJson', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing importJsonRaw adds error span', () async { + when(fixture.isarCollection.importJsonRaw(any)) + .thenThrow(fixture.exception); + try { + await fixture + .getSut(injectMock: true) + .importJsonRaw(Uint8List.fromList([])); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'importJsonRaw', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing put adds error span', () async { + when(fixture.isarCollection.put(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).put(Person()); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('put', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing putAll adds error span', () async { + when(fixture.isarCollection.putAll(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).putAll([Person()]); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('putAll', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing putAllByIndex adds error span', () async { + when(fixture.isarCollection.putAllByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture + .getSut(injectMock: true) + .putAllByIndex('name', [Person()]); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'putAllByIndex', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing putByIndex adds error span', () async { + when(fixture.isarCollection.putByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).putByIndex('name', Person()); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'putByIndex', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + }); + + group('add breadcrumbs', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('clear adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().clear(); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('clear', breadcrumb); + }); + + test('count adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().count(); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('count', breadcrumb); + }); + + test('delete adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().delete(0); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('delete', breadcrumb); + }); + + test('deleteAll adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().deleteAll([0]); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('deleteAll', breadcrumb); + }); + + test('deleteAllByIndex adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putByIndex('name', Person()..name = 'Joe'); + await fixture.getSut().deleteAllByIndex('name', []); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[2]; + verifyBreadcrumb('deleteAllByIndex', breadcrumb); + }); + + test('deleteByIndex adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putByIndex('name', Person()..name = 'Joe'); + await fixture.getSut().deleteByIndex('name', []); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[2]; + verifyBreadcrumb('deleteByIndex', breadcrumb); + }); + + test('get adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().get(1); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('get', breadcrumb); + }); + + test('getAll adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getAll([1]); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('getAll', breadcrumb); + }); + + test('getAllByIndex adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getAllByIndex('name', []); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('getAllByIndex', breadcrumb); + }); + + test('getByIndex adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getByIndex('name', []); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('getByIndex', breadcrumb); + }); + + test('getSize adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().getSize(); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('getSize', breadcrumb); + }); + + test('importJson adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().importJson([]); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('importJson', breadcrumb); + }); + + test('importJsonRaw adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + final query = fixture.getSut().buildQuery(); + Uint8List jsonRaw = Uint8List.fromList([]); + await query.exportJsonRaw((raw) { + jsonRaw = Uint8List.fromList(raw); + }); + await fixture.getSut().importJsonRaw(jsonRaw); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('importJsonRaw', breadcrumb); + }); + + test('put adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().put(Person()); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('put', breadcrumb); + }); + + test('putAll adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putAll([Person()]); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('putAll', breadcrumb); + }); + + test('putAllByIndex adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putAllByIndex('name', [Person()]); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('putAllByIndex', breadcrumb); + }); + + test('putByIndex adds breadcrumb', () async { + await fixture.sentryIsar.writeTxn(() async { + await fixture.getSut().putByIndex('name', Person()); + }); + final breadcrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('putByIndex', breadcrumb); + }); + }); + + group('add error breadcrumbs', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + when(fixture.isarCollection.name).thenReturn(Fixture.dbCollection); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing clear adds error breadcrumb', () async { + when(fixture.isarCollection.clear()).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).clear(); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'clear', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing count adds error breadcrumb', () async { + when(fixture.isarCollection.count()).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).count(); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'count', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing delete adds error breadcrumb', () async { + when(fixture.isarCollection.delete(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).delete(0); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'delete', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteAll adds error breadcrumb', () async { + when(fixture.isarCollection.deleteAll(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).deleteAll([0]); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'deleteAll', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteAllByIndex adds error breadcrumb', () async { + when(fixture.isarCollection.deleteAllByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).deleteAllByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'deleteAllByIndex', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing deleteByIndex adds error breadcrumb', () async { + when(fixture.isarCollection.deleteByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).deleteByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'deleteByIndex', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing get adds error breadcrumb', () async { + when(fixture.isarCollection.get(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).get(1); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'get', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing getAll adds error breadcrumb', () async { + when(fixture.isarCollection.getAll(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getAll([1]); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'getAll', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing getAllByIndex adds error breadcrumb', () async { + when(fixture.isarCollection.getAllByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getAllByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'getAllByIndex', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing getByIndex adds error breadcrumb', () async { + when(fixture.isarCollection.getByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getByIndex('name', []); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'getByIndex', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing getSize adds error breadcrumb', () async { + when(fixture.isarCollection.getSize()).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).getSize(); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'getSize', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing importJson adds error breadcrumb', () async { + when(fixture.isarCollection.importJson(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).importJson([]); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'importJson', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing importJsonRaw adds error breadcrumb', () async { + when(fixture.isarCollection.importJsonRaw(any)) + .thenThrow(fixture.exception); + try { + await fixture + .getSut(injectMock: true) + .importJsonRaw(Uint8List.fromList([])); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'importJsonRaw', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing put adds error breadcrumb', () async { + when(fixture.isarCollection.put(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).put(Person()); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'put', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing putAll adds error breadcrumb', () async { + when(fixture.isarCollection.putAll(any)).thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).putAll([Person()]); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'putAll', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing putAllByIndex adds error breadcrumb', () async { + when(fixture.isarCollection.putAllByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture + .getSut(injectMock: true) + .putAllByIndex('name', [Person()]); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'putAllByIndex', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing putByIndex adds error breadcrumb', () async { + when(fixture.isarCollection.putByIndex(any, any)) + .thenThrow(fixture.exception); + try { + await fixture.getSut(injectMock: true).putByIndex('name', Person()); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'putByIndex', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + }); +} + +class Fixture { + final options = SentryOptions(); + final hub = MockHub(); + final isarCollection = MockIsarCollection(); + + static final dbName = 'people-isar'; + static final dbCollection = 'Person'; + final exception = Exception('fixture-exception'); + + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late Isar sentryIsar; + late final scope = Scope(options); + + Future setUp() async { + // Make sure to use flutter test -j 1 to avoid tests running in parallel. This would break the automatic download. + await Isar.initializeIsarCore(download: true); + sentryIsar = await SentryIsar.open( + [PersonSchema], + directory: Directory.systemTemp.path, + name: dbName, + hub: hub, + ); + } + + Future tearDown() async { + try { + // ignore: invalid_use_of_protected_member + sentryIsar.requireOpen(); + await sentryIsar.close(); + } catch (_) { + // Don't close multiple times + } + } + + IsarCollection getSut({bool injectMock = false}) { + if (injectMock) { + return SentryIsarCollection(isarCollection, hub, sentryIsar.name); + } else { + return sentryIsar.collection(); + } + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + Breadcrumb? getCreatedBreadcrumb() { + return hub.scope.breadcrumbs.last; + } +} diff --git a/isar/test/sentry_isar_test.dart b/isar/test/sentry_isar_test.dart new file mode 100644 index 0000000000..222226fa53 --- /dev/null +++ b/isar/test/sentry_isar_test.dart @@ -0,0 +1,476 @@ +@TestOn('vm') + +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:isar/isar.dart'; +import 'package:mockito/mockito.dart'; +import 'package:sentry/sentry.dart'; +import 'package:sentry_isar/src/sentry_isar.dart'; + +import 'package:sentry/src/sentry_tracer.dart'; +import 'package:sentry_isar/src/version.dart'; + +import 'mocks/mocks.mocks.dart'; +import 'person.dart'; + +void main() { + void verifySpan(String description, SentrySpan? span) { + expect(span?.context.operation, SentryIsar.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.ok()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbIsar); + expect(span?.data[SentryIsar.dbNameKey], Fixture.dbName); + } + + void verifyErrorSpan(String description, SentrySpan? span, Exception error) { + expect(span?.context.operation, SentryIsar.dbOp); + expect(span?.context.description, description); + expect(span?.status, SpanStatus.internalError()); + // ignore: invalid_use_of_internal_member + expect(span?.origin, SentryTraceOrigins.autoDbIsar); + expect(span?.throwable, error); + } + + void verifyBreadcrumb( + String message, + Breadcrumb? crumb, { + String status = 'ok', + }) { + expect( + crumb?.message, + message, + ); + expect(crumb?.type, 'query'); + expect(crumb?.data?[SentryIsar.dbNameKey], Fixture.dbName); + expect(crumb?.data?['status'], status); + if (status != 'ok') { + expect(crumb?.level, SentryLevel.warning); + } + } + + group('add spans', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('open adds span', () async { + final span = fixture.getCreatedSpan(); + verifySpan('open', span); + }); + + test('clear adds span', () async { + await fixture.sut.writeTxn(() async { + await fixture.sut.clear(); + }); + final span = fixture.getCreatedSpan(); + verifySpan('clear', span); + }); + + test('close adds span', () async { + await fixture.sut.close(); + final span = fixture.getCreatedSpan(); + verifySpan('close', span); + }); + + test('copyToFile adds span', () async { + await fixture.sut.copyToFile(fixture.copyPath); + final span = fixture.getCreatedSpan(); + verifySpan('copyToFile', span); + }); + + test('getSize adds span', () async { + await fixture.sut.getSize(); + final span = fixture.getCreatedSpan(); + verifySpan('getSize', span); + }); + + test('txn adds span', () async { + await fixture.sut.txn(() async {}); + final span = fixture.getCreatedSpan(); + verifySpan('txn', span); + }); + + test('writeTxn adds span', () async { + await fixture.sut.writeTxn(() async {}); + final span = fixture.getCreatedSpan(); + verifySpan('writeTxn', span); + }); + }); + + group('add error spans', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + when(fixture.isar.close()).thenAnswer((_) async { + return true; + }); + when(fixture.isar.name).thenReturn(Fixture.dbName); + + await fixture.setUp(injectMock: true); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing close adds error span', () async { + when(fixture.isar.close()).thenThrow(fixture.exception); + try { + await fixture.sut.close(); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('close', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing clear adds error span', () async { + when(fixture.isar.clear()).thenThrow(fixture.exception); + try { + await fixture.sut.clear(); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('clear', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing copyToFile adds error span', () async { + when(fixture.isar.copyToFile(any)).thenThrow(fixture.exception); + try { + await fixture.sut.copyToFile(fixture.copyPath); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan( + 'copyToFile', + fixture.getCreatedSpan(), + fixture.exception, + ); + }); + + test('throwing getSize adds error span', () async { + when(fixture.isar.getSize()).thenThrow(fixture.exception); + try { + await fixture.sut.getSize(); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('getSize', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing txn adds error span', () async { + param() async {} + when(fixture.isar.txn(param)).thenThrow(fixture.exception); + try { + await fixture.sut.txn(param); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('txn', fixture.getCreatedSpan(), fixture.exception); + }); + + test('throwing writeTxn adds error span', () async { + param() async {} + when(fixture.isar.writeTxn(param)).thenThrow(fixture.exception); + try { + await fixture.sut.writeTxn(param); + } catch (error) { + expect(error, fixture.exception); + } + verifyErrorSpan('writeTxn', fixture.getCreatedSpan(), fixture.exception); + }); + }); + + group('adds breadcrumbs', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('open adds breadcrumb', () async { + final breadcrumb = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('open', breadcrumb); + }); + + test('clear adds breadcrumb', () async { + await fixture.sut.writeTxn(() async { + await fixture.sut.clear(); + }); + + // order: open, clear, writeTxn + + final openCrumb = fixture.hub.scope.breadcrumbs[0]; + verifyBreadcrumb('open', openCrumb); + + final clearCrumb = fixture.hub.scope.breadcrumbs[1]; + verifyBreadcrumb('clear', clearCrumb); + + final writeTxnCrumb = fixture.hub.scope.breadcrumbs[2]; + verifyBreadcrumb('writeTxn', writeTxnCrumb); + }); + + test('close adds breadcrumb', () async { + await fixture.sut.close(); + final breadcrumb = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('close', breadcrumb); + }); + + test('copyToFile adds breadcrumb', () async { + await fixture.sut.copyToFile(fixture.copyPath); + final breadcrumb = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('copyToFile', breadcrumb); + }); + + test('getSize adds breadcrumb', () async { + await fixture.sut.getSize(); + final breadcrumb = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('getSize', breadcrumb); + }); + + test('txn adds breadcrumb', () async { + await fixture.sut.txn(() async {}); + final breadcrumb = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('txn', breadcrumb); + }); + + test('writeTxn adds breadcrumb', () async { + await fixture.sut.writeTxn(() async {}); + final breadcrumb = fixture.getCreatedBreadcrumb(); + verifyBreadcrumb('writeTxn', breadcrumb); + }); + }); + + group('add error breadcrumbs', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + when(fixture.isar.close()).thenAnswer((_) async { + return true; + }); + when(fixture.isar.name).thenReturn(Fixture.dbName); + + await fixture.setUp(injectMock: true); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('throwing close adds error breadcrumb', () async { + when(fixture.isar.close()).thenThrow(fixture.exception); + try { + await fixture.sut.close(); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'close', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing clear adds error breadcrumb', () async { + when(fixture.isar.clear()).thenThrow(fixture.exception); + try { + await fixture.sut.clear(); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'clear', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing copyToFile adds error breadcrumb', () async { + when(fixture.isar.copyToFile(any)).thenThrow(fixture.exception); + try { + await fixture.sut.copyToFile(fixture.copyPath); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'copyToFile', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing getSize adds error breadcrumb', () async { + when(fixture.isar.getSize()).thenThrow(fixture.exception); + try { + await fixture.sut.getSize(); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'getSize', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing txn adds error breadcrumb', () async { + param() async {} + when(fixture.isar.txn(param)).thenThrow(fixture.exception); + try { + await fixture.sut.txn(param); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'txn', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + + test('throwing writeTxn adds error breadcrumb', () async { + param() async {} + when(fixture.isar.writeTxn(param)).thenThrow(fixture.exception); + try { + await fixture.sut.writeTxn(param); + } catch (error) { + expect(error, fixture.exception); + } + verifyBreadcrumb( + 'writeTxn', + fixture.getCreatedBreadcrumb(), + status: 'internal_error', + ); + }); + }); + + group('integrations', () { + late Fixture fixture; + + setUp(() async { + fixture = Fixture(); + + when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.getSpan()).thenReturn(fixture.tracer); + when(fixture.hub.scope).thenReturn(fixture.scope); + + await fixture.setUp(); + }); + + tearDown(() async { + await fixture.tearDown(); + }); + + test('adds integration', () { + expect( + fixture.options.sdk.integrations.contains('SentryIsarTracing'), + true, + ); + }); + + test('adds package', () { + expect( + fixture.options.sdk.packages.any( + (element) => + element.name == packageName && element.version == sdkVersion, + ), + true, + ); + }); + }); +} + +class Fixture { + final options = SentryOptions(); + final hub = MockHub(); + final isar = MockIsar(); + + static final dbName = 'people-isar'; + final exception = Exception('fixture-exception'); + final copyPath = '${Directory.systemTemp.path}/copy'; + + final _context = SentryTransactionContext('name', 'operation'); + late final tracer = SentryTracer(_context, hub); + late Isar sut; + late final scope = Scope(options); + + Future setUp({bool injectMock = false}) async { + if (injectMock) { + sut = SentryIsar(isar, hub); + } else { + // Make sure to use flutter test -j 1 to avoid tests running in parallel. This would break the automatic download. + await Isar.initializeIsarCore(download: true); + sut = await SentryIsar.open( + [PersonSchema], + directory: Directory.systemTemp.path, + name: dbName, + hub: hub, + ); + } + await deleteCopyPath(); + } + + Future tearDown() async { + try { + // ignore: invalid_use_of_protected_member + sut.requireOpen(); + await sut.close(); + } catch (_) { + // Don't close multiple times + } + } + + Isar getSut() { + return sut; + } + + SentrySpan? getCreatedSpan() { + return tracer.children.last; + } + + Breadcrumb? getCreatedBreadcrumb() { + return hub.scope.breadcrumbs.last; + } + + Future deleteCopyPath() async { + final file = File(copyPath); + if (await file.exists()) { + await file.delete(recursive: true); + } + } +} diff --git a/logging/README.md b/logging/README.md index 0b4b4fcfef..488ebb8adf 100644 --- a/logging/README.md +++ b/logging/README.md @@ -43,8 +43,9 @@ void initApp() { #### Resources -* [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dart/) -* [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks) -* [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) * [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) -* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/logging/class-diagram.svg b/logging/class-diagram.svg new file mode 100644 index 0000000000..327f533953 --- /dev/null +++ b/logging/class-diagram.svg @@ -0,0 +1,69 @@ + + + + + + + + +cluster~ + +logging + + +cluster~/lib + +lib + + +cluster~/lib/src + +src + + + +/lib/src/version.dart + +version + + + +/lib/src/logging_integration.dart + +logging_integration + + + +/lib/src/logging_integration.dart->/lib/src/version.dart + + + + + +/lib/src/extension.dart + +extension + + + +/lib/src/logging_integration.dart->/lib/src/extension.dart + + + + + +/lib/sentry_logging.dart + +sentry_logging + + + +/lib/sentry_logging.dart->/lib/src/logging_integration.dart + + + + + diff --git a/logging/example/sentry_logging_example.dart b/logging/example/sentry_logging_example.dart index 408c40d799..d7b1713e44 100644 --- a/logging/example/sentry_logging_example.dart +++ b/logging/example/sentry_logging_example.dart @@ -20,7 +20,7 @@ Future main() async { Future runApp() async { final log = Logger('MyAwesomeLogger'); - log.warning('a warning!'); + log.warning('this is a warning!'); try { throw Exception(); diff --git a/logging/lib/src/version.dart b/logging/lib/src/version.dart index 3905a5c4dc..47dc6b25a2 100644 --- a/logging/lib/src/version.dart +++ b/logging/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.9.0'; +const String sdkVersion = '7.16.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_logging'; diff --git a/logging/pubspec.yaml b/logging/pubspec.yaml index b964b9d9fd..97e888064b 100644 --- a/logging/pubspec.yaml +++ b/logging/pubspec.yaml @@ -1,20 +1,20 @@ name: sentry_logging description: An integration which adds support for recording log from the logging package. -version: 7.9.0 +version: 7.16.0 homepage: https://docs.sentry.io/platforms/dart/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues -documentation: https://docs.sentry.io/platforms/dart/configuration/integrations/logging/ +documentation: https://docs.sentry.io/platforms/dart/integrations/logging/ environment: sdk: '>=2.17.0 <4.0.0' dependencies: logging: ^1.0.0 - sentry: 7.9.0 + sentry: 7.16.0 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.21.1 yaml: ^3.1.0 # needed for version match (code and pubspec) coverage: ^1.3.0 diff --git a/metrics/flutter.properties b/metrics/flutter.properties index 12a11ee1de..5b903acb68 100644 --- a/metrics/flutter.properties +++ b/metrics/flutter.properties @@ -1,2 +1,2 @@ -version = 3.10.3 +version = 3.16.9 repo = https://github.com/flutter/flutter diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 30ddf659dd..dedd3e1b66 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -10,7 +10,7 @@ NEW_VERSION="${2}" echo "Current version: ${OLD_VERSION}" echo "Bumping version: ${NEW_VERSION}" -for pkg in {dart,flutter,logging,dio,file,sqflite}; do +for pkg in {dart,flutter,logging,dio,file,sqflite,drift,hive,isar}; do # Bump version in pubspec.yaml perl -pi -e "s/^version: .*/version: $NEW_VERSION/" $pkg/pubspec.yaml # Bump sentry dependency version in pubspec.yaml diff --git a/scripts/commit-formatted-code.sh b/scripts/commit-code.sh similarity index 67% rename from scripts/commit-formatted-code.sh rename to scripts/commit-code.sh index 8f77921ceb..b3c1ad9914 100755 --- a/scripts/commit-formatted-code.sh +++ b/scripts/commit-code.sh @@ -2,15 +2,16 @@ set -euo pipefail GITHUB_BRANCH="${1}" +COMMIT_MESSAGE="${2}" if [[ $(git status) == *"nothing to commit"* ]]; then - echo "Nothing to commit. All code formatted correctly." + echo "Nothing to commit." else - echo "Formatted some code. Going to push the changes." + echo "Changed some code. Going to push the changes." git config --global user.name 'Sentry Github Bot' git config --global user.email 'bot+github-bot@sentry.io' git fetch git checkout ${GITHUB_BRANCH} - git commit -am "Format & fix code" + git commit -am "${COMMIT_MESSAGE}" git push --set-upstream origin ${GITHUB_BRANCH} fi diff --git a/scripts/flutter_symbol_collector/.gitignore b/scripts/flutter_symbol_collector/.gitignore new file mode 100644 index 0000000000..d0e14b73aa --- /dev/null +++ b/scripts/flutter_symbol_collector/.gitignore @@ -0,0 +1,6 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +.temp +.cache diff --git a/scripts/flutter_symbol_collector/README.md b/scripts/flutter_symbol_collector/README.md new file mode 100644 index 0000000000..55c60bca27 --- /dev/null +++ b/scripts/flutter_symbol_collector/README.md @@ -0,0 +1,4 @@ +# Flutter symbol collector + +This is an internal tool to collect Flutter debug symbols and upload them to Sentry. +This application is not intended for public usage - we're uploading the symbols in CI automatically so you don't have to. diff --git a/scripts/flutter_symbol_collector/analysis_options.yaml b/scripts/flutter_symbol_collector/analysis_options.yaml new file mode 100644 index 0000000000..9fe3182f8d --- /dev/null +++ b/scripts/flutter_symbol_collector/analysis_options.yaml @@ -0,0 +1,7 @@ +include: package:lints/recommended.yaml + +linter: + rules: + prefer_relative_imports: true + unnecessary_brace_in_string_interps: true + unawaited_futures: true diff --git a/scripts/flutter_symbol_collector/bin/flutter_symbol_collector.dart b/scripts/flutter_symbol_collector/bin/flutter_symbol_collector.dart new file mode 100644 index 0000000000..424134eea7 --- /dev/null +++ b/scripts/flutter_symbol_collector/bin/flutter_symbol_collector.dart @@ -0,0 +1,96 @@ +import 'package:args/args.dart'; +import 'package:file/local.dart'; +import 'package:flutter_symbol_collector/flutter_symbol_collector.dart'; +import 'package:github/github.dart'; +import 'package:logging/logging.dart'; + +const githubToken = String.fromEnvironment('GITHUB_TOKEN'); +final githubAuth = githubToken.isEmpty + ? Authentication.anonymous() + : Authentication.withToken(githubToken); +final source = FlutterSymbolSource(githubAuth: githubAuth); +final fs = LocalFileSystem(); +final tempDir = fs.currentDirectory.childDirectory('.temp'); +final stateCache = + DirectoryStatusCache(fs.currentDirectory.childDirectory('.cache')); +late final SymbolCollectorCli collector; + +void main(List arguments) async { + Logger.root.level = Level.ALL; + Logger.root.onRecord.listen((record) { + print('${record.level.name}: ${record.time}: ${record.message}' + '${record.error == null ? '' : ': ${record.error}'}'); + }); + + final parser = ArgParser()..addOption('version', defaultsTo: ''); + final args = parser.parse(arguments); + final argVersion = args['version'] as String; + + collector = await SymbolCollectorCli.setup(tempDir); + + // If a specific version was given, run just for this version. + if (argVersion.isNotEmpty && + !argVersion.contains('*') && + argVersion.split('.').length == 3) { + Logger.root.info('Running for a single flutter version: $argVersion'); + await processFlutterVersion(FlutterVersion(argVersion)); + } else { + // Otherwise, walk all the versions and run for the matching ones. + final versionRegex = RegExp(argVersion.isEmpty + ? '.*' + : '^${argVersion.replaceAll('.', '\\.').replaceAll('*', '.+')}\$'); + Logger.root.info('Running for all Flutter versions matching $versionRegex'); + final versions = await source + .listFlutterVersions() + .where((v) => !v.isPreRelease) + .where((v) => versionRegex.hasMatch(v.tagName)) + .toList(); + Logger.root.info( + 'Found ${versions.length} Flutter versions matching $versionRegex'); + for (var version in versions) { + await processFlutterVersion(version); + } + } +} + +Future processFlutterVersion(FlutterVersion version) async { + if (bool.hasEnvironment('CI')) { + print('::group::Processing Flutter ${version.tagName}'); + } + Logger.root.info('Processing Flutter ${version.tagName}'); + Logger.root.info('Engine version: ${await version.engineVersion}'); + + final archives = await source.listSymbolArchives(version); + final dir = tempDir.childDirectory(version.tagName); + for (final archive in archives) { + final status = await stateCache.getStatus(archive); + if (status == SymbolArchiveStatus.success) { + Logger.root + .info('Skipping ${archive.path} - already processed successfully'); + continue; + } + + final archiveDir = dir.childDirectory(archive.platform.operatingSystem); + try { + if (await source.downloadAndExtractTo(archiveDir, archive.path)) { + if (await collector.upload(archiveDir, archive.platform, version)) { + await stateCache.setStatus(archive, SymbolArchiveStatus.success); + continue; + } + } + await stateCache.setStatus(archive, SymbolArchiveStatus.error); + } finally { + if (await archiveDir.exists()) { + await archiveDir.delete(recursive: true); + } + } + } + + if (await dir.exists()) { + await dir.delete(recursive: true); + } + + if (bool.hasEnvironment('CI')) { + print('::endgroup::'); + } +} diff --git a/scripts/flutter_symbol_collector/lib/flutter_symbol_collector.dart b/scripts/flutter_symbol_collector/lib/flutter_symbol_collector.dart new file mode 100644 index 0000000000..a972b43f75 --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/flutter_symbol_collector.dart @@ -0,0 +1,5 @@ +export 'src/flutter_symbol_source.dart'; +export 'src/flutter_version.dart'; +export 'src/symbol_collector_cli.dart'; +export 'src/status_cache.dart'; +export 'src/symbol_archive.dart'; diff --git a/scripts/flutter_symbol_collector/lib/src/flutter_symbol_resolver.dart b/scripts/flutter_symbol_collector/lib/src/flutter_symbol_resolver.dart new file mode 100644 index 0000000000..93d9b7e02f --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/src/flutter_symbol_resolver.dart @@ -0,0 +1,73 @@ +import 'package:gcloud/storage.dart'; +import 'package:platform/platform.dart'; + +import 'symbol_archive.dart'; + +abstract class FlutterSymbolResolver { + final String _prefix; + final Bucket _bucket; + final _resolvedFiles = List.empty(growable: true); + Platform get platform; + + FlutterSymbolResolver(this._bucket, String prefix) + : _prefix = prefix.endsWith('/') + ? prefix.substring(0, prefix.length - 1) + : prefix; + + Future tryResolve(String path) async { + path = '$_prefix/$path'; + final matches = await _bucket + .list(prefix: path) + .where((v) => v.isObject) + .where((v) => v.name == path) // because it's a prefix search + .map((v) => v.name) + .toList(); + if (matches.isNotEmpty) { + _resolvedFiles.add(SymbolArchive(matches.single, platform)); + } + } + + Future> listArchives(); +} + +class IosSymbolResolver extends FlutterSymbolResolver { + IosSymbolResolver(super.bucket, super.prefix); + + @override + final platform = FakePlatform(operatingSystem: Platform.iOS); + + @override + Future> listArchives() async { + await tryResolve('ios-release/Flutter.dSYM.zip'); + return _resolvedFiles; + } +} + +class MacOSSymbolResolver extends FlutterSymbolResolver { + MacOSSymbolResolver(super.bucket, super.prefix); + + @override + final platform = FakePlatform(operatingSystem: Platform.macOS); + + @override + Future> listArchives() async { + // darwin-x64-release directory contains a fat (arm64+x86_64) binary. + await tryResolve('darwin-x64-release/FlutterMacOS.dSYM.zip'); + return _resolvedFiles; + } +} + +class AndroidSymbolResolver extends FlutterSymbolResolver { + final String architecture; + + AndroidSymbolResolver(super.bucket, super.prefix, this.architecture); + + @override + final platform = FakePlatform(operatingSystem: Platform.android); + + @override + Future> listArchives() async { + await tryResolve('android-$architecture-release/symbols.zip'); + return _resolvedFiles; + } +} diff --git a/scripts/flutter_symbol_collector/lib/src/flutter_symbol_source.dart b/scripts/flutter_symbol_collector/lib/src/flutter_symbol_source.dart new file mode 100644 index 0000000000..aca3a1e187 --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/src/flutter_symbol_source.dart @@ -0,0 +1,156 @@ +import 'dart:typed_data'; + +import 'package:archive/archive.dart'; +import 'package:archive/archive_io.dart'; +import 'package:file/file.dart'; +import 'package:github/github.dart' as github; +import 'package:gcloud/storage.dart'; +import 'package:http/http.dart'; +import 'package:logging/logging.dart'; +import 'package:path/path.dart' as path; + +import 'flutter_version.dart'; +import 'flutter_symbol_resolver.dart'; +import 'symbol_archive.dart'; + +class FlutterSymbolSource { + late final Logger _log; + final github.GitHub _github; + late final _flutterRepo = github.RepositorySlug('flutter', 'flutter'); + late final _symbolsBucket = + Storage(Client(), '').bucket('flutter_infra_release'); + + FlutterSymbolSource( + {Logger? logger, + github.Authentication githubAuth = + const github.Authentication.anonymous()}) + : _log = logger ?? Logger.root, + _github = github.GitHub(auth: githubAuth); + + Stream listFlutterVersions() => _github.repositories + .listTags(_flutterRepo, perPage: 30) + .map((t) => FlutterVersion(t.name)); + + /// Returns false as the first record value in case there was any error fetching the symbol archives. + Future> listSymbolArchives(FlutterVersion version) async { + // example: https://console.cloud.google.com/storage/browser/flutter_infra_release/flutter/9064459a8b0dcd32877107f6002cc429a71659d1 + final prefix = 'flutter/${await version.engineVersion}/'; + + late final List resolvers; + if (version.tagName.startsWith('3.')) { + resolvers = [ + IosSymbolResolver(_symbolsBucket, prefix), + MacOSSymbolResolver(_symbolsBucket, prefix), + AndroidSymbolResolver(_symbolsBucket, prefix, 'arm'), + AndroidSymbolResolver(_symbolsBucket, prefix, 'arm64') + ]; + } else { + _log.warning('No symbol resolvers registered for ${version.tagName}'); + return []; + } + + assert(resolvers.isNotEmpty); + final archives = List.empty(growable: true); + for (var resolver in resolvers) { + final files = await resolver.listArchives(); + if (files.isEmpty) { + _log.warning( + 'Flutter ${version.tagName}: no debug symbols found by ${resolver.runtimeType}'); + } else { + _log.fine( + 'Flutter ${version.tagName}: ${resolver.runtimeType} found ${files.length} debug symbols: ${files.map((v) => path.basename(v.path))}'); + archives.addAll(files); + } + } + + return archives; + } + + /// Streams the remote file contents. + Stream> download(String filePath) { + _log.fine('Downloading $filePath'); + return _symbolsBucket.read(filePath); + } + + /// Downloads the remote [filePath] to the given [target] directory. + /// If it's an archive, extracts the content instead. + /// returns `true` if the file was downloaded and extracted successfully. + Future downloadAndExtractTo(Directory target, String filePath) async { + if (path.extension(filePath) == '.zip') { + target = await target + .childDirectory(path.withoutExtension(filePath)) + .create(recursive: true); + try { + final buffer = BytesBuilder(); + await download(filePath).forEach(buffer.add); + final archive = ZipDecoder().decodeBytes(buffer.toBytes()); + buffer.clear(); + _log.fine('Extracting $filePath to $target'); + await _extractZip(target, archive); + } catch (e, trace) { + _log.warning('Failed to download $filePath to $target', e, trace); + // Remove the directory so that we don't leave a partial extraction. + await target.delete(recursive: true); + return false; + } + } else { + _log.fine('Downloading $filePath to $target'); + final file = await target + .childFile(filePath) + .create(recursive: true, exclusive: true); + final sink = file.openWrite(); + try { + await sink.addStream(download(filePath)); + await sink.flush(); + await sink.close(); + } catch (e, trace) { + _log.warning('Failed to download $filePath to $target', e, trace); + await sink.close(); + await file.delete(); + return false; + } + } + return true; + } + + Future _extractZip(Directory target, Archive archive) async { + for (var entry in archive.files) { + // Make sure we don't have any zip-slip issues. + final entryPath = _pathNormalize(entry.name); + if (!_pathNormalize(target.childFile(entryPath).path) + .startsWith(target.path)) { + throw Exception( + 'Invalid ZIP entry path (looks like a zip-slip issue): ${entry.name}'); + } + + if (!entry.isFile) { + // If it's a directory - create it. + await target.childDirectory(entryPath).create(recursive: true); + } else { + // Note: package:archive doesn't support extracting directly to an + // IOSink. See https://github.com/brendan-duncan/archive/issues/12 + final stream = OutputStream(); + entry.writeContent(stream, freeMemory: true); + stream.flush(); + + // If it's an inner ZIP archive - extract it recursively. + if (path.extension(entryPath) == '.zip') { + final innerArchive = ZipDecoder().decodeBytes(stream.getBytes()); + stream.clear(); + final innerTarget = + target.childDirectory(path.withoutExtension(entryPath)); + _log.fine('Extracting inner archive $entryPath to $innerTarget'); + await _extractZip(innerTarget, innerArchive); + } else { + final file = + await target.childFile(entryPath).create(exclusive: true); + _log.finer('Writing $file: ${stream.length} bytes'); + await file.writeAsBytes(stream.getBytes(), flush: true); + } + } + } + } + + String _pathNormalize(String p) => + path.normalize(p).replaceAll(path.separator, '/'); +} diff --git a/scripts/flutter_symbol_collector/lib/src/flutter_version.dart b/scripts/flutter_symbol_collector/lib/src/flutter_version.dart new file mode 100644 index 0000000000..6461a4c1fe --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/src/flutter_version.dart @@ -0,0 +1,16 @@ +import 'package:http/http.dart' as http; +import 'package:meta/meta.dart'; + +@immutable +class FlutterVersion { + final String tagName; + + late final engineVersion = http + .get(Uri.https('raw.githubusercontent.com', + 'flutter/flutter/$tagName/bin/internal/engine.version')) + .then((value) => value.body.trim()); + + FlutterVersion(this.tagName); + + bool get isPreRelease => tagName.endsWith('.pre'); +} diff --git a/scripts/flutter_symbol_collector/lib/src/status_cache.dart b/scripts/flutter_symbol_collector/lib/src/status_cache.dart new file mode 100644 index 0000000000..6c456b73c8 --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/src/status_cache.dart @@ -0,0 +1,61 @@ +import 'package:file/file.dart'; +import 'package:logging/logging.dart'; + +import 'symbol_archive.dart'; + +enum SymbolArchiveStatus { + /// The archive has been successfully processed. + success, + + /// The archive has been processed but there was an error. + error, + + /// The archive hasn't been processed yet + pending, +} + +/// Stores and retrieves information about symbol processing status. +abstract class SymbolArchiveStatusCache { + Future setStatus(SymbolArchive archive, SymbolArchiveStatus status); + Future getStatus(SymbolArchive archive); +} + +/// Stores information about symbol processing status in a local directory. +class DirectoryStatusCache implements SymbolArchiveStatusCache { + final Directory _dir; + + DirectoryStatusCache(this._dir) { + _dir.createSync(recursive: true); + } + + File _statusFile(SymbolArchive archive) => + _dir.childFile('${archive.path.toLowerCase()}.status'); + + @override + Future getStatus(SymbolArchive archive) async { + final file = _statusFile(archive); + if (!await file.exists()) { + return SymbolArchiveStatus.pending; + } + return file.readAsString().then((value) { + switch (value) { + case 'success': + return SymbolArchiveStatus.success; + case 'error': + return SymbolArchiveStatus.error; + default: + Logger.root.warning('Unknown status \'$value\' in $file'); + return SymbolArchiveStatus.error; + } + }); + } + + @override + Future setStatus( + SymbolArchive archive, SymbolArchiveStatus status) async { + final file = _statusFile(archive); + Logger.root.info('Setting ${file.path} status to ${status.name}'); + await file.create(recursive: true); + await file.writeAsString(status.name); + } +} diff --git a/scripts/flutter_symbol_collector/lib/src/symbol_archive.dart b/scripts/flutter_symbol_collector/lib/src/symbol_archive.dart new file mode 100644 index 0000000000..f4681e44be --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/src/symbol_archive.dart @@ -0,0 +1,10 @@ +import 'package:platform/platform.dart'; +import 'package:meta/meta.dart'; + +@immutable +class SymbolArchive { + final String path; + final Platform platform; + + SymbolArchive(this.path, this.platform); +} diff --git a/scripts/flutter_symbol_collector/lib/src/symbol_collector_cli.dart b/scripts/flutter_symbol_collector/lib/src/symbol_collector_cli.dart new file mode 100644 index 0000000000..1d4e29a66a --- /dev/null +++ b/scripts/flutter_symbol_collector/lib/src/symbol_collector_cli.dart @@ -0,0 +1,147 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:archive/archive.dart'; +import 'package:archive/archive_io.dart'; +import 'package:file/file.dart'; +import 'package:http/http.dart' as http; +import 'package:logging/logging.dart'; +import 'package:meta/meta.dart'; +import 'package:platform/platform.dart'; +import 'package:posix/posix.dart' as posix; +import 'package:path/path.dart' as path; + +import 'flutter_version.dart'; + +class SymbolCollectorCli { + late final Logger _log = Logger.root; + late bool _isExecutable; + + // https://github.com/getsentry/symbol-collector/releases + @internal + static const version = '1.14.0'; + + @internal + late final String cli; + + @internal + static Platform platform = LocalPlatform(); + + SymbolCollectorCli._(); + + // Downloads the CLI to the given temporary directory and prepares it for use. + static Future setup(Directory tempDir) async { + late final String platformIdentifier; + final executableName = 'symbol-collector'; + + if (platform.isLinux) { + platformIdentifier = 'linux-x64'; + } else if (platform.isMacOS) { + platformIdentifier = 'osx-x64'; + } else { + throw UnsupportedError( + 'Cannot run symbol-collector CLI on this platform - there\'s no binary available at this time.'); + } + + final self = SymbolCollectorCli._(); + + self._log.fine( + 'Downloading symbol-collector CLI v$version for $platformIdentifier'); + final zipData = await http.readBytes(Uri.parse( + 'https://github.com/getsentry/symbol-collector/releases/download/$version/symbolcollector-console-$platformIdentifier.zip')); + self._log.fine( + 'Download successful, received ${zipData.length} bytes; extracting the archive'); + + final archive = ZipDecoder().decodeBytes(zipData); + final stream = OutputStream(); + archive.single.writeContent(stream, freeMemory: true); + stream.flush(); + + await tempDir.create(); + final executableFile = await tempDir.childFile(executableName).create(); + self.cli = executableFile.path; + + await executableFile.writeAsBytes(stream.getBytes(), flush: true); + self._log.fine( + 'Symbol-collector CLI extracted to ${executableFile.path}: ${await executableFile.length()} bytes'); + self._isExecutable = platform.isWindows; + return self; + } + + void _ensureIsExecutable() { + if (!_isExecutable) { + if (LocalPlatform().operatingSystem == platform.operatingSystem) { + if (platform.isLinux || platform.isMacOS) { + _log.fine('Making Symbol-collector CLI executable (chmod +x)'); + + posix.chmod(cli, '0700'); + } + _isExecutable = true; + } else { + _log.warning( + 'Symbol-collector CLI has been run with a platform that is not the current OS platform.' + 'This should only be done in tests because we can\'t execute the downloaded program'); + } + } + } + + Future getVersion() => _execute(['--version', '-h']); + + Future upload( + Directory dir, Platform symbolsPlatform, FlutterVersion flutterVersion, + {bool dryRun = false}) async { + final type = symbolsPlatform.operatingSystem; + try { + await _execute([ + '--upload', + 'directory', + '--path', + dir.path, + '--batch-type', + type, + '--bundle-id', + 'flutter-${flutterVersion.tagName}-$type', + '--server-endpoint', + 'https://symbol-collector.services.sentry.io/', + ]); + } catch (e) { + _log.warning('Failed to upload symbols from ${dir.path}', e); + return false; + } + return true; + } + + Future _execute(List arguments) async { + _ensureIsExecutable(); + + _log.fine('Executing ${path.basename(cli)} ${arguments.join(' ')}'); + final process = await Process.start(cli, arguments); + + final output = StringBuffer(); + handleOutput(Level level, String message) { + message.trimRight().split('\n').forEach((s) => _log.log(level, ' $s')); + output.write(message); + } + + final pipes = [ + process.stdout + .transform(utf8.decoder) + .forEach((s) => handleOutput(Level.FINER, s)), + process.stderr + .transform(utf8.decoder) + .forEach((s) => handleOutput(Level.SEVERE, s)) + ]; + + final exitCode = await process.exitCode; + await Future.wait(pipes); + final strOutput = output.toString().trimRight(); + if (exitCode != 0) { + throw Exception('Symbol-collector CLI failed with exit code $exitCode.'); + } else if (strOutput.contains('Exception:')) { + // see https://github.com/getsentry/symbol-collector/issues/167 + throw Exception('Symbol-collector CLI failed with an exception.'); + } + + return strOutput; + } +} diff --git a/scripts/flutter_symbol_collector/pubspec.yaml b/scripts/flutter_symbol_collector/pubspec.yaml new file mode 100644 index 0000000000..0464e16e0d --- /dev/null +++ b/scripts/flutter_symbol_collector/pubspec.yaml @@ -0,0 +1,24 @@ +name: flutter_symbol_collector +description: Internal tool to collect Flutter debug symbols and upload them to Sentry +publish_to: none + +environment: + sdk: ^3.0.0 + +dependencies: + archive: ^3.4.6 + args: ^2.4.2 + file: ^7.0.0 + gcloud: ^0.8.11 + github: ^9.19.0 + http: ^1.1.0 + logging: ^1.2.0 + meta: ^1.11.0 + path: ^1.8.3 + platform: ^3.1.3 + posix: ^5.0.0 + + +dev_dependencies: + lints: ^2.0.0 + test: ^1.21.0 diff --git a/scripts/flutter_symbol_collector/test/common.dart b/scripts/flutter_symbol_collector/test/common.dart new file mode 100644 index 0000000000..22d1877435 --- /dev/null +++ b/scripts/flutter_symbol_collector/test/common.dart @@ -0,0 +1,9 @@ +import 'package:logging/logging.dart'; + +void setupLogging() { + Logger.root.level = Level.ALL; + Logger.root.onRecord.listen((record) { + print('${record.level.name}: ${record.time}: ${record.message}' + '${record.error == null ? '' : ': ${record.error}'}'); + }); +} diff --git a/scripts/flutter_symbol_collector/test/flutter_symbol_source_test.dart b/scripts/flutter_symbol_collector/test/flutter_symbol_source_test.dart new file mode 100644 index 0000000000..9153ac3128 --- /dev/null +++ b/scripts/flutter_symbol_collector/test/flutter_symbol_source_test.dart @@ -0,0 +1,81 @@ +import 'package:file/file.dart'; +import 'package:file/memory.dart'; +import 'package:flutter_symbol_collector/flutter_symbol_collector.dart'; +import 'package:test/test.dart'; + +import 'common.dart'; + +void main() { + setupLogging(); + late FileSystem fs; + late FlutterSymbolSource sut; + + setUp(() { + fs = MemoryFileSystem.test(); + sut = FlutterSymbolSource(); + }); + + test('listFlutterVersions() returns a stable list', () async { + final versions = await sut.listFlutterVersions().take(3).toList(); + expect(versions.map((v) => v.tagName), + equals(['v1.16.3', 'v1.16.2', 'v1.16.1'])); + }); + + test('listFlutterVersions() fetches items across multiple API page requests', + () async { + // the page size defaults to 30 at the moment, see listFlutterVersions() + final versions = await sut.listFlutterVersions().take(105).toList(); + expect(versions.length, equals(105)); + }); + + test('Engine versions match expected values', () async { + final versions = await sut.listFlutterVersions().take(3).toList(); + final engines = List.empty(growable: true); + for (var v in versions) { + engines.add("${v.tagName} => ${await v.engineVersion}"); + } + expect( + engines, + equals([ + 'v1.16.3 => b2bdeb3f0f1683f3e0562f491b5e316240dfbc2c', + 'v1.16.2 => 2d42c74a348d98d2fd372a91953c104e58f185cd', + 'v1.16.1 => 216c420a2c06e5266a60a768b3fd0b660551cc9c' + ])); + }); + + test('listSymbolArchives() supports expected platforms', () async { + final archives = await sut.listSymbolArchives(FlutterVersion('3.13.4')); + const prefix = 'flutter/9064459a8b0dcd32877107f6002cc429a71659d1'; + expect( + archives.map((v) => '${v.platform.operatingSystem} - ${v.path}'), + equals([ + 'ios - $prefix/ios-release/Flutter.dSYM.zip', + 'macos - $prefix/darwin-x64-release/FlutterMacOS.dSYM.zip', + 'android - flutter/9064459a8b0dcd32877107f6002cc429a71659d1/android-arm-release/symbols.zip', + 'android - flutter/9064459a8b0dcd32877107f6002cc429a71659d1/android-arm64-release/symbols.zip' + ])); + }); + + test('download() downloads the file', () async { + // No need to download a large archive, just some small file to test this. + final content = await sut + .download('test.txt') + .map(String.fromCharCodes) + .reduce((a, b) => '$a$b'); + expect(content, equals('test\n')); + }); + + test('downloadAndExtractTo() downloads a plain file', () async { + await sut.downloadAndExtractTo(fs.currentDirectory, 'test.txt'); + expect(fs.isFileSync('test.txt'), isTrue); + expect(fs.file('test.txt').readAsStringSync(), equals('test\n')); + }); + + test('downloadAndExtractTo() extracts a zip file', () async { + const path = 'flutter/0005149dca9b248663adcde4bdd7c6c915a76584'; + await sut.downloadAndExtractTo(fs.currentDirectory, '$path/sky_engine.zip'); + expect(fs.isDirectorySync('$path/sky_engine/sky_engine'), isTrue); + expect(fs.file('$path/sky_engine/sky_engine/README.md').readAsStringSync(), + startsWith('Flutter Engine')); + }); +} diff --git a/scripts/flutter_symbol_collector/test/flutter_version_test.dart b/scripts/flutter_symbol_collector/test/flutter_version_test.dart new file mode 100644 index 0000000000..5786292dc0 --- /dev/null +++ b/scripts/flutter_symbol_collector/test/flutter_version_test.dart @@ -0,0 +1,11 @@ +import 'package:flutter_symbol_collector/flutter_symbol_collector.dart'; +import 'package:test/test.dart'; + +void main() { + test('$FlutterVersion.isPrerelease()', () async { + expect(FlutterVersion('v1.16.3').isPreRelease, false); + expect(FlutterVersion('v1.16.3.pre').isPreRelease, true); + expect(FlutterVersion('3.16.0-9.0').isPreRelease, false); + expect(FlutterVersion('3.16.0-9.0.pre').isPreRelease, true); + }); +} diff --git a/scripts/flutter_symbol_collector/test/status_cache_test.dart b/scripts/flutter_symbol_collector/test/status_cache_test.dart new file mode 100644 index 0000000000..f8b929db79 --- /dev/null +++ b/scripts/flutter_symbol_collector/test/status_cache_test.dart @@ -0,0 +1,43 @@ +import 'package:file/file.dart'; +import 'package:file/memory.dart'; +import 'package:flutter_symbol_collector/flutter_symbol_collector.dart'; +import 'package:platform/platform.dart'; +import 'package:test/test.dart'; + +import 'common.dart'; + +void main() { + setupLogging(); + + group('DirectoryStatusCache', () { + late FileSystem fs; + late SymbolArchiveStatusCache sut; + final archive = SymbolArchive('path/to/archive.zip', LocalPlatform()); + + setUp(() { + fs = MemoryFileSystem.test(); + sut = DirectoryStatusCache(fs.currentDirectory); + }); + + test('retrieve unprocessed file', () async { + expect(await sut.getStatus(archive), SymbolArchiveStatus.pending); + }); + + test('store and retrieve error', () async { + await sut.setStatus(archive, SymbolArchiveStatus.error); + expect(await sut.getStatus(archive), SymbolArchiveStatus.error); + }); + + test('store and retrieve success', () async { + await sut.setStatus(archive, SymbolArchiveStatus.success); + expect(await sut.getStatus(archive), SymbolArchiveStatus.success); + }); + + test('store, overwrite and retrieve', () async { + await sut.setStatus(archive, SymbolArchiveStatus.error); + expect(await sut.getStatus(archive), SymbolArchiveStatus.error); + await sut.setStatus(archive, SymbolArchiveStatus.success); + expect(await sut.getStatus(archive), SymbolArchiveStatus.success); + }); + }); +} diff --git a/scripts/flutter_symbol_collector/test/symbol_collector_cli_test.dart b/scripts/flutter_symbol_collector/test/symbol_collector_cli_test.dart new file mode 100644 index 0000000000..dbd9a50e12 --- /dev/null +++ b/scripts/flutter_symbol_collector/test/symbol_collector_cli_test.dart @@ -0,0 +1,72 @@ +import 'package:file/file.dart'; +import 'package:file/local.dart'; +import 'package:file/memory.dart'; +import 'package:flutter_symbol_collector/src/flutter_version.dart'; +import 'package:flutter_symbol_collector/src/symbol_collector_cli.dart'; +import 'package:platform/platform.dart'; +import 'package:test/test.dart'; + +import 'common.dart'; + +void main() { + setupLogging(); + + group('setup() downloads CLI on', () { + late FileSystem fs; + + setUp(() { + fs = MemoryFileSystem.test(); + }); + for (final platform in [Platform.macOS, Platform.linux]) { + test(platform, () async { + const path = 'temp/symbol-collector'; + + // make sure the file is overwritten if there's an older version + await fs + .file(path) + .create(recursive: true) + .then((file) => file.writeAsString('foo')); + expect(fs.file(path).lengthSync(), equals(3)); + + final originalPlatform = SymbolCollectorCli.platform; + try { + SymbolCollectorCli.platform = FakePlatform(operatingSystem: platform); + final sut = await SymbolCollectorCli.setup(fs.directory('temp')); + expect(sut.cli, equals(path)); + expect(fs.file(path).existsSync(), isTrue); + expect(fs.file(path).lengthSync(), greaterThan(1000000)); + } finally { + SymbolCollectorCli.platform = originalPlatform; + } + }); + } + }); + + group('execute', () { + final tmpDir = LocalFileSystem() + .systemTempDirectory + .createTempSync('symbol_collector_test'); + late final SymbolCollectorCli sut; + + setUpAll(() async => sut = await SymbolCollectorCli.setup(tmpDir)); + tearDownAll(() => tmpDir.delete(recursive: true)); + + test('getVersion()', () async { + final output = await sut.getVersion(); + expect(output, startsWith('${SymbolCollectorCli.version}+')); + expect(output.split("\n").length, equals(1)); + }); + + test('upload()', () async { + final uploadDir = LocalFileSystem() + .systemTempDirectory + .createTempSync('symbol_collector_upload_test'); + try { + await sut.upload( + uploadDir, LocalPlatform(), FlutterVersion('v0.0.0-test')); + } finally { + uploadDir.deleteSync(); + } + }); + }, skip: LocalPlatform().isWindows); +} diff --git a/scripts/update-symbol-collector.sh b/scripts/update-symbol-collector.sh new file mode 100755 index 0000000000..0df03b9434 --- /dev/null +++ b/scripts/update-symbol-collector.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd $(dirname "$0")/flutter_symbol_collector +file='lib/src/symbol_collector_cli.dart' +content=$(cat $file) +regex="(static const version = )'([0-9\.]+)'" +if ! [[ $content =~ $regex ]]; then + echo "Failed to find the plugin version in $file" + exit 1 +fi + +case $1 in +get-version) + echo ${BASH_REMATCH[2]} + ;; +get-repo) + echo "https://github.com/getsentry/symbol-collector.git" + ;; +set-version) + newValue="${BASH_REMATCH[1]}'$2'" + echo "${content/${BASH_REMATCH[0]}/$newValue}" >$file + ;; +*) + echo "Unknown argument $1" + exit 1 + ;; +esac diff --git a/sqflite/README.md b/sqflite/README.md index ed2b3c4f9d..ff5774ba74 100644 --- a/sqflite/README.md +++ b/sqflite/README.md @@ -62,8 +62,9 @@ Future insertProducts() async { #### Resources -* [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/dart/) -* [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks) -* [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) +* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K) * [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) -* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) +* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \ No newline at end of file diff --git a/sqflite/class-diagram.svg b/sqflite/class-diagram.svg new file mode 100644 index 0000000000..882e930afe --- /dev/null +++ b/sqflite/class-diagram.svg @@ -0,0 +1,194 @@ + + + + + + + + +cluster~ + +sqflite + + +cluster~/lib + +lib + + +cluster~/lib/src + +src + + +cluster~/lib/src/utils + +utils + + + +/lib/src/version.dart + +version + + + +/lib/src/sentry_database.dart + +sentry_database + + + +/lib/src/sentry_database.dart->/lib/src/version.dart + + + + + +/lib/src/sentry_database_executor.dart + +sentry_database_executor + + + +/lib/src/sentry_database.dart->/lib/src/sentry_database_executor.dart + + + + + +/lib/src/utils/sentry_database_span_attributes.dart + +sentry_database_span_attributes + + + +/lib/src/sentry_database.dart->/lib/src/utils/sentry_database_span_attributes.dart + + + + + +/lib/src/sentry_sqflite_transaction.dart + +sentry_sqflite_transaction + + + +/lib/src/sentry_database.dart->/lib/src/sentry_sqflite_transaction.dart + + + + + +/lib/src/sentry_batch.dart + +sentry_batch + + + +/lib/src/sentry_batch.dart->/lib/src/sentry_database.dart + + + + + +/lib/src/sentry_batch.dart->/lib/src/utils/sentry_database_span_attributes.dart + + + + + +/lib/src/sentry_database_executor.dart->/lib/src/sentry_database.dart + + + + + +/lib/src/sentry_database_executor.dart->/lib/src/sentry_batch.dart + + + + + +/lib/src/sentry_database_executor.dart->/lib/src/utils/sentry_database_span_attributes.dart + + + + + +/lib/src/sentry_sqflite_database_factory.dart + +sentry_sqflite_database_factory + + + +/lib/src/sentry_sqflite_database_factory.dart->/lib/src/sentry_database.dart + + + + + +/lib/src/sentry_sqflite.dart + +sentry_sqflite + + + +/lib/src/sentry_sqflite.dart->/lib/src/sentry_database.dart + + + + + +/lib/sentry_sqflite.dart + +sentry_sqflite + + + +/lib/src/utils/sentry_database_span_attributes.dart->/lib/sentry_sqflite.dart + + + + + +/lib/src/sentry_sqflite_transaction.dart->/lib/src/sentry_batch.dart + + + + + +/lib/sentry_sqflite.dart->/lib/src/sentry_database.dart + + + + + +/lib/sentry_sqflite.dart->/lib/src/sentry_batch.dart + + + + + +/lib/sentry_sqflite.dart->/lib/src/sentry_sqflite_database_factory.dart + + + + + +/lib/sentry_sqflite.dart->/lib/src/sentry_sqflite.dart + + + + + +/lib/sentry_sqflite.dart->/lib/src/sentry_sqflite_transaction.dart + + + + + diff --git a/sqflite/lib/src/sentry_batch.dart b/sqflite/lib/src/sentry_batch.dart index 95949125bd..a510ad186f 100644 --- a/sqflite/lib/src/sentry_batch.dart +++ b/sqflite/lib/src/sentry_batch.dart @@ -6,6 +6,7 @@ import 'package:sqflite/sqflite.dart'; import 'package:sqflite_common/src/sql_builder.dart'; import 'sentry_database.dart'; +import 'utils/sentry_database_span_attributes.dart'; /// A [Batch] wrapper that adds Sentry support. /// @@ -21,6 +22,7 @@ import 'sentry_database.dart'; class SentryBatch implements Batch { final Batch _batch; final Hub _hub; + final String? _dbName; // we don't clear the buffer because SqfliteBatch don't either final _buffer = StringBuffer(); @@ -36,7 +38,9 @@ class SentryBatch implements Batch { SentryBatch( this._batch, { @internal Hub? hub, - }) : _hub = hub ?? HubAdapter(); + @internal String? dbName, + }) : _hub = hub ?? HubAdapter(), + _dbName = dbName; @override Future> apply({bool? noResult, bool? continueOnError}) { @@ -47,8 +51,17 @@ class SentryBatch implements Batch { SentryDatabase.dbOp, description: _buffer.toString().trim(), ); + // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteBatch; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: _buffer.toString().trim(), + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _batch.apply( @@ -58,14 +71,23 @@ class SentryBatch implements Batch { span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); + rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -86,6 +108,14 @@ class SentryBatch implements Batch { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteBatch; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: _buffer.toString().trim(), + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _batch.commit( @@ -95,15 +125,23 @@ class SentryBatch implements Batch { ); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); + rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } diff --git a/sqflite/lib/src/sentry_database.dart b/sqflite/lib/src/sentry_database.dart index f47551cff8..23ac1dae63 100644 --- a/sqflite/lib/src/sentry_database.dart +++ b/sqflite/lib/src/sentry_database.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:meta/meta.dart'; import 'package:sentry/sentry.dart'; import 'package:sqflite/sqflite.dart'; @@ -5,6 +7,8 @@ import 'package:sqflite/sqflite.dart'; import 'sentry_database_executor.dart'; import 'sentry_sqflite_transaction.dart'; import 'version.dart'; +import 'utils/sentry_database_span_attributes.dart'; +import 'package:path/path.dart' as p; /// A [Database] wrapper that adds Sentry support. /// @@ -30,7 +34,22 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { // ignore: public_member_api_docs static const dbSqlQueryOp = 'db.sql.query'; - static const _dbSqlOp = 'db.sql.transaction'; + static const _dbSqlTransactionOp = 'db.sql.transaction'; + + static const _dbSqlReadTransactionOp = 'db.sql.read_transaction'; + + @internal + // ignore: public_member_api_docs + static const dbSystemKey = 'db.system'; + @internal + // ignore: public_member_api_docs + static const dbSystem = 'sqlite'; + @internal + // ignore: public_member_api_docs + static const dbNameKey = 'db.name'; + @internal + // ignore: public_member_api_docs + String dbName; /// ```dart /// import 'package:sqflite/sqflite.dart'; @@ -43,7 +62,12 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { this._database, { @internal Hub? hub, }) : _hub = hub ?? HubAdapter(), - super(_database, hub: hub) { + dbName = p.basenameWithoutExtension(_database.path), + super( + _database, + hub: hub, + dbName: p.basenameWithoutExtension(_database.path), + ) { // ignore: invalid_use_of_internal_member final options = _hub.options; options.sdk.addIntegration('SentrySqfliteTracing'); @@ -56,24 +80,39 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { Future close() { return Future(() async { final currentSpan = _hub.getSpan(); + final description = 'Close DB: ${_database.path}'; final span = currentSpan?.startChild( dbOp, - description: 'Close DB: ${_database.path}', + description: description, ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabase; + var breadcrumb = Breadcrumb( + message: description, + category: dbOp, + data: {}, + type: 'query', + ); + try { await _database.close(); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -107,18 +146,32 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { }) { return Future(() async { final currentSpan = _hub.getSpan(); + final description = 'Transaction DB: ${_database.path}'; final span = currentSpan?.startChild( - _dbSqlOp, - description: 'Transaction DB: ${_database.path}', + _dbSqlTransactionOp, + description: description, ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabase; + setDatabaseAttributeData(span, dbName); + + var breadcrumb = Breadcrumb( + message: description, + category: _dbSqlTransactionOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, dbName); Future newAction(Transaction txn) async { - final executor = - SentryDatabaseExecutor(txn, parentSpan: span, hub: _hub); + final executor = SentryDatabaseExecutor( + txn, + parentSpan: span, + hub: _hub, + dbName: dbName, + ); final sentrySqfliteTransaction = - SentrySqfliteTransaction(executor, hub: _hub); + SentrySqfliteTransaction(executor, hub: _hub, dbName: dbName); return await action(sentrySqfliteTransaction); } @@ -128,16 +181,106 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { await _database.transaction(newAction, exclusive: exclusive); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + + return result; + } catch (exception) { + span?.throwable = exception; + span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); + + rethrow; + } finally { + await span?.finish(); + + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); + } + }); + } + + @override + // ignore: override_on_non_overriding_member, public_member_api_docs + Future readTransaction(Future Function(Transaction txn) action) { + return Future(() async { + final currentSpan = _hub.getSpan(); + final description = 'Transaction DB: ${_database.path}'; + final span = currentSpan?.startChild( + _dbSqlReadTransactionOp, + description: description, + ); + // ignore: invalid_use_of_internal_member + span?.origin = SentryTraceOrigins.autoDbSqfliteDatabase; + setDatabaseAttributeData(span, dbName); + + var breadcrumb = Breadcrumb( + message: description, + category: _dbSqlReadTransactionOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, dbName); + + Future newAction(Transaction txn) async { + final executor = SentryDatabaseExecutor( + txn, + parentSpan: span, + hub: _hub, + dbName: dbName, + ); + final sentrySqfliteTransaction = + SentrySqfliteTransaction(executor, hub: _hub, dbName: dbName); + + return await action(sentrySqfliteTransaction); + } + + try { + final futureOrResult = _resolvedReadTransaction(newAction); + T result; + + if (futureOrResult is Future) { + result = await futureOrResult; + } else { + result = futureOrResult; + } + + span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } + + FutureOr _resolvedReadTransaction( + Future Function(Transaction txn) action, + ) async { + try { + // ignore: return_of_invalid_type + final result = await (_database as dynamic).readTransaction(action); + // Await and cast, as directly returning the future resulted in a runtime error. + return result as T; + } on NoSuchMethodError catch (_) { + // The `readTransaction` does not exists on sqflite version < 2.5.0+2. + // Fallback to transaction instead. + return _database.transaction(action); + } + } } diff --git a/sqflite/lib/src/sentry_database_executor.dart b/sqflite/lib/src/sentry_database_executor.dart index b43d13c8d6..f13b0eb261 100644 --- a/sqflite/lib/src/sentry_database_executor.dart +++ b/sqflite/lib/src/sentry_database_executor.dart @@ -7,24 +7,28 @@ import 'package:sqflite_common/src/sql_builder.dart'; import 'sentry_batch.dart'; import 'sentry_database.dart'; +import 'utils/sentry_database_span_attributes.dart'; @internal // ignore: public_member_api_docs class SentryDatabaseExecutor implements DatabaseExecutor { final DatabaseExecutor _executor; final ISentrySpan? _parentSpan; + final String? _dbName; // ignore: public_member_api_docs SentryDatabaseExecutor( this._executor, { ISentrySpan? parentSpan, @internal Hub? hub, + @internal String? dbName, }) : _parentSpan = parentSpan, - _hub = hub ?? HubAdapter(); + _hub = hub ?? HubAdapter(), + _dbName = dbName; final Hub _hub; @override - Batch batch() => SentryBatch(_executor.batch(), hub: _hub); + Batch batch() => SentryBatch(_executor.batch(), hub: _hub, dbName: _dbName); @override Database get database => _executor.database; @@ -41,21 +45,37 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: builder.sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.delete(table, where: where, whereArgs: whereArgs); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -68,20 +88,37 @@ class SentryDatabaseExecutor implements DatabaseExecutor { SentryDatabase.dbSqlExecuteOp, description: sql, ); + span?.setData(SentryDatabase.dbSystemKey, SentryDatabase.dbSystem); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { await _executor.execute(sql, arguments); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -107,6 +144,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: builder.sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.insert( @@ -117,15 +163,22 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -163,6 +216,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: builder.sql, + category: SentryDatabase.dbSqlQueryOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.query( @@ -179,15 +241,22 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -226,6 +295,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: builder.sql, + category: SentryDatabase.dbSqlQueryOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.queryCursor( @@ -243,15 +321,22 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -266,20 +351,36 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.rawDelete(sql, arguments); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -294,20 +395,36 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.rawInsert(sql, arguments); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -325,20 +442,36 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: sql, + category: SentryDatabase.dbSqlQueryOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.rawQuery(sql, arguments); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -357,6 +490,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: sql, + category: SentryDatabase.dbSqlQueryOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.rawQueryCursor( @@ -366,15 +508,22 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -389,20 +538,36 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.rawUpdate(sql, arguments); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } @@ -430,6 +595,15 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteDatabaseExecutor; + setDatabaseAttributeData(span, _dbName); + + var breadcrumb = Breadcrumb( + message: builder.sql, + category: SentryDatabase.dbSqlExecuteOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, _dbName); try { final result = await _executor.update( @@ -441,15 +615,22 @@ class SentryDatabaseExecutor implements DatabaseExecutor { ); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; return result; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } diff --git a/sqflite/lib/src/sentry_sqflite.dart b/sqflite/lib/src/sentry_sqflite.dart index ebd39b547b..b26b767808 100644 --- a/sqflite/lib/src/sentry_sqflite.dart +++ b/sqflite/lib/src/sentry_sqflite.dart @@ -40,13 +40,20 @@ Future openDatabaseWithSentry( final newHub = hub ?? HubAdapter(); final currentSpan = newHub.getSpan(); + final description = 'Open DB: $path'; final span = currentSpan?.startChild( SentryDatabase.dbOp, - description: 'Open DB: $path', + description: description, ); // ignore: invalid_use_of_internal_member span?.origin = SentryTraceOrigins.autoDbSqfliteOpenDatabase; + var breadcrumb = Breadcrumb( + message: description, + category: SentryDatabase.dbOp, + data: {}, + ); + try { final database = await databaseFactory.openDatabase(path, options: dbOptions); @@ -54,14 +61,22 @@ Future openDatabaseWithSentry( final sentryDatabase = SentryDatabase(database, hub: newHub); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + return sentryDatabase; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await newHub.scope.addBreadcrumb(breadcrumb); } }); } diff --git a/sqflite/lib/src/sentry_sqflite_database_factory.dart b/sqflite/lib/src/sentry_sqflite_database_factory.dart index 4fff7479b1..827e516afa 100644 --- a/sqflite/lib/src/sentry_sqflite_database_factory.dart +++ b/sqflite/lib/src/sentry_sqflite_database_factory.dart @@ -59,15 +59,22 @@ class SentrySqfliteDatabaseFactory with SqfliteDatabaseFactoryMixin { return Future(() async { final currentSpan = _hub.getSpan(); + final description = 'Open DB: $path'; final span = currentSpan?.startChild( SentryDatabase.dbOp, - description: 'Open DB: $path', + description: description, ); span?.origin = // ignore: invalid_use_of_internal_member SentryTraceOrigins.autoDbSqfliteDatabaseFactory; + var breadcrumb = Breadcrumb( + message: description, + category: SentryDatabase.dbOp, + data: {}, + ); + try { final database = await databaseFactory.openDatabase(path, options: options); @@ -75,14 +82,21 @@ class SentrySqfliteDatabaseFactory with SqfliteDatabaseFactoryMixin { final sentryDatabase = SentryDatabase(database, hub: _hub); span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + return sentryDatabase; } catch (exception) { span?.throwable = exception; span?.status = SpanStatus.internalError(); - + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); rethrow; } finally { await span?.finish(); + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); } }); } diff --git a/sqflite/lib/src/sentry_sqflite_transaction.dart b/sqflite/lib/src/sentry_sqflite_transaction.dart index c207023e9c..78c41b487d 100644 --- a/sqflite/lib/src/sentry_sqflite_transaction.dart +++ b/sqflite/lib/src/sentry_sqflite_transaction.dart @@ -21,16 +21,19 @@ import 'sentry_batch.dart'; class SentrySqfliteTransaction extends Transaction implements DatabaseExecutor { final DatabaseExecutor _executor; final Hub _hub; + final String? _dbName; // ignore: public_member_api_docs @internal SentrySqfliteTransaction( this._executor, { @internal Hub? hub, - }) : _hub = hub ?? HubAdapter(); + @internal String? dbName, + }) : _hub = hub ?? HubAdapter(), + _dbName = dbName; @override - Batch batch() => SentryBatch(_executor.batch(), hub: _hub); + Batch batch() => SentryBatch(_executor.batch(), hub: _hub, dbName: _dbName); @override Database get database => _executor.database; diff --git a/sqflite/lib/src/utils/sentry_database_span_attributes.dart b/sqflite/lib/src/utils/sentry_database_span_attributes.dart new file mode 100644 index 0000000000..347c750ee8 --- /dev/null +++ b/sqflite/lib/src/utils/sentry_database_span_attributes.dart @@ -0,0 +1,21 @@ +import 'package:sentry/sentry.dart'; + +import '../../sentry_sqflite.dart'; + +/// Sets the database attributes on the [span]. +/// It contains the database system and the database name. +void setDatabaseAttributeData(ISentrySpan? span, String? dbName) { + span?.setData(SentryDatabase.dbSystemKey, SentryDatabase.dbSystem); + if (dbName != null) { + span?.setData(SentryDatabase.dbNameKey, dbName); + } +} + +/// Sets the database attributes on the [breadcrumb]. +/// It contains the database system and the database name. +void setDatabaseAttributeOnBreadcrumb(Breadcrumb breadcrumb, String? dbName) { + breadcrumb.data?[SentryDatabase.dbSystemKey] = SentryDatabase.dbSystem; + if (dbName != null) { + breadcrumb.data?[SentryDatabase.dbNameKey] = dbName; + } +} diff --git a/sqflite/lib/src/version.dart b/sqflite/lib/src/version.dart index 67be6e3068..6982ffcf1f 100644 --- a/sqflite/lib/src/version.dart +++ b/sqflite/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.9.0'; +const String sdkVersion = '7.16.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_sqflite'; diff --git a/sqflite/pubspec.yaml b/sqflite/pubspec.yaml index db60eec2a5..4fae66faf9 100644 --- a/sqflite/pubspec.yaml +++ b/sqflite/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_sqflite description: An integration which adds support for performance tracing for the sqflite package. -version: 7.9.0 +version: 7.16.0 homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -10,13 +10,14 @@ environment: flutter: '>=3.3.0' # matching sqflite dependencies: - sentry: 7.9.0 + sentry: 7.16.0 sqflite: ^2.0.0 sqflite_common: ^2.0.0 meta: ^1.3.0 + path: ^1.8.3 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 flutter_test: sdk: flutter coverage: ^1.3.0 diff --git a/sqflite/test/mocks/mocks.mocks.dart b/sqflite/test/mocks/mocks.mocks.dart index 582663e5f9..6c4c5e362e 100644 --- a/sqflite/test/mocks/mocks.mocks.dart +++ b/sqflite/test/mocks/mocks.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.0 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in sentry_sqflite/test/mocks/mocks.dart. // Do not manually edit this file. @@ -6,12 +6,13 @@ import 'dart:async' as _i4; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i7; import 'package:sentry/sentry.dart' as _i2; import 'package:sentry/src/sentry_tracer.dart' as _i5; import 'package:sqflite_common/sql.dart' as _i6; import 'package:sqflite_common/sqlite_api.dart' as _i3; -import 'mocks.dart' as _i7; +import 'mocks.dart' as _i8; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -76,7 +77,7 @@ class _FakeDatabase_4 extends _i1.SmartFake implements _i3.Database { ); } -class _FakeFuture_5 extends _i1.SmartFake implements _i4.Future { +class _FakeFuture_5 extends _i1.SmartFake implements _i4.Future { _FakeFuture_5( Object parent, Invocation parentInvocation, @@ -126,8 +127,18 @@ class _FakeSentryId_9 extends _i1.SmartFake implements _i2.SentryId { ); } -class _FakeHub_10 extends _i1.SmartFake implements _i2.Hub { - _FakeHub_10( +class _FakeScope_10 extends _i1.SmartFake implements _i2.Scope { + _FakeScope_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeHub_11 extends _i1.SmartFake implements _i2.Hub { + _FakeHub_11( Object parent, Invocation parentInvocation, ) : super( @@ -666,14 +677,25 @@ class MockDatabase extends _i1.Mock implements _i3.Database { [action], {#exclusive: exclusive}, ), - returnValue: _FakeFuture_5( - this, - Invocation.method( - #transaction, - [action], - {#exclusive: exclusive}, - ), - ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #transaction, + [action], + {#exclusive: exclusive}, + ), + ), + (T v) => _i4.Future.value(v), + ) ?? + _FakeFuture_5( + this, + Invocation.method( + #transaction, + [action], + {#exclusive: exclusive}, + ), + ), ) as _i4.Future); @override _i4.Future devInvokeMethod( @@ -688,16 +710,29 @@ class MockDatabase extends _i1.Mock implements _i3.Database { arguments, ], ), - returnValue: _FakeFuture_5( - this, - Invocation.method( - #devInvokeMethod, - [ - method, - arguments, - ], - ), - ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #devInvokeMethod, + [ + method, + arguments, + ], + ), + ), + (T v) => _i4.Future.value(v), + ) ?? + _FakeFuture_5( + this, + Invocation.method( + #devInvokeMethod, + [ + method, + arguments, + ], + ), + ), ) as _i4.Future); @override _i4.Future devInvokeSqlMethod( @@ -714,17 +749,31 @@ class MockDatabase extends _i1.Mock implements _i3.Database { arguments, ], ), - returnValue: _FakeFuture_5( - this, - Invocation.method( - #devInvokeSqlMethod, - [ - method, - sql, - arguments, - ], - ), - ), + returnValue: _i7.ifNotNull( + _i7.dummyValueOrNull( + this, + Invocation.method( + #devInvokeSqlMethod, + [ + method, + sql, + arguments, + ], + ), + ), + (T v) => _i4.Future.value(v), + ) ?? + _FakeFuture_5( + this, + Invocation.method( + #devInvokeSqlMethod, + [ + method, + sql, + arguments, + ], + ), + ), ) as _i4.Future); @override _i4.Future execute( @@ -1300,6 +1349,14 @@ class MockHub extends _i1.Mock implements _i2.Hub { ), ) as _i2.SentryId); @override + _i2.Scope get scope => (super.noSuchMethod( + Invocation.getter(#scope), + returnValue: _FakeScope_10( + this, + Invocation.getter(#scope), + ), + ) as _i2.Scope); + @override _i4.Future<_i2.SentryId> captureEvent( _i2.SentryEvent? event, { dynamic stackTrace, @@ -1433,7 +1490,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { #clone, [], ), - returnValue: _FakeHub_10( + returnValue: _FakeHub_11( this, Invocation.method( #clone, @@ -1487,7 +1544,7 @@ class MockHub extends _i1.Mock implements _i2.Hub { #customSamplingContext: customSamplingContext, }, ), - returnValue: _i7.startTransactionShim( + returnValue: _i8.startTransactionShim( name, operation, description: description, diff --git a/sqflite/test/sentry_batch_test.dart b/sqflite/test/sentry_batch_test.dart index e01aa4d5c7..b9c53b8762 100644 --- a/sqflite/test/sentry_batch_test.dart +++ b/sqflite/test/sentry_batch_test.dart @@ -22,6 +22,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); // using ffi for testing on vm @@ -63,6 +64,9 @@ void main() { // ignore: invalid_use_of_internal_member expect(span.origin, SentryTraceOrigins.autoDbSqfliteBatch); + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect(breadcrumb.data?['status'], 'ok'); + await db.close(); }); @@ -79,6 +83,9 @@ void main() { // ignore: invalid_use_of_internal_member expect(span.origin, SentryTraceOrigins.autoDbSqfliteBatch); + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect(breadcrumb.data?['status'], 'ok'); + await db.close(); }); @@ -102,6 +109,24 @@ void main() { await db.close(); }); + test('creates insert breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'INSERT INTO Product (title) VALUES (?)', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw insert span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -122,6 +147,24 @@ void main() { await db.close(); }); + test('creates raw insert breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.rawInsert('INSERT INTO Product (title) VALUES (?)', ['Product 1']); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'INSERT INTO Product (title) VALUES (?)', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates update span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -139,6 +182,24 @@ void main() { await db.close(); }); + test('creates update breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.update('Product', {'title': 'Product 1'}); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'UPDATE Product SET title = ?', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw update span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -156,6 +217,24 @@ void main() { await db.close(); }); + test('creates raw update breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.rawUpdate('UPDATE Product SET title = ?', ['Product 1']); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'UPDATE Product SET title = ?', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates delete span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -173,6 +252,24 @@ void main() { await db.close(); }); + test('creates delete breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.delete('Product'); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'DELETE FROM Product', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw delete span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -190,6 +287,24 @@ void main() { await db.close(); }); + test('creates raw delete breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.rawDelete('DELETE FROM Product'); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'DELETE FROM Product', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates execute span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -207,6 +322,24 @@ void main() { await db.close(); }); + test('creates execute breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.execute('DELETE FROM Product'); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'DELETE FROM Product', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates query span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -224,6 +357,24 @@ void main() { await db.close(); }); + test('creates query breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.query('Product'); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'SELECT * FROM Product', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw query span', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -241,6 +392,24 @@ void main() { await db.close(); }); + test('creates raw query breadcrumb', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.rawQuery('SELECT * FROM Product'); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.message, + 'SELECT * FROM Product', + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates span with batch description', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -263,6 +432,25 @@ SELECT * FROM Product'''; await db.close(); }); + test('creates breadcrumb with batch description', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + batch.query('Product'); + + await batch.commit(); + + final desc = '''INSERT INTO Product (title) VALUES (?) +SELECT * FROM Product'''; + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect(breadcrumb.message, desc); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates span with batch description using apply', () async { final db = await fixture.getDatabase(); final batch = db.batch(); @@ -285,6 +473,118 @@ SELECT * FROM Product'''; await db.close(); }); + test('creates breadcrumb with batch description using apply', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + batch.query('Product'); + + await batch.apply(); + + final desc = '''INSERT INTO Product (title) VALUES (?) +SELECT * FROM Product'''; + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect(breadcrumb.message, desc); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + + test('apply creates db span with dbSystem and dbName attributes', () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + + await batch.apply(); + + final span = fixture.tracer.children.last; + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect( + span.data[SentryDatabase.dbNameKey], + (db as SentryDatabase).dbName, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect( + breadcrumb.data?[SentryDatabase.dbNameKey], + db.dbName, + ); + + await db.close(); + }); + + test('apply creates a breadcrumb with dbSystem and dbName attributes', + () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + + await batch.apply(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect( + breadcrumb.data?[SentryDatabase.dbNameKey], + (db as SentryDatabase).dbName, + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + + test('commit creates db span with dbSystem and dbName attributes', + () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + + await batch.commit(); + + final span = fixture.tracer.children.last; + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect( + span.data[SentryDatabase.dbNameKey], + (db as SentryDatabase).dbName, + ); + + await db.close(); + }); + + test('commit creates breadcrumb with dbSystem and dbName attributes', + () async { + final db = await fixture.getDatabase(); + final batch = db.batch(); + + batch.insert('Product', {'title': 'Product 1'}); + + await batch.commit(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect( + breadcrumb.data?[SentryDatabase.dbNameKey], + (db as SentryDatabase).dbName, + ); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + tearDown(() { databaseFactory = sqfliteDatabaseFactoryDefault; }); @@ -297,6 +597,7 @@ SELECT * FROM Product'''; fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); }); @@ -316,6 +617,21 @@ SELECT * FROM Product'''; expect(span.origin, SentryTraceOrigins.autoDbSqfliteBatch); }); + test('commit sets batch to internal error if its thrown', () async { + final batch = SentryBatch(fixture.batch, hub: fixture.hub); + + when(fixture.batch.commit()).thenThrow(fixture.exception); + + batch.insert('Product', {'title': 'Product 1'}); + + await expectLater(() async => await batch.commit(), throwsException); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + test('apply sets span to internal error if its thrown', () async { final batch = SentryBatch(fixture.batch, hub: fixture.hub); @@ -331,6 +647,21 @@ SELECT * FROM Product'''; // ignore: invalid_use_of_internal_member expect(span.origin, SentryTraceOrigins.autoDbSqfliteBatch); }); + + test('apply sets breadcrumb to internal error if its thrown', () async { + final batch = SentryBatch(fixture.batch, hub: fixture.hub); + + when(fixture.batch.apply()).thenThrow(fixture.exception); + + batch.insert('Product', {'title': 'Product 1'}); + + await expectLater(() async => await batch.apply(), throwsException); + + final breadcrumb = fixture.hub.scope.breadcrumbs.last; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); }); } @@ -341,6 +672,7 @@ class Fixture { late final tracer = SentryTracer(_context, hub); final batch = MockBatch(); final exception = Exception('error'); + late final scope = Scope(options); Future getDatabase({ double? tracesSampleRate = 1.0, diff --git a/sqflite/test/sentry_database_test.dart b/sqflite/test/sentry_database_test.dart index 3a76d8066e..492da311df 100644 --- a/sqflite/test/sentry_database_test.dart +++ b/sqflite/test/sentry_database_test.dart @@ -26,6 +26,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); // using ffi for testing on vm @@ -74,6 +75,17 @@ void main() { ); }); + test('creates close breadcrumb', () async { + final db = await fixture.getSut(); + + await db.close(); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.message, 'Close DB: $inMemoryDatabasePath'); + expect(breadcrumb.category, SentryDatabase.dbOp); + expect(breadcrumb.type, 'query'); + }); + test('creates transaction span', () async { final db = await fixture.getSut(); @@ -84,6 +96,8 @@ void main() { expect(span.context.operation, 'db.sql.transaction'); expect(span.context.description, 'Transaction DB: $inMemoryDatabasePath'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, // ignore: invalid_use_of_internal_member @@ -93,6 +107,69 @@ void main() { await db.close(); }); + test('creates readTransaction span', () async { + final db = await fixture.getSut(); + + await db.readTransaction((txn) async { + expect(txn is SentrySqfliteTransaction, true); + }); + final span = fixture.tracer.children.last; + expect(span.context.operation, 'db.sql.read_transaction'); + expect(span.context.description, 'Transaction DB: $inMemoryDatabasePath'); + expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect( + span.origin, + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbSqfliteDatabase, + ); + + await db.close(); + }); + + test('creates transaction breadcrumb', () async { + final db = await fixture.getSut(); + + await db.transaction((txn) async { + expect(txn is SentrySqfliteTransaction, true); + }); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.message, 'Transaction DB: $inMemoryDatabasePath'); + expect(breadcrumb.category, 'db.sql.transaction'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + + test('creates readTransaction breadcrumb', () async { + final db = await fixture.getSut(); + + await db.readTransaction((txn) async { + expect(txn is SentrySqfliteTransaction, true); + }); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.message, 'Transaction DB: $inMemoryDatabasePath'); + expect(breadcrumb.category, 'db.sql.read_transaction'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates transaction children run by the transaction', () async { final db = await fixture.getSut(); @@ -109,6 +186,11 @@ void main() { ); expect(insertSpan.context.parentSpanId, trSpan.context.spanId); expect(insertSpan.status, SpanStatus.ok()); + expect( + insertSpan.data[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(insertSpan.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( insertSpan.origin, @@ -130,6 +212,34 @@ void main() { await db.close(); }); + test('opening db sets currentDbName with :memory:', () async { + final db = await fixture.getSut(); + + expect(db.dbName, ':memory:'); + + await db.close(); + }); + + test('opening db sets currentDbName with db file without extension', + () async { + final db = await fixture.getSut( + database: await openDatabase('path/database/mydatabase.db'), + execute: false, + ); + + expect(db.dbName, 'mydatabase'); + + await db.close(); + }); + + test('closing db sets currentDbName to null', () async { + final db = await fixture.getSut(); + + expect(db.dbName, inMemoryDatabasePath); + + await db.close(); + }); + tearDown(() { databaseFactory = sqfliteDatabaseFactoryDefault; }); @@ -142,6 +252,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); when(fixture.database.path).thenReturn('/path/db'); @@ -166,6 +277,19 @@ void main() { ); }); + test('close sets breadcrumb to internal error', () async { + when(fixture.database.close()).thenThrow(fixture.exception); + + final db = await fixture.getSut(database: fixture.database); + + await expectLater(() async => await db.close(), throwsException); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + test('transaction sets span to internal error', () async { // ignore: inference_failure_on_function_invocation when(fixture.database.transaction(any)).thenThrow(fixture.exception); @@ -187,6 +311,23 @@ void main() { SentryTraceOrigins.autoDbSqfliteDatabase, ); }); + + test('transaction sets breadcrumb to internal error', () async { + // ignore: inference_failure_on_function_invocation + when(fixture.database.transaction(any)).thenThrow(fixture.exception); + + final db = await fixture.getSut(database: fixture.database); + + await expectLater( + () async => await db.transaction((txn) async {}), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); }); group('$SentryDatabaseExecutor success', () { @@ -196,6 +337,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); // using ffi for testing on vm @@ -212,6 +354,8 @@ void main() { expect(span.context.operation, 'db.sql.execute'); expect(span.context.description, 'DELETE FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -222,6 +366,25 @@ void main() { await db.close(); }); + test('creates delete breadcrumb', () async { + final db = await fixture.getSut(); + + await db.delete('Product'); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect(breadcrumb.message, 'DELETE FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates execute span', () async { final db = await fixture.getSut(); @@ -231,6 +394,8 @@ void main() { expect(span.context.operation, 'db.sql.execute'); expect(span.context.description, 'DELETE FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -241,6 +406,25 @@ void main() { await db.close(); }); + test('creates execute breadcrumb', () async { + final db = await fixture.getSut(); + + await db.execute('DELETE FROM Product'); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect(breadcrumb.message, 'DELETE FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates insert span', () async { final db = await fixture.getSut(); @@ -253,6 +437,8 @@ void main() { 'INSERT INTO Product (title) VALUES (?)', ); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -263,6 +449,28 @@ void main() { await db.close(); }); + test('creates insert breadcrumb', () async { + final db = await fixture.getSut(); + + await db.insert('Product', {'title': 'Product 1'}); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect( + breadcrumb.message, + 'INSERT INTO Product (title) VALUES (?)', + ); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates query span', () async { final db = await fixture.getSut(); @@ -272,6 +480,8 @@ void main() { expect(span.context.operation, 'db.sql.query'); expect(span.context.description, 'SELECT * FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -282,6 +492,26 @@ void main() { await db.close(); }); + test('creates query breadcrumb', () async { + final db = await fixture.getSut(); + + await db.query('Product'); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.query'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.message, 'SELECT * FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates query cursor span', () async { final db = await fixture.getSut(); @@ -291,6 +521,8 @@ void main() { expect(span.context.operation, 'db.sql.query'); expect(span.context.description, 'SELECT * FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -301,6 +533,26 @@ void main() { await db.close(); }); + test('creates query cursor breadcrumb', () async { + final db = await fixture.getSut(); + + await db.queryCursor('Product'); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.query'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.message, 'SELECT * FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw delete span', () async { final db = await fixture.getSut(); @@ -310,6 +562,8 @@ void main() { expect(span.context.operation, 'db.sql.execute'); expect(span.context.description, 'DELETE FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -320,6 +574,25 @@ void main() { await db.close(); }); + test('creates raw delete breadcrumb', () async { + final db = await fixture.getSut(); + + await db.rawDelete('DELETE FROM Product'); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect(breadcrumb.message, 'DELETE FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw insert span', () async { final db = await fixture.getSut(); @@ -333,6 +606,8 @@ void main() { 'INSERT INTO Product (title) VALUES (?)', ); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -343,6 +618,26 @@ void main() { await db.close(); }); + test('creates raw insert breadcrumb', () async { + final db = await fixture.getSut(); + + await db + .rawInsert('INSERT INTO Product (title) VALUES (?)', ['Product 1']); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect(breadcrumb.message, 'INSERT INTO Product (title) VALUES (?)'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw query span', () async { final db = await fixture.getSut(); @@ -352,6 +647,8 @@ void main() { expect(span.context.operation, 'db.sql.query'); expect(span.context.description, 'SELECT * FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -362,6 +659,26 @@ void main() { await db.close(); }); + test('creates raw query breadcrumb', () async { + final db = await fixture.getSut(); + + await db.rawQuery('SELECT * FROM Product'); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.query'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.message, 'SELECT * FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw query cursor span', () async { final db = await fixture.getSut(); @@ -371,6 +688,8 @@ void main() { expect(span.context.operation, 'db.sql.query'); expect(span.context.description, 'SELECT * FROM Product'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -381,6 +700,26 @@ void main() { await db.close(); }); + test('creates raw query cursor breadcrumb', () async { + final db = await fixture.getSut(); + + await db.rawQueryCursor('SELECT * FROM Product', []); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.query'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.message, 'SELECT * FROM Product'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates raw update span', () async { final db = await fixture.getSut(); @@ -390,6 +729,8 @@ void main() { expect(span.context.operation, 'db.sql.execute'); expect(span.context.description, 'UPDATE Product SET title = ?'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -400,6 +741,25 @@ void main() { await db.close(); }); + test('creates raw update breadcrumb', () async { + final db = await fixture.getSut(); + + await db.rawUpdate('UPDATE Product SET title = ?', ['Product 1']); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect(breadcrumb.message, 'UPDATE Product SET title = ?'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates update span', () async { final db = await fixture.getSut(); @@ -409,6 +769,8 @@ void main() { expect(span.context.operation, 'db.sql.execute'); expect(span.context.description, 'UPDATE Product SET title = ?'); expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); expect( span.origin, @@ -419,6 +781,25 @@ void main() { await db.close(); }); + test('creates update breadcrumb', () async { + final db = await fixture.getSut(); + + await db.update('Product', {'title': 'Product 1'}); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db.sql.execute'); + expect(breadcrumb.message, 'UPDATE Product SET title = ?'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + tearDown(() { databaseFactory = sqfliteDatabaseFactoryDefault; }); @@ -431,6 +812,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); }); @@ -667,6 +1049,185 @@ void main() { SentryTraceOrigins.autoDbSqfliteDatabaseExecutor, ); }); + + test('delete sets breadcrumb to internal error', () async { + when(fixture.executor.delete(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.delete('Product'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('execute sets breadcrumb to internal error', () async { + when(fixture.executor.execute(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.execute('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('insert sets breadcrumb to internal error', () async { + when(fixture.executor.insert(any, any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor + .insert('Product', {'title': 'Product 1'}), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('query sets breadcrumb to internal error', () async { + when(fixture.executor.query(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.query('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('query cursor sets breadcrumb to internal error', () async { + when(fixture.executor.queryCursor(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.queryCursor('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('raw delete sets breadcrumb to internal error', () async { + when(fixture.executor.rawDelete(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.rawDelete('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('raw insert sets breadcrumb to internal error', () async { + when(fixture.executor.rawInsert(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.rawInsert('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('raw query sets breadcrumb to internal error', () async { + when(fixture.executor.rawQuery(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.rawQuery('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('raw query cursor sets breadcrumb to internal error', () async { + when(fixture.executor.rawQueryCursor(any, any)) + .thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.rawQueryCursor('sql', []), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('raw update sets breadcrumb to internal error', () async { + when(fixture.executor.rawUpdate(any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor.rawUpdate('sql'), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); + + test('update sets breadcrumb to internal error', () async { + when(fixture.executor.update(any, any)).thenThrow(fixture.exception); + + final executor = fixture.getExecutorSut(); + + await expectLater( + () async => await executor + .update('Product', {'title': 'Product 1'}), + throwsException, + ); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.data?['status'], 'internal_error'); + expect(breadcrumb.type, 'query'); + expect(breadcrumb.level, SentryLevel.warning); + }); }); } @@ -678,6 +1239,7 @@ class Fixture { final database = MockDatabase(); final exception = Exception('error'); final executor = MockDatabaseExecutor(); + late final scope = Scope(options); Future getSut({ double? tracesSampleRate = 1.0, diff --git a/sqflite/test/sentry_sqflite_database_factory_dart_test.dart b/sqflite/test/sentry_sqflite_database_factory_dart_test.dart index 61f8aaa9ca..9eeac66734 100644 --- a/sqflite/test/sentry_sqflite_database_factory_dart_test.dart +++ b/sqflite/test/sentry_sqflite_database_factory_dart_test.dart @@ -24,6 +24,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); // using ffi for testing on vm @@ -38,6 +39,7 @@ void main() { final db = await openDatabase(inMemoryDatabasePath); expect(db is SentryDatabase, true); + expect((db as SentryDatabase).dbName, inMemoryDatabasePath); await db.close(); }); @@ -56,10 +58,11 @@ void main() { () async { final db = await openDatabase(inMemoryDatabasePath); + expect((db as SentryDatabase).dbName, inMemoryDatabasePath); + final span = fixture.tracer.children.last; expect(span.context.operation, 'db'); expect(span.context.description, 'Open DB: $inMemoryDatabasePath'); - expect(span.context.description, 'Open DB: $inMemoryDatabasePath'); expect( span.origin, @@ -68,6 +71,20 @@ void main() { ); await db.close(); }); + + test('starts and finishes a open db breadcrumb when performance enabled', + () async { + final db = await openDatabase(inMemoryDatabasePath); + + expect((db as SentryDatabase).dbName, inMemoryDatabasePath); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, 'db'); + expect(breadcrumb.message, 'Open DB: $inMemoryDatabasePath'); + expect(breadcrumb.data?['status'], 'ok'); + + await db.close(); + }); }); tearDown(() { @@ -80,4 +97,5 @@ class Fixture { final options = SentryOptions(dsn: fakeDsn)..tracesSampleRate = 1.0; final _context = SentryTransactionContext('name', 'operation'); late final tracer = SentryTracer(_context, hub); + late final scope = Scope(options); } diff --git a/sqflite/test/sentry_sqflite_test.dart b/sqflite/test/sentry_sqflite_test.dart index 54ff24232d..27851881b0 100644 --- a/sqflite/test/sentry_sqflite_test.dart +++ b/sqflite/test/sentry_sqflite_test.dart @@ -24,6 +24,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); // using ffi for testing on vm @@ -68,6 +69,7 @@ void main() { fixture = Fixture(); when(fixture.hub.options).thenReturn(fixture.options); + when(fixture.hub.scope).thenReturn(fixture.scope); when(fixture.hub.getSpan()).thenReturn(fixture.tracer); // using ffi for testing on vm @@ -97,6 +99,19 @@ void main() { expect(span.status, SpanStatus.ok()); // ignore: invalid_use_of_internal_member expect(span.origin, SentryTraceOrigins.autoDbSqfliteOpenDatabase); + expect((db as SentryDatabase).dbName, inMemoryDatabasePath); + + await db.close(); + }); + + test('creates db open breadcrumb', () async { + final db = + await openDatabaseWithSentry(inMemoryDatabasePath, hub: fixture.hub); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.category, SentryDatabase.dbOp); + expect(breadcrumb.message, 'Open DB: $inMemoryDatabasePath'); + expect(breadcrumb.data?['status'], 'ok'); await db.close(); }); @@ -108,4 +123,5 @@ class Fixture { final options = SentryOptions(dsn: fakeDsn)..tracesSampleRate = 1.0; final _context = SentryTransactionContext('name', 'operation'); late final tracer = SentryTracer(_context, hub); + late final scope = Scope(options); }