diff --git a/.github/check_package.sh b/.github/check_package.sh new file mode 100755 index 000000000..bae2cdb61 --- /dev/null +++ b/.github/check_package.sh @@ -0,0 +1,48 @@ +#/bin/bash + +# NOTE: +# This is a temporary utility script to help mitigate the need for github action +# troubleshooting, and will be deleted either pre-merge or when melos replaces it +# (https://github.com/gql-dart/gql/pull/192) + +set -e + +PACKAGE=$1 + +git diff --exit-code + +clean_up () { + ARG=$? + git checkout . + exit $ARG +} + +trap clean_up EXIT + +# Check pubspec +multipack --only $PACKAGE pubspec clean +multipack --only $PACKAGE exec git diff --exit-code pubspec.yaml + +# Override local dependencies +multipack pubspec hard_override + +multipack --only $PACKAGE pub get + +# Check formatting +echo "" +echo "A list of incorrectly formatted files may follow:" +echo "" +multipack --only $PACKAGE fmt -n . --set-exit-if-changed +echo "" + +# Analyze package +multipack --only $PACKAGE analyze --version +multipack --only $PACKAGE analyze --fatal-warnings --no-hints . + +# Run tests +# mockito requires build runner now +multipack --only $PACKAGE pub run build_runner build --delete-conflicting-outputs || true +multipack --only $PACKAGE exec [ -d ./test ] || exit 0 +multipack --only $PACKAGE pub run test + +git checkout . diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index ac115b2ec..a176f097d 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -4,6 +4,7 @@ on: pull_request jobs: packages: strategy: + fail-fast: false matrix: package: - gql @@ -16,13 +17,11 @@ jobs: - gql_error_link - gql_http_link - gql_websocket_link - - gql_link - gql_transform_link - cats - - gql_example_http_auth_link runs-on: ubuntu-latest container: - image: google/dart:latest + image: google/dart name: Check ${{ matrix.package }} env: PACKAGE: ${{ matrix.package }} @@ -50,24 +49,32 @@ jobs: echo "" multipack --only $PACKAGE fmt -n . --set-exit-if-changed echo "" + - name: Run build_runner if necessary + run: | + multipack --only $PACKAGE pub run \ + build_runner build --delete-conflicting-outputs || true - name: Analyze package run: | multipack --only $PACKAGE analyze --version multipack --only $PACKAGE analyze --fatal-warnings --no-hints . - name: Run tests run: | - multipack --only $PACKAGE exec [ ! -d ./test ] && exit 0 + multipack --only $PACKAGE exec [ -d ./test ] || exit 0 multipack --only $PACKAGE pub run test examples: strategy: + fail-fast: false matrix: package: - gql_example_cli - gql_example_cli_github - gql_example_build + - gql_example_http_auth_link + - gql_example_dio_link + # gql_example_flutter would require flutter runs-on: ubuntu-latest container: - image: google/dart:latest + image: google/dart name: Check ${{ matrix.package }} env: PACKAGE: ${{ matrix.package }} @@ -90,7 +97,8 @@ jobs: multipack --only $PACKAGE pub get - name: Run builders run: | - multipack --only $PACKAGE pub run build_runner build --delete-conflicting-outputs + multipack --only $PACKAGE pub run \ + build_runner build --delete-conflicting-outputs || true - name: Check build diff run: | multipack --only $PACKAGE exec git diff --exit-code **/*.gql.dart @@ -112,7 +120,7 @@ jobs: - end_to_end_test runs-on: ubuntu-latest container: - image: google/dart:latest + image: google/dart name: Check ${{ matrix.package }} env: PACKAGE: ${{ matrix.package }} @@ -152,13 +160,13 @@ jobs: multipack --only $PACKAGE analyze --fatal-warnings --no-hints . - name: Run tests run: | - multipack --only $PACKAGE exec [ ! -d ./test ] && exit 0 + multipack --only $PACKAGE exec [ -d ./test ] || exit 0 multipack --only $PACKAGE pub run test publish_dry_run: runs-on: ubuntu-latest container: - image: google/dart:latest + image: google/dart env: PACKAGES: 'gql,gql_build,gql_code_builder,gql_dedupe_link,gql_dio_link,gql_exec,gql_http_link,gql_link,gql_pedantic,gql_transform_link,gql_error_link,gql_websocket_link' PUB_ACCESS_TOKEN: ${{ secrets.PUB_ACCESS_TOKEN }} @@ -177,13 +185,26 @@ jobs: run: | multipack --only $PACKAGES pubspec sync-versions - name: Publish packages + shell: bash + continue-on-error: true run: | echo "{\"accessToken\":\"$PUB_ACCESS_TOKEN\",\"refreshToken\":\"$PUB_REFRESH_TOKEN\",\"idToken\":null,\"tokenEndpoint\":\"https://accounts.google.com/o/oauth2/token\",\"scopes\":[\"openid\",\"https://www.googleapis.com/auth/userinfo.email\"],\"expiration\":1588334512218}" > $HOME/.pub-cache/credentials.json - multipack --only $PACKAGES pub publish --dry-run + + ## BEGIN TEMPORARY WORKAROUND FOR https://github.com/google/built_value.dart/issues/1032 + ## See dry_run_workaround_helpers.sh for more details + source .github/workflows/dry_run_workaround_helpers.sh + + multipack --only $PACKAGES exec 'pub publish --dry-run 2>&1' | cap + + ignore_err_when_stdout_contains \ + 'Publishing gql_build' \ + 'Package has 1 warning' \ + 'package:built_value_generator/built_value_generator.dart is opting out of null safety' \ + check_svg: runs-on: ubuntu-latest container: - image: google/dart:latest + image: google/dart steps: - name: Clone repository uses: actions/checkout@v2 diff --git a/.github/workflows/dry_run_workaround_helpers.sh b/.github/workflows/dry_run_workaround_helpers.sh new file mode 100644 index 000000000..605ba9d95 --- /dev/null +++ b/.github/workflows/dry_run_workaround_helpers.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +## +## TEMPORARY WORKAROUND HELPERS FOR https://github.com/google/built_value.dart/issues/1032 +## +## once built_value_generator is implemented nullsafe this can be deleted +## and the workflow can be reset to just: +## `multipack --only $PACKAGES pub publish --dry-run` +## + +# capture the output of a command so it can be retrieved with ret +cap () { tee /tmp/capture.out; } + +# return the output of the most recent command that was captured by cap +ret () { cat /tmp/capture.out; } + +# ignore err when stdout contains all of the given strings +ignore_err_when_stdout_contains() { + code=$? + if [[ "$code" == "0" ]]; then + return 0 + fi + output=`ret` + for search in $@ + do + if [[ "$output" != *"$search"* ]]; then + return $code + fi + done +} + diff --git a/.gitignore b/.gitignore index bc6ef7116..da9d8101e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ doc/api/ .vscode/ **/*.iml + +**/test/**/*.mocks.dart diff --git a/cats/lib/src/cat_builder.dart b/cats/lib/src/cat_builder.dart index 221b2d161..93a43d82e 100644 --- a/cats/lib/src/cat_builder.dart +++ b/cats/lib/src/cat_builder.dart @@ -67,7 +67,7 @@ class CatBuilder { ); } - Iterable buildTests(YamlNode node, Directory folder) { + Iterable? buildTests(YamlNode? node, Directory folder) { if (node is YamlList) { return node.map((n) => buildTest(n, folder)); } @@ -110,7 +110,7 @@ class CatBuilder { ); } - Action buildAction(YamlMap node) { + Action? buildAction(YamlMap node) { if (node.containsKey('parse')) { return ParsingAction(); } @@ -135,7 +135,7 @@ class CatBuilder { return null; } - Iterable buildAssertions(YamlNode node) { + Iterable? buildAssertions(YamlNode? node) { if (node is YamlList) { return node.map((n) => buildAssertion(n)); } @@ -147,17 +147,17 @@ class CatBuilder { return null; } - Assertion buildAssertion(YamlNode node) { + Assertion? buildAssertion(YamlNode? node) { if (node is YamlMap) { if (node.containsKey('passes')) { return PassesAssertion( - passes: node['passes'] as bool, + passes: node['passes'] as bool?, ); } if (node.containsKey('syntax-error')) { return SyntaxErrorAssertion( - syntaxError: node['syntax-error'] as bool, + syntaxError: node['syntax-error'] as bool?, ); } diff --git a/cats/lib/src/cat_model.dart b/cats/lib/src/cat_model.dart index 7331ac13e..5b21f2c2f 100644 --- a/cats/lib/src/cat_model.dart +++ b/cats/lib/src/cat_model.dart @@ -1,7 +1,7 @@ class Suite { - Iterable scenarios; + Iterable? scenarios; - Map errorMapping; + Map? errorMapping; Suite({ this.scenarios, @@ -10,15 +10,15 @@ class Suite { } class Scenario { - String folder; - String file; + String? folder; + String? file; - String name; + String? name; - String schema; - Map testData; + String? schema; + Map? testData; - Iterable tests; + Iterable? tests; Scenario({ this.folder, @@ -31,19 +31,19 @@ class Scenario { } class TestCase { - String name; + String? name; String query; - String schema; - Map testData; + String? schema; + Map? testData; - Action action; + Action? action; - Iterable assertions; + Iterable? assertions; TestCase({ this.name, - this.query, + required this.query, this.schema, this.testData, this.action, @@ -56,16 +56,16 @@ abstract class Action {} class ParsingAction extends Action {} class ValidationAction extends Action { - Iterable validationRules; + Iterable validationRules; ValidationAction(this.validationRules); } class ExecutionAction extends Action { - String operationName; - Map variables; - bool validateQuery; - String testValue; + String? operationName; + Map? variables; + bool? validateQuery; + String? testValue; ExecutionAction({ this.operationName, @@ -78,7 +78,7 @@ class ExecutionAction extends Action { abstract class Assertion {} class PassesAssertion extends Assertion { - bool passes; + bool? passes; PassesAssertion({ this.passes, @@ -86,7 +86,7 @@ class PassesAssertion extends Assertion { } class SyntaxErrorAssertion extends Assertion { - bool syntaxError; + bool? syntaxError; SyntaxErrorAssertion({ this.syntaxError, @@ -94,11 +94,11 @@ class SyntaxErrorAssertion extends Assertion { } class DataAssertion extends Assertion { - Map data; + Map? data; } class ErrorCountAssertion extends Assertion { - int count; + int? count; ErrorCountAssertion({ this.count, @@ -106,9 +106,9 @@ class ErrorCountAssertion extends Assertion { } class ErrorCodeAssertion extends Assertion { - String errorCode; - Map args; - Iterable locations; + String? errorCode; + Map? args; + Iterable? locations; ErrorCodeAssertion({ this.errorCode, @@ -118,38 +118,38 @@ class ErrorCodeAssertion extends Assertion { } class ErrorContainsAssertion extends Assertion { - String error; - Iterable locations; + String? error; + Iterable? locations; } class ErrorRegexAssertion extends Assertion { - String errorRegex; - Iterable locations; + String? errorRegex; + Iterable? locations; } class ExecutionExceptionContainsAssertion extends Assertion { - String exception; + String? exception; } class ExecutionExceptionRegexAssertion extends Assertion { - String errorRegex; + String? errorRegex; } class Location { - int line; - int column; + int? line; + int? column; } class ErrorDefinition { - String message; - String specReference; - String implementationReference; + String? message; + String? specReference; + String? implementationReference; } class DriverError { - String code; - String message; - Location location; + String? code; + String? message; + Location? location; DriverError({ this.code, @@ -159,5 +159,5 @@ class DriverError { } class DriverException { - String message; + String? message; } diff --git a/cats/lib/src/cats_base.dart b/cats/lib/src/cats_base.dart index 3ff2c74e6..70bc111d7 100644 --- a/cats/lib/src/cats_base.dart +++ b/cats/lib/src/cats_base.dart @@ -4,28 +4,28 @@ import './cat_model.dart'; abstract class CatDriver { Doc parse({ - String source, + required String source, }); Iterable validate({ - Doc schema, - Doc query, - Iterable validationRules, + Doc? schema, + Doc? query, + Iterable? validationRules, }); - execute({ - Doc schema, + dynamic execute({ + Doc? schema, dynamic testData, - Doc query, - String operation, - Map variables, + Doc? query, + String? operation, + Map? variables, }); } class CatRunner { - CatBuilder _builder = CatBuilder(); - CatDriver driver; - List whitelist; + final _builder = CatBuilder(); + CatDriver? driver; + List? whitelist; CatRunner({ this.driver, @@ -35,41 +35,41 @@ class CatRunner { void runSuite(String suitePath) { var suite = _builder.buildSuite(suitePath); - suite.scenarios.forEach(_runScenario); + suite.scenarios!.forEach(_runScenario); } void _runScenario(Scenario scenario) { - if (whitelist != null && !whitelist.contains(scenario.file)) return; + if (whitelist != null && !whitelist!.contains(scenario.file)) return; group(scenario.name, () { - scenario.tests.forEach( + scenario.tests!.forEach( (test) => _runTest(test, scenario), ); }); } void _runTest(TestCase testCase, Scenario scenario) { - var passesAssertion = testCase.assertions.firstWhere( + var passesAssertion = testCase.assertions!.firstWhere( (a) => a is PassesAssertion, orElse: () => null, - ) as PassesAssertion; - var syntaxAssertion = testCase.assertions.firstWhere( + ) as PassesAssertion?; + var syntaxAssertion = testCase.assertions!.firstWhere( (a) => a is SyntaxErrorAssertion, orElse: () => null, - ) as SyntaxErrorAssertion; - var errorCountAssertion = testCase.assertions.firstWhere( + ) as SyntaxErrorAssertion?; + var errorCountAssertion = testCase.assertions!.firstWhere( (a) => a is ErrorCountAssertion, orElse: () => null, - ) as ErrorCountAssertion; + ) as ErrorCountAssertion?; var errorCodeAssertions = - testCase.assertions.whereType(); - var errorContainsAssertion = testCase.assertions.firstWhere( + testCase.assertions!.whereType(); + var errorContainsAssertion = testCase.assertions!.firstWhere( (a) => a is ErrorContainsAssertion, orElse: () => null, - ) as ErrorContainsAssertion; - var errorRegexAssertion = testCase.assertions.firstWhere( + ) as ErrorContainsAssertion?; + var errorRegexAssertion = testCase.assertions!.firstWhere( (a) => a is ErrorRegexAssertion, orElse: () => null, - ) as ErrorRegexAssertion; + ) as ErrorRegexAssertion?; group(testCase.name, () { var queryDoc; @@ -85,7 +85,7 @@ class CatRunner { setUp(() { try { - queryDoc = driver.parse( + queryDoc = driver!.parse( source: testCase.query, ); } catch (e) { @@ -97,7 +97,7 @@ class CatRunner { if (schema != null) { try { - schemaDoc = driver.parse( + schemaDoc = driver!.parse( source: schema, ); } catch (e) { @@ -109,7 +109,7 @@ class CatRunner { ? (testCase.action as ValidationAction).validationRules : null; - validationErrors = driver.validate( + validationErrors = driver!.validate( schema: schemaDoc, query: queryDoc, validationRules: validationRules, @@ -121,12 +121,12 @@ class CatRunner { var testData = (testCase.testData ?? scenario.testData); try { - executionResult = driver.execute( + executionResult = driver!.execute( query: queryDoc, schema: schemaDoc, testData: testData != null && testData.containsKey(action.testValue) - ? testData[action.testValue] + ? testData[action.testValue!] : testData, operation: action.operationName, variables: action.variables, @@ -144,14 +144,14 @@ class CatRunner { expect(queryParsingError, isNull); }); } else { - if ((passesAssertion == null || passesAssertion.passes) && - !(syntaxAssertion != null && syntaxAssertion.syntaxError)) { + if ((passesAssertion == null || passesAssertion.passes!) && + !(syntaxAssertion != null && syntaxAssertion.syntaxError!)) { test('parses successfuly', () { expect(queryDoc, isNotNull); expect(queryParsingError, isNull); }); } - if (syntaxAssertion != null && syntaxAssertion.syntaxError) { + if (syntaxAssertion != null && syntaxAssertion.syntaxError!) { test('throws syntax error', () { expect(queryDoc, isNull); expect(queryParsingError, isNotNull); diff --git a/cats/pubspec.yaml b/cats/pubspec.yaml index 4fab83eec..5517b2267 100644 --- a/cats/pubspec.yaml +++ b/cats/pubspec.yaml @@ -2,9 +2,9 @@ name: cats description: A starting point for Dart libraries or applications. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - test: ^1.6.0 + test: ^1.16.0 dev_dependencies: - pedantic: ^1.7.0 - yaml: ^2.1.16 + pedantic: ^1.10.0 + yaml: ^3.0.0 diff --git a/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.dart b/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.dart index a5498c498..63cf1920d 100644 --- a/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.dart +++ b/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.dart @@ -19,15 +19,14 @@ abstract class GAliasedHeroData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GAliasedHeroData_empireHero get empireHero; - @nullable - GAliasedHeroData_jediHero get jediHero; + GAliasedHeroData_empireHero? get empireHero; + GAliasedHeroData_jediHero? get jediHero; static Serializer get serializer => _$gAliasedHeroDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GAliasedHeroData.serializer, this); - static GAliasedHeroData fromJson(Map json) => + (_i1.serializers.serializeWith(GAliasedHeroData.serializer, this) + as Map); + static GAliasedHeroData? fromJson(Map json) => _i1.serializers.deserializeWith(GAliasedHeroData.serializer, json); } @@ -46,13 +45,12 @@ abstract class GAliasedHeroData_empireHero String get G__typename; String get id; String get name; - @nullable BuiltList<_i2.GEpisode> get from; static Serializer get serializer => _$gAliasedHeroDataEmpireHeroSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAliasedHeroData_empireHero.serializer, this); - static GAliasedHeroData_empireHero fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GAliasedHeroData_empireHero.serializer, this) as Map); + static GAliasedHeroData_empireHero? fromJson(Map json) => _i1.serializers .deserializeWith(GAliasedHeroData_empireHero.serializer, json); } @@ -72,13 +70,13 @@ abstract class GAliasedHeroData_jediHero String get G__typename; String get id; String get name; - @nullable BuiltList<_i2.GEpisode> get from; static Serializer get serializer => _$gAliasedHeroDataJediHeroSerializer; Map toJson() => - _i1.serializers.serializeWith(GAliasedHeroData_jediHero.serializer, this); - static GAliasedHeroData_jediHero fromJson(Map json) => + (_i1.serializers.serializeWith(GAliasedHeroData_jediHero.serializer, this) + as Map); + static GAliasedHeroData_jediHero? fromJson(Map json) => _i1.serializers .deserializeWith(GAliasedHeroData_jediHero.serializer, json); } diff --git a/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.g.dart b/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.g.dart index af322edd9..7296171a1 100644 --- a/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/aliases/aliased_hero.data.gql.g.dart @@ -21,23 +21,26 @@ class _$GAliasedHeroDataSerializer final String wireName = 'GAliasedHeroData'; @override - Iterable serialize(Serializers serializers, GAliasedHeroData object, + Iterable serialize(Serializers serializers, GAliasedHeroData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.empireHero != null) { + Object? value; + value = object.empireHero; + if (value != null) { result ..add('empireHero') - ..add(serializers.serialize(object.empireHero, + ..add(serializers.serialize(value, specifiedType: const FullType(GAliasedHeroData_empireHero))); } - if (object.jediHero != null) { + value = object.jediHero; + if (value != null) { result ..add('jediHero') - ..add(serializers.serialize(object.jediHero, + ..add(serializers.serialize(value, specifiedType: const FullType(GAliasedHeroData_jediHero))); } return result; @@ -45,7 +48,7 @@ class _$GAliasedHeroDataSerializer @override GAliasedHeroData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAliasedHeroDataBuilder(); @@ -53,7 +56,7 @@ class _$GAliasedHeroDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -61,12 +64,12 @@ class _$GAliasedHeroDataSerializer break; case 'empireHero': result.empireHero.replace(serializers.deserialize(value, - specifiedType: const FullType(GAliasedHeroData_empireHero)) + specifiedType: const FullType(GAliasedHeroData_empireHero))! as GAliasedHeroData_empireHero); break; case 'jediHero': result.jediHero.replace(serializers.deserialize(value, - specifiedType: const FullType(GAliasedHeroData_jediHero)) + specifiedType: const FullType(GAliasedHeroData_jediHero))! as GAliasedHeroData_jediHero); break; } @@ -87,10 +90,10 @@ class _$GAliasedHeroData_empireHeroSerializer final String wireName = 'GAliasedHeroData_empireHero'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAliasedHeroData_empireHero object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -98,20 +101,18 @@ class _$GAliasedHeroData_empireHeroSerializer serializers.serialize(object.id, specifiedType: const FullType(String)), 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), + 'from', + serializers.serialize(object.from, + specifiedType: + const FullType(BuiltList, const [const FullType(_i2.GEpisode)])), ]; - if (object.from != null) { - result - ..add('from') - ..add(serializers.serialize(object.from, - specifiedType: const FullType( - BuiltList, const [const FullType(_i2.GEpisode)]))); - } + return result; } @override GAliasedHeroData_empireHero deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAliasedHeroData_empireHeroBuilder(); @@ -119,7 +120,7 @@ class _$GAliasedHeroData_empireHeroSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -136,7 +137,7 @@ class _$GAliasedHeroData_empireHeroSerializer case 'from': result.from.replace(serializers.deserialize(value, specifiedType: const FullType( - BuiltList, const [const FullType(_i2.GEpisode)])) + BuiltList, const [const FullType(_i2.GEpisode)]))! as BuiltList); break; } @@ -157,10 +158,10 @@ class _$GAliasedHeroData_jediHeroSerializer final String wireName = 'GAliasedHeroData_jediHero'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAliasedHeroData_jediHero object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -168,20 +169,18 @@ class _$GAliasedHeroData_jediHeroSerializer serializers.serialize(object.id, specifiedType: const FullType(String)), 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), + 'from', + serializers.serialize(object.from, + specifiedType: + const FullType(BuiltList, const [const FullType(_i2.GEpisode)])), ]; - if (object.from != null) { - result - ..add('from') - ..add(serializers.serialize(object.from, - specifiedType: const FullType( - BuiltList, const [const FullType(_i2.GEpisode)]))); - } + return result; } @override GAliasedHeroData_jediHero deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAliasedHeroData_jediHeroBuilder(); @@ -189,7 +188,7 @@ class _$GAliasedHeroData_jediHeroSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -206,7 +205,7 @@ class _$GAliasedHeroData_jediHeroSerializer case 'from': result.from.replace(serializers.deserialize(value, specifiedType: const FullType( - BuiltList, const [const FullType(_i2.GEpisode)])) + BuiltList, const [const FullType(_i2.GEpisode)]))! as BuiltList); break; } @@ -220,19 +219,19 @@ class _$GAliasedHeroData extends GAliasedHeroData { @override final String G__typename; @override - final GAliasedHeroData_empireHero empireHero; + final GAliasedHeroData_empireHero? empireHero; @override - final GAliasedHeroData_jediHero jediHero; + final GAliasedHeroData_jediHero? jediHero; factory _$GAliasedHeroData( - [void Function(GAliasedHeroDataBuilder) updates]) => + [void Function(GAliasedHeroDataBuilder)? updates]) => (new GAliasedHeroDataBuilder()..update(updates)).build(); - _$GAliasedHeroData._({this.G__typename, this.empireHero, this.jediHero}) + _$GAliasedHeroData._( + {required this.G__typename, this.empireHero, this.jediHero}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GAliasedHeroData', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAliasedHeroData', 'G__typename'); } @override @@ -270,22 +269,22 @@ class _$GAliasedHeroData extends GAliasedHeroData { class GAliasedHeroDataBuilder implements Builder { - _$GAliasedHeroData _$v; + _$GAliasedHeroData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GAliasedHeroData_empireHeroBuilder _empireHero; + GAliasedHeroData_empireHeroBuilder? _empireHero; GAliasedHeroData_empireHeroBuilder get empireHero => _$this._empireHero ??= new GAliasedHeroData_empireHeroBuilder(); - set empireHero(GAliasedHeroData_empireHeroBuilder empireHero) => + set empireHero(GAliasedHeroData_empireHeroBuilder? empireHero) => _$this._empireHero = empireHero; - GAliasedHeroData_jediHeroBuilder _jediHero; + GAliasedHeroData_jediHeroBuilder? _jediHero; GAliasedHeroData_jediHeroBuilder get jediHero => _$this._jediHero ??= new GAliasedHeroData_jediHeroBuilder(); - set jediHero(GAliasedHeroData_jediHeroBuilder jediHero) => + set jediHero(GAliasedHeroData_jediHeroBuilder? jediHero) => _$this._jediHero = jediHero; GAliasedHeroDataBuilder() { @@ -293,10 +292,11 @@ class GAliasedHeroDataBuilder } GAliasedHeroDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _empireHero = _$v.empireHero?.toBuilder(); - _jediHero = _$v.jediHero?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _empireHero = $v.empireHero?.toBuilder(); + _jediHero = $v.jediHero?.toBuilder(); _$v = null; } return this; @@ -304,14 +304,12 @@ class GAliasedHeroDataBuilder @override void replace(GAliasedHeroData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAliasedHeroData; } @override - void update(void Function(GAliasedHeroDataBuilder) updates) { + void update(void Function(GAliasedHeroDataBuilder)? updates) { if (updates != null) updates(this); } @@ -321,11 +319,12 @@ class GAliasedHeroDataBuilder try { _$result = _$v ?? new _$GAliasedHeroData._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAliasedHeroData', 'G__typename'), empireHero: _empireHero?.build(), jediHero: _jediHero?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'empireHero'; _empireHero?.build(); @@ -353,22 +352,23 @@ class _$GAliasedHeroData_empireHero extends GAliasedHeroData_empireHero { final BuiltList<_i2.GEpisode> from; factory _$GAliasedHeroData_empireHero( - [void Function(GAliasedHeroData_empireHeroBuilder) updates]) => + [void Function(GAliasedHeroData_empireHeroBuilder)? updates]) => (new GAliasedHeroData_empireHeroBuilder()..update(updates)).build(); _$GAliasedHeroData_empireHero._( - {this.G__typename, this.id, this.name, this.from}) + {required this.G__typename, + required this.id, + required this.name, + required this.from}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GAliasedHeroData_empireHero', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GAliasedHeroData_empireHero', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GAliasedHeroData_empireHero', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAliasedHeroData_empireHero', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, 'GAliasedHeroData_empireHero', 'id'); + BuiltValueNullFieldError.checkNotNull( + name, 'GAliasedHeroData_empireHero', 'name'); + BuiltValueNullFieldError.checkNotNull( + from, 'GAliasedHeroData_empireHero', 'from'); } @override @@ -412,35 +412,36 @@ class GAliasedHeroData_empireHeroBuilder implements Builder { - _$GAliasedHeroData_empireHero _$v; + _$GAliasedHeroData_empireHero? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - ListBuilder<_i2.GEpisode> _from; + ListBuilder<_i2.GEpisode>? _from; ListBuilder<_i2.GEpisode> get from => _$this._from ??= new ListBuilder<_i2.GEpisode>(); - set from(ListBuilder<_i2.GEpisode> from) => _$this._from = from; + set from(ListBuilder<_i2.GEpisode>? from) => _$this._from = from; GAliasedHeroData_empireHeroBuilder() { GAliasedHeroData_empireHero._initializeBuilder(this); } GAliasedHeroData_empireHeroBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _from = _$v.from?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _from = $v.from.toBuilder(); _$v = null; } return this; @@ -448,14 +449,12 @@ class GAliasedHeroData_empireHeroBuilder @override void replace(GAliasedHeroData_empireHero other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAliasedHeroData_empireHero; } @override - void update(void Function(GAliasedHeroData_empireHeroBuilder) updates) { + void update(void Function(GAliasedHeroData_empireHeroBuilder)? updates) { if (updates != null) updates(this); } @@ -465,15 +464,18 @@ class GAliasedHeroData_empireHeroBuilder try { _$result = _$v ?? new _$GAliasedHeroData_empireHero._( - G__typename: G__typename, - id: id, - name: name, - from: _from?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAliasedHeroData_empireHero', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GAliasedHeroData_empireHero', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GAliasedHeroData_empireHero', 'name'), + from: from.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'from'; - _from?.build(); + from.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GAliasedHeroData_empireHero', _$failedField, e.toString()); @@ -496,22 +498,23 @@ class _$GAliasedHeroData_jediHero extends GAliasedHeroData_jediHero { final BuiltList<_i2.GEpisode> from; factory _$GAliasedHeroData_jediHero( - [void Function(GAliasedHeroData_jediHeroBuilder) updates]) => + [void Function(GAliasedHeroData_jediHeroBuilder)? updates]) => (new GAliasedHeroData_jediHeroBuilder()..update(updates)).build(); _$GAliasedHeroData_jediHero._( - {this.G__typename, this.id, this.name, this.from}) + {required this.G__typename, + required this.id, + required this.name, + required this.from}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GAliasedHeroData_jediHero', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GAliasedHeroData_jediHero', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GAliasedHeroData_jediHero', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAliasedHeroData_jediHero', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, 'GAliasedHeroData_jediHero', 'id'); + BuiltValueNullFieldError.checkNotNull( + name, 'GAliasedHeroData_jediHero', 'name'); + BuiltValueNullFieldError.checkNotNull( + from, 'GAliasedHeroData_jediHero', 'from'); } @override @@ -554,35 +557,36 @@ class _$GAliasedHeroData_jediHero extends GAliasedHeroData_jediHero { class GAliasedHeroData_jediHeroBuilder implements Builder { - _$GAliasedHeroData_jediHero _$v; + _$GAliasedHeroData_jediHero? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - ListBuilder<_i2.GEpisode> _from; + ListBuilder<_i2.GEpisode>? _from; ListBuilder<_i2.GEpisode> get from => _$this._from ??= new ListBuilder<_i2.GEpisode>(); - set from(ListBuilder<_i2.GEpisode> from) => _$this._from = from; + set from(ListBuilder<_i2.GEpisode>? from) => _$this._from = from; GAliasedHeroData_jediHeroBuilder() { GAliasedHeroData_jediHero._initializeBuilder(this); } GAliasedHeroData_jediHeroBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _from = _$v.from?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _from = $v.from.toBuilder(); _$v = null; } return this; @@ -590,14 +594,12 @@ class GAliasedHeroData_jediHeroBuilder @override void replace(GAliasedHeroData_jediHero other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAliasedHeroData_jediHero; } @override - void update(void Function(GAliasedHeroData_jediHeroBuilder) updates) { + void update(void Function(GAliasedHeroData_jediHeroBuilder)? updates) { if (updates != null) updates(this); } @@ -607,15 +609,18 @@ class GAliasedHeroData_jediHeroBuilder try { _$result = _$v ?? new _$GAliasedHeroData_jediHero._( - G__typename: G__typename, - id: id, - name: name, - from: _from?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAliasedHeroData_jediHero', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GAliasedHeroData_jediHero', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GAliasedHeroData_jediHero', 'name'), + from: from.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'from'; - _from?.build(); + from.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GAliasedHeroData_jediHero', _$failedField, e.toString()); diff --git a/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.dart b/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.dart index 5c5e3f722..c44162644 100644 --- a/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.dart +++ b/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.dart @@ -23,7 +23,8 @@ abstract class GAliasedHero _i1.Operation get operation; static Serializer get serializer => _$gAliasedHeroSerializer; Map toJson() => - _i4.serializers.serializeWith(GAliasedHero.serializer, this); - static GAliasedHero fromJson(Map json) => + (_i4.serializers.serializeWith(GAliasedHero.serializer, this) + as Map); + static GAliasedHero? fromJson(Map json) => _i4.serializers.deserializeWith(GAliasedHero.serializer, json); } diff --git a/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.g.dart b/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.g.dart index b1e414126..42e5c9d24 100644 --- a/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/aliases/aliased_hero.req.gql.g.dart @@ -16,9 +16,9 @@ class _$GAliasedHeroSerializer implements StructuredSerializer { final String wireName = 'GAliasedHero'; @override - Iterable serialize(Serializers serializers, GAliasedHero object, + Iterable serialize(Serializers serializers, GAliasedHero object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GAliasedHeroVars)), @@ -31,7 +31,8 @@ class _$GAliasedHeroSerializer implements StructuredSerializer { } @override - GAliasedHero deserialize(Serializers serializers, Iterable serialized, + GAliasedHero deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAliasedHeroBuilder(); @@ -39,11 +40,11 @@ class _$GAliasedHeroSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GAliasedHeroVars)) + specifiedType: const FullType(_i3.GAliasedHeroVars))! as _i3.GAliasedHeroVars); break; case 'operation': @@ -63,16 +64,13 @@ class _$GAliasedHero extends GAliasedHero { @override final _i1.Operation operation; - factory _$GAliasedHero([void Function(GAliasedHeroBuilder) updates]) => + factory _$GAliasedHero([void Function(GAliasedHeroBuilder)? updates]) => (new GAliasedHeroBuilder()..update(updates)).build(); - _$GAliasedHero._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GAliasedHero', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GAliasedHero', 'operation'); - } + _$GAliasedHero._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GAliasedHero', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GAliasedHero', 'operation'); } @override @@ -106,25 +104,26 @@ class _$GAliasedHero extends GAliasedHero { class GAliasedHeroBuilder implements Builder { - _$GAliasedHero _$v; + _$GAliasedHero? _$v; - _i3.GAliasedHeroVarsBuilder _vars; + _i3.GAliasedHeroVarsBuilder? _vars; _i3.GAliasedHeroVarsBuilder get vars => _$this._vars ??= new _i3.GAliasedHeroVarsBuilder(); - set vars(_i3.GAliasedHeroVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GAliasedHeroVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GAliasedHeroBuilder() { GAliasedHero._initializeBuilder(this); } GAliasedHeroBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -132,14 +131,12 @@ class GAliasedHeroBuilder @override void replace(GAliasedHero other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAliasedHero; } @override - void update(void Function(GAliasedHeroBuilder) updates) { + void update(void Function(GAliasedHeroBuilder)? updates) { if (updates != null) updates(this); } @@ -147,10 +144,13 @@ class GAliasedHeroBuilder _$GAliasedHero build() { _$GAliasedHero _$result; try { - _$result = - _$v ?? new _$GAliasedHero._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GAliasedHero._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GAliasedHero', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.dart b/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.dart index ba082e333..405d121aa 100644 --- a/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.dart +++ b/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.dart @@ -18,7 +18,8 @@ abstract class GAliasedHeroVars static Serializer get serializer => _$gAliasedHeroVarsSerializer; Map toJson() => - _i2.serializers.serializeWith(GAliasedHeroVars.serializer, this); - static GAliasedHeroVars fromJson(Map json) => + (_i2.serializers.serializeWith(GAliasedHeroVars.serializer, this) + as Map); + static GAliasedHeroVars? fromJson(Map json) => _i2.serializers.deserializeWith(GAliasedHeroVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.g.dart b/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.g.dart index fd9c65249..796f184eb 100644 --- a/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/aliases/aliased_hero.var.gql.g.dart @@ -17,9 +17,9 @@ class _$GAliasedHeroVarsSerializer final String wireName = 'GAliasedHeroVars'; @override - Iterable serialize(Serializers serializers, GAliasedHeroVars object, + Iterable serialize(Serializers serializers, GAliasedHeroVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'ep', serializers.serialize(object.ep, specifiedType: const FullType(_i1.GEpisode)), @@ -30,7 +30,7 @@ class _$GAliasedHeroVarsSerializer @override GAliasedHeroVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAliasedHeroVarsBuilder(); @@ -38,7 +38,7 @@ class _$GAliasedHeroVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'ep': result.ep = serializers.deserialize(value, @@ -56,13 +56,11 @@ class _$GAliasedHeroVars extends GAliasedHeroVars { final _i1.GEpisode ep; factory _$GAliasedHeroVars( - [void Function(GAliasedHeroVarsBuilder) updates]) => + [void Function(GAliasedHeroVarsBuilder)? updates]) => (new GAliasedHeroVarsBuilder()..update(updates)).build(); - _$GAliasedHeroVars._({this.ep}) : super._() { - if (ep == null) { - throw new BuiltValueNullFieldError('GAliasedHeroVars', 'ep'); - } + _$GAliasedHeroVars._({required this.ep}) : super._() { + BuiltValueNullFieldError.checkNotNull(ep, 'GAliasedHeroVars', 'ep'); } @override @@ -93,17 +91,18 @@ class _$GAliasedHeroVars extends GAliasedHeroVars { class GAliasedHeroVarsBuilder implements Builder { - _$GAliasedHeroVars _$v; + _$GAliasedHeroVars? _$v; - _i1.GEpisode _ep; - _i1.GEpisode get ep => _$this._ep; - set ep(_i1.GEpisode ep) => _$this._ep = ep; + _i1.GEpisode? _ep; + _i1.GEpisode? get ep => _$this._ep; + set ep(_i1.GEpisode? ep) => _$this._ep = ep; GAliasedHeroVarsBuilder(); GAliasedHeroVarsBuilder get _$this { - if (_$v != null) { - _ep = _$v.ep; + final $v = _$v; + if ($v != null) { + _ep = $v.ep; _$v = null; } return this; @@ -111,20 +110,21 @@ class GAliasedHeroVarsBuilder @override void replace(GAliasedHeroVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAliasedHeroVars; } @override - void update(void Function(GAliasedHeroVarsBuilder) updates) { + void update(void Function(GAliasedHeroVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GAliasedHeroVars build() { - final _$result = _$v ?? new _$GAliasedHeroVars._(ep: ep); + final _$result = _$v ?? + new _$GAliasedHeroVars._( + ep: BuiltValueNullFieldError.checkNotNull( + ep, 'GAliasedHeroVars', 'ep')); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/lib/date_serializer.dart b/codegen/end_to_end_test/lib/date_serializer.dart index 0d659f9ea..ce32fd133 100644 --- a/codegen/end_to_end_test/lib/date_serializer.dart +++ b/codegen/end_to_end_test/lib/date_serializer.dart @@ -7,8 +7,11 @@ class DateSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - assert(serialized is int, - "DateSerializer expected 'int' but got ${serialized.runtimeType}"); + if (!(serialized is int)) { + throw Exception( + "DateSerializer expected 'int' but got ${serialized.runtimeType}", + ); + } return DateTime.fromMillisecondsSinceEpoch(serialized); } diff --git a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.dart b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.dart index 4bf434d6b..66937b5ac 100644 --- a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.dart +++ b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.dart @@ -19,13 +19,13 @@ abstract class GHeroWithFragmentsData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GHeroWithFragmentsData_hero get hero; + GHeroWithFragmentsData_hero? get hero; static Serializer get serializer => _$gHeroWithFragmentsDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GHeroWithFragmentsData.serializer, this); - static GHeroWithFragmentsData fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroWithFragmentsData.serializer, this) + as Map); + static GHeroWithFragmentsData? fromJson(Map json) => _i1.serializers.deserializeWith(GHeroWithFragmentsData.serializer, json); } @@ -48,9 +48,9 @@ abstract class GHeroWithFragmentsData_hero GHeroWithFragmentsData_hero_friendsConnection get friendsConnection; static Serializer get serializer => _$gHeroWithFragmentsDataHeroSerializer; - Map toJson() => _i1.serializers - .serializeWith(GHeroWithFragmentsData_hero.serializer, this); - static GHeroWithFragmentsData_hero fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GHeroWithFragmentsData_hero.serializer, this) as Map); + static GHeroWithFragmentsData_hero? fromJson(Map json) => _i1.serializers .deserializeWith(GHeroWithFragmentsData_hero.serializer, json); } @@ -71,15 +71,14 @@ abstract class GHeroWithFragmentsData_hero_friendsConnection b..G__typename = 'FriendsConnection'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - int get totalCount; - @nullable - BuiltList get edges; + int? get totalCount; + BuiltList? get edges; static Serializer get serializer => _$gHeroWithFragmentsDataHeroFriendsConnectionSerializer; - Map toJson() => _i1.serializers.serializeWith( - GHeroWithFragmentsData_hero_friendsConnection.serializer, this); - static GHeroWithFragmentsData_hero_friendsConnection fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GHeroWithFragmentsData_hero_friendsConnection.serializer, this) + as Map); + static GHeroWithFragmentsData_hero_friendsConnection? fromJson( Map json) => _i1.serializers.deserializeWith( GHeroWithFragmentsData_hero_friendsConnection.serializer, json); @@ -101,14 +100,14 @@ abstract class GHeroWithFragmentsData_hero_friendsConnection_edges b..G__typename = 'FriendsEdge'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GHeroWithFragmentsData_hero_friendsConnection_edges_node get node; + GHeroWithFragmentsData_hero_friendsConnection_edges_node? get node; static Serializer get serializer => _$gHeroWithFragmentsDataHeroFriendsConnectionEdgesSerializer; - Map toJson() => _i1.serializers.serializeWith( - GHeroWithFragmentsData_hero_friendsConnection_edges.serializer, this); - static GHeroWithFragmentsData_hero_friendsConnection_edges fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GHeroWithFragmentsData_hero_friendsConnection_edges.serializer, this) + as Map); + static GHeroWithFragmentsData_hero_friendsConnection_edges? fromJson( Map json) => _i1.serializers.deserializeWith( GHeroWithFragmentsData_hero_friendsConnection_edges.serializer, json); @@ -136,10 +135,10 @@ abstract class GHeroWithFragmentsData_hero_friendsConnection_edges_node static Serializer get serializer => _$gHeroWithFragmentsDataHeroFriendsConnectionEdgesNodeSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GHeroWithFragmentsData_hero_friendsConnection_edges_node.serializer, - this); - static GHeroWithFragmentsData_hero_friendsConnection_edges_node fromJson( + this) as Map); + static GHeroWithFragmentsData_hero_friendsConnection_edges_node? fromJson( Map json) => _i1.serializers.deserializeWith( GHeroWithFragmentsData_hero_friendsConnection_edges_node.serializer, @@ -166,8 +165,9 @@ abstract class GheroDataData String get name; static Serializer get serializer => _$gheroDataDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GheroDataData.serializer, this); - static GheroDataData fromJson(Map json) => + (_i1.serializers.serializeWith(GheroDataData.serializer, this) + as Map); + static GheroDataData? fromJson(Map json) => _i1.serializers.deserializeWith(GheroDataData.serializer, json); } @@ -181,14 +181,14 @@ abstract class GcomparisonFields implements GheroData { abstract class GcomparisonFields_friendsConnection { String get G__typename; - int get totalCount; - BuiltList get edges; + int? get totalCount; + BuiltList? get edges; Map toJson(); } abstract class GcomparisonFields_friendsConnection_edges { String get G__typename; - GcomparisonFields_friendsConnection_edges_node get node; + GcomparisonFields_friendsConnection_edges_node? get node; Map toJson(); } @@ -220,8 +220,9 @@ abstract class GcomparisonFieldsData static Serializer get serializer => _$gcomparisonFieldsDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GcomparisonFieldsData.serializer, this); - static GcomparisonFieldsData fromJson(Map json) => + (_i1.serializers.serializeWith(GcomparisonFieldsData.serializer, this) + as Map); + static GcomparisonFieldsData? fromJson(Map json) => _i1.serializers.deserializeWith(GcomparisonFieldsData.serializer, json); } @@ -241,15 +242,14 @@ abstract class GcomparisonFieldsData_friendsConnection b..G__typename = 'FriendsConnection'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - int get totalCount; - @nullable - BuiltList get edges; + int? get totalCount; + BuiltList? get edges; static Serializer get serializer => _$gcomparisonFieldsDataFriendsConnectionSerializer; - Map toJson() => _i1.serializers - .serializeWith(GcomparisonFieldsData_friendsConnection.serializer, this); - static GcomparisonFieldsData_friendsConnection fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GcomparisonFieldsData_friendsConnection.serializer, this) + as Map); + static GcomparisonFieldsData_friendsConnection? fromJson( Map json) => _i1.serializers.deserializeWith( GcomparisonFieldsData_friendsConnection.serializer, json); @@ -271,13 +271,13 @@ abstract class GcomparisonFieldsData_friendsConnection_edges b..G__typename = 'FriendsEdge'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GcomparisonFieldsData_friendsConnection_edges_node get node; + GcomparisonFieldsData_friendsConnection_edges_node? get node; static Serializer get serializer => _$gcomparisonFieldsDataFriendsConnectionEdgesSerializer; - Map toJson() => _i1.serializers.serializeWith( - GcomparisonFieldsData_friendsConnection_edges.serializer, this); - static GcomparisonFieldsData_friendsConnection_edges fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GcomparisonFieldsData_friendsConnection_edges.serializer, this) + as Map); + static GcomparisonFieldsData_friendsConnection_edges? fromJson( Map json) => _i1.serializers.deserializeWith( GcomparisonFieldsData_friendsConnection_edges.serializer, json); @@ -304,9 +304,10 @@ abstract class GcomparisonFieldsData_friendsConnection_edges_node static Serializer get serializer => _$gcomparisonFieldsDataFriendsConnectionEdgesNodeSerializer; - Map toJson() => _i1.serializers.serializeWith( - GcomparisonFieldsData_friendsConnection_edges_node.serializer, this); - static GcomparisonFieldsData_friendsConnection_edges_node fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GcomparisonFieldsData_friendsConnection_edges_node.serializer, this) + as Map); + static GcomparisonFieldsData_friendsConnection_edges_node? fromJson( Map json) => _i1.serializers.deserializeWith( GcomparisonFieldsData_friendsConnection_edges_node.serializer, json); diff --git a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.g.dart b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.g.dart index b3944bb39..cca25bb99 100644 --- a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.data.gql.g.dart @@ -44,18 +44,20 @@ class _$GHeroWithFragmentsDataSerializer final String wireName = 'GHeroWithFragmentsData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroWithFragmentsData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.hero != null) { + Object? value; + value = object.hero; + if (value != null) { result ..add('hero') - ..add(serializers.serialize(object.hero, + ..add(serializers.serialize(value, specifiedType: const FullType(GHeroWithFragmentsData_hero))); } return result; @@ -63,7 +65,7 @@ class _$GHeroWithFragmentsDataSerializer @override GHeroWithFragmentsData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsDataBuilder(); @@ -71,7 +73,7 @@ class _$GHeroWithFragmentsDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -79,7 +81,7 @@ class _$GHeroWithFragmentsDataSerializer break; case 'hero': result.hero.replace(serializers.deserialize(value, - specifiedType: const FullType(GHeroWithFragmentsData_hero)) + specifiedType: const FullType(GHeroWithFragmentsData_hero))! as GHeroWithFragmentsData_hero); break; } @@ -100,10 +102,10 @@ class _$GHeroWithFragmentsData_heroSerializer final String wireName = 'GHeroWithFragmentsData_hero'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroWithFragmentsData_hero object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -122,7 +124,7 @@ class _$GHeroWithFragmentsData_heroSerializer @override GHeroWithFragmentsData_hero deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsData_heroBuilder(); @@ -130,7 +132,7 @@ class _$GHeroWithFragmentsData_heroSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -147,7 +149,7 @@ class _$GHeroWithFragmentsData_heroSerializer case 'friendsConnection': result.friendsConnection.replace(serializers.deserialize(value, specifiedType: const FullType( - GHeroWithFragmentsData_hero_friendsConnection)) + GHeroWithFragmentsData_hero_friendsConnection))! as GHeroWithFragmentsData_hero_friendsConnection); break; } @@ -169,24 +171,26 @@ class _$GHeroWithFragmentsData_hero_friendsConnectionSerializer final String wireName = 'GHeroWithFragmentsData_hero_friendsConnection'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GHeroWithFragmentsData_hero_friendsConnection object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.totalCount != null) { + Object? value; + value = object.totalCount; + if (value != null) { result ..add('totalCount') - ..add(serializers.serialize(object.totalCount, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.edges != null) { + value = object.edges; + if (value != null) { result ..add('edges') - ..add(serializers.serialize(object.edges, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [ const FullType( GHeroWithFragmentsData_hero_friendsConnection_edges) @@ -197,7 +201,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnectionSerializer @override GHeroWithFragmentsData_hero_friendsConnection deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsData_hero_friendsConnectionBuilder(); @@ -205,7 +209,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnectionSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -220,7 +224,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnectionSerializer specifiedType: const FullType(BuiltList, const [ const FullType( GHeroWithFragmentsData_hero_friendsConnection_edges) - ])) as BuiltList); + ]))! as BuiltList); break; } } @@ -242,18 +246,20 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edgesSerializer final String wireName = 'GHeroWithFragmentsData_hero_friendsConnection_edges'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GHeroWithFragmentsData_hero_friendsConnection_edges object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.node != null) { + Object? value; + value = object.node; + if (value != null) { result ..add('node') - ..add(serializers.serialize(object.node, + ..add(serializers.serialize(value, specifiedType: const FullType( GHeroWithFragmentsData_hero_friendsConnection_edges_node))); } @@ -262,7 +268,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edgesSerializer @override GHeroWithFragmentsData_hero_friendsConnection_edges deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder(); @@ -271,7 +277,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edgesSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -280,7 +286,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edgesSerializer case 'node': result.node.replace(serializers.deserialize(value, specifiedType: const FullType( - GHeroWithFragmentsData_hero_friendsConnection_edges_node)) + GHeroWithFragmentsData_hero_friendsConnection_edges_node))! as GHeroWithFragmentsData_hero_friendsConnection_edges_node); break; } @@ -304,10 +310,10 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edges_nodeSerializer 'GHeroWithFragmentsData_hero_friendsConnection_edges_node'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GHeroWithFragmentsData_hero_friendsConnection_edges_node object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -320,7 +326,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edges_nodeSerializer @override GHeroWithFragmentsData_hero_friendsConnection_edges_node deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder(); @@ -329,7 +335,7 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edges_nodeSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -353,9 +359,9 @@ class _$GheroDataDataSerializer implements StructuredSerializer { final String wireName = 'GheroDataData'; @override - Iterable serialize(Serializers serializers, GheroDataData object, + Iterable serialize(Serializers serializers, GheroDataData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -368,7 +374,7 @@ class _$GheroDataDataSerializer implements StructuredSerializer { @override GheroDataData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GheroDataDataBuilder(); @@ -376,7 +382,7 @@ class _$GheroDataDataSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -404,10 +410,10 @@ class _$GcomparisonFieldsDataSerializer final String wireName = 'GcomparisonFieldsData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GcomparisonFieldsData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -426,7 +432,7 @@ class _$GcomparisonFieldsDataSerializer @override GcomparisonFieldsData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GcomparisonFieldsDataBuilder(); @@ -434,7 +440,7 @@ class _$GcomparisonFieldsDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -451,7 +457,7 @@ class _$GcomparisonFieldsDataSerializer case 'friendsConnection': result.friendsConnection.replace(serializers.deserialize(value, specifiedType: - const FullType(GcomparisonFieldsData_friendsConnection)) + const FullType(GcomparisonFieldsData_friendsConnection))! as GcomparisonFieldsData_friendsConnection); break; } @@ -472,24 +478,26 @@ class _$GcomparisonFieldsData_friendsConnectionSerializer final String wireName = 'GcomparisonFieldsData_friendsConnection'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GcomparisonFieldsData_friendsConnection object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.totalCount != null) { + Object? value; + value = object.totalCount; + if (value != null) { result ..add('totalCount') - ..add(serializers.serialize(object.totalCount, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.edges != null) { + value = object.edges; + if (value != null) { result ..add('edges') - ..add(serializers.serialize(object.edges, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GcomparisonFieldsData_friendsConnection_edges) ]))); @@ -499,7 +507,7 @@ class _$GcomparisonFieldsData_friendsConnectionSerializer @override GcomparisonFieldsData_friendsConnection deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GcomparisonFieldsData_friendsConnectionBuilder(); @@ -507,7 +515,7 @@ class _$GcomparisonFieldsData_friendsConnectionSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -521,7 +529,7 @@ class _$GcomparisonFieldsData_friendsConnectionSerializer result.edges.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GcomparisonFieldsData_friendsConnection_edges) - ])) as BuiltList); + ]))! as BuiltList); break; } } @@ -542,18 +550,20 @@ class _$GcomparisonFieldsData_friendsConnection_edgesSerializer final String wireName = 'GcomparisonFieldsData_friendsConnection_edges'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GcomparisonFieldsData_friendsConnection_edges object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.node != null) { + Object? value; + value = object.node; + if (value != null) { result ..add('node') - ..add(serializers.serialize(object.node, + ..add(serializers.serialize(value, specifiedType: const FullType( GcomparisonFieldsData_friendsConnection_edges_node))); } @@ -562,7 +572,7 @@ class _$GcomparisonFieldsData_friendsConnection_edgesSerializer @override GcomparisonFieldsData_friendsConnection_edges deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GcomparisonFieldsData_friendsConnection_edgesBuilder(); @@ -570,7 +580,7 @@ class _$GcomparisonFieldsData_friendsConnection_edgesSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -579,7 +589,7 @@ class _$GcomparisonFieldsData_friendsConnection_edgesSerializer case 'node': result.node.replace(serializers.deserialize(value, specifiedType: const FullType( - GcomparisonFieldsData_friendsConnection_edges_node)) + GcomparisonFieldsData_friendsConnection_edges_node))! as GcomparisonFieldsData_friendsConnection_edges_node); break; } @@ -602,10 +612,10 @@ class _$GcomparisonFieldsData_friendsConnection_edges_nodeSerializer final String wireName = 'GcomparisonFieldsData_friendsConnection_edges_node'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GcomparisonFieldsData_friendsConnection_edges_node object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -618,7 +628,7 @@ class _$GcomparisonFieldsData_friendsConnection_edges_nodeSerializer @override GcomparisonFieldsData_friendsConnection_edges_node deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GcomparisonFieldsData_friendsConnection_edges_nodeBuilder(); @@ -627,7 +637,7 @@ class _$GcomparisonFieldsData_friendsConnection_edges_nodeSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -648,17 +658,16 @@ class _$GHeroWithFragmentsData extends GHeroWithFragmentsData { @override final String G__typename; @override - final GHeroWithFragmentsData_hero hero; + final GHeroWithFragmentsData_hero? hero; factory _$GHeroWithFragmentsData( - [void Function(GHeroWithFragmentsDataBuilder) updates]) => + [void Function(GHeroWithFragmentsDataBuilder)? updates]) => (new GHeroWithFragmentsDataBuilder()..update(updates)).build(); - _$GHeroWithFragmentsData._({this.G__typename, this.hero}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData', 'G__typename'); - } + _$GHeroWithFragmentsData._({required this.G__typename, this.hero}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroWithFragmentsData', 'G__typename'); } @override @@ -694,25 +703,26 @@ class _$GHeroWithFragmentsData extends GHeroWithFragmentsData { class GHeroWithFragmentsDataBuilder implements Builder { - _$GHeroWithFragmentsData _$v; + _$GHeroWithFragmentsData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GHeroWithFragmentsData_heroBuilder _hero; + GHeroWithFragmentsData_heroBuilder? _hero; GHeroWithFragmentsData_heroBuilder get hero => _$this._hero ??= new GHeroWithFragmentsData_heroBuilder(); - set hero(GHeroWithFragmentsData_heroBuilder hero) => _$this._hero = hero; + set hero(GHeroWithFragmentsData_heroBuilder? hero) => _$this._hero = hero; GHeroWithFragmentsDataBuilder() { GHeroWithFragmentsData._initializeBuilder(this); } GHeroWithFragmentsDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _hero = _$v.hero?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _hero = $v.hero?.toBuilder(); _$v = null; } return this; @@ -720,14 +730,12 @@ class GHeroWithFragmentsDataBuilder @override void replace(GHeroWithFragmentsData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragmentsData; } @override - void update(void Function(GHeroWithFragmentsDataBuilder) updates) { + void update(void Function(GHeroWithFragmentsDataBuilder)? updates) { if (updates != null) updates(this); } @@ -737,9 +745,11 @@ class GHeroWithFragmentsDataBuilder try { _$result = _$v ?? new _$GHeroWithFragmentsData._( - G__typename: G__typename, hero: _hero?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroWithFragmentsData', 'G__typename'), + hero: _hero?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'hero'; _hero?.build(); @@ -765,26 +775,23 @@ class _$GHeroWithFragmentsData_hero extends GHeroWithFragmentsData_hero { final GHeroWithFragmentsData_hero_friendsConnection friendsConnection; factory _$GHeroWithFragmentsData_hero( - [void Function(GHeroWithFragmentsData_heroBuilder) updates]) => + [void Function(GHeroWithFragmentsData_heroBuilder)? updates]) => (new GHeroWithFragmentsData_heroBuilder()..update(updates)).build(); _$GHeroWithFragmentsData_hero._( - {this.G__typename, this.id, this.name, this.friendsConnection}) + {required this.G__typename, + required this.id, + required this.name, + required this.friendsConnection}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData_hero', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GHeroWithFragmentsData_hero', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GHeroWithFragmentsData_hero', 'name'); - } - if (friendsConnection == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData_hero', 'friendsConnection'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroWithFragmentsData_hero', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, 'GHeroWithFragmentsData_hero', 'id'); + BuiltValueNullFieldError.checkNotNull( + name, 'GHeroWithFragmentsData_hero', 'name'); + BuiltValueNullFieldError.checkNotNull( + friendsConnection, 'GHeroWithFragmentsData_hero', 'friendsConnection'); } @override @@ -828,26 +835,26 @@ class GHeroWithFragmentsData_heroBuilder implements Builder { - _$GHeroWithFragmentsData_hero _$v; + _$GHeroWithFragmentsData_hero? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - GHeroWithFragmentsData_hero_friendsConnectionBuilder _friendsConnection; + GHeroWithFragmentsData_hero_friendsConnectionBuilder? _friendsConnection; GHeroWithFragmentsData_hero_friendsConnectionBuilder get friendsConnection => _$this._friendsConnection ??= new GHeroWithFragmentsData_hero_friendsConnectionBuilder(); set friendsConnection( - GHeroWithFragmentsData_hero_friendsConnectionBuilder + GHeroWithFragmentsData_hero_friendsConnectionBuilder? friendsConnection) => _$this._friendsConnection = friendsConnection; @@ -856,11 +863,12 @@ class GHeroWithFragmentsData_heroBuilder } GHeroWithFragmentsData_heroBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _friendsConnection = _$v.friendsConnection?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _friendsConnection = $v.friendsConnection.toBuilder(); _$v = null; } return this; @@ -868,14 +876,12 @@ class GHeroWithFragmentsData_heroBuilder @override void replace(GHeroWithFragmentsData_hero other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragmentsData_hero; } @override - void update(void Function(GHeroWithFragmentsData_heroBuilder) updates) { + void update(void Function(GHeroWithFragmentsData_heroBuilder)? updates) { if (updates != null) updates(this); } @@ -885,12 +891,15 @@ class GHeroWithFragmentsData_heroBuilder try { _$result = _$v ?? new _$GHeroWithFragmentsData_hero._( - G__typename: G__typename, - id: id, - name: name, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroWithFragmentsData_hero', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GHeroWithFragmentsData_hero', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHeroWithFragmentsData_hero', 'name'), friendsConnection: friendsConnection.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'friendsConnection'; friendsConnection.build(); @@ -910,24 +919,22 @@ class _$GHeroWithFragmentsData_hero_friendsConnection @override final String G__typename; @override - final int totalCount; + final int? totalCount; @override - final BuiltList edges; + final BuiltList? edges; factory _$GHeroWithFragmentsData_hero_friendsConnection( - [void Function(GHeroWithFragmentsData_hero_friendsConnectionBuilder) + [void Function(GHeroWithFragmentsData_hero_friendsConnectionBuilder)? updates]) => (new GHeroWithFragmentsData_hero_friendsConnectionBuilder() ..update(updates)) .build(); _$GHeroWithFragmentsData_hero_friendsConnection._( - {this.G__typename, this.totalCount, this.edges}) + {required this.G__typename, this.totalCount, this.edges}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData_hero_friendsConnection', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GHeroWithFragmentsData_hero_friendsConnection', 'G__typename'); } @override @@ -970,23 +977,23 @@ class GHeroWithFragmentsData_hero_friendsConnectionBuilder implements Builder { - _$GHeroWithFragmentsData_hero_friendsConnection _$v; + _$GHeroWithFragmentsData_hero_friendsConnection? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - int _totalCount; - int get totalCount => _$this._totalCount; - set totalCount(int totalCount) => _$this._totalCount = totalCount; + int? _totalCount; + int? get totalCount => _$this._totalCount; + set totalCount(int? totalCount) => _$this._totalCount = totalCount; - ListBuilder _edges; + ListBuilder? _edges; ListBuilder< GHeroWithFragmentsData_hero_friendsConnection_edges> get edges => _$this ._edges ??= new ListBuilder(); set edges( - ListBuilder + ListBuilder? edges) => _$this._edges = edges; @@ -995,10 +1002,11 @@ class GHeroWithFragmentsData_hero_friendsConnectionBuilder } GHeroWithFragmentsData_hero_friendsConnectionBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _totalCount = _$v.totalCount; - _edges = _$v.edges?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _totalCount = $v.totalCount; + _edges = $v.edges?.toBuilder(); _$v = null; } return this; @@ -1006,15 +1014,13 @@ class GHeroWithFragmentsData_hero_friendsConnectionBuilder @override void replace(GHeroWithFragmentsData_hero_friendsConnection other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragmentsData_hero_friendsConnection; } @override void update( - void Function(GHeroWithFragmentsData_hero_friendsConnectionBuilder) + void Function(GHeroWithFragmentsData_hero_friendsConnectionBuilder)? updates) { if (updates != null) updates(this); } @@ -1025,11 +1031,14 @@ class GHeroWithFragmentsData_hero_friendsConnectionBuilder try { _$result = _$v ?? new _$GHeroWithFragmentsData_hero_friendsConnection._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GHeroWithFragmentsData_hero_friendsConnection', + 'G__typename'), totalCount: totalCount, edges: _edges?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'edges'; _edges?.build(); @@ -1051,23 +1060,21 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edges @override final String G__typename; @override - final GHeroWithFragmentsData_hero_friendsConnection_edges_node node; + final GHeroWithFragmentsData_hero_friendsConnection_edges_node? node; factory _$GHeroWithFragmentsData_hero_friendsConnection_edges( [void Function( - GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder) + GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder)? updates]) => (new GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder() ..update(updates)) .build(); _$GHeroWithFragmentsData_hero_friendsConnection_edges._( - {this.G__typename, this.node}) + {required this.G__typename, this.node}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData_hero_friendsConnection_edges', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GHeroWithFragmentsData_hero_friendsConnection_edges', 'G__typename'); } @override @@ -1109,18 +1116,18 @@ class GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder implements Builder { - _$GHeroWithFragmentsData_hero_friendsConnection_edges _$v; + _$GHeroWithFragmentsData_hero_friendsConnection_edges? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder _node; + GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder? _node; GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder get node => _$this._node ??= new GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder(); set node( - GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder + GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder? node) => _$this._node = node; @@ -1130,9 +1137,10 @@ class GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder } GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _node = _$v.node?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _node = $v.node?.toBuilder(); _$v = null; } return this; @@ -1140,15 +1148,13 @@ class GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder @override void replace(GHeroWithFragmentsData_hero_friendsConnection_edges other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragmentsData_hero_friendsConnection_edges; } @override void update( - void Function(GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder) + void Function(GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder)? updates) { if (updates != null) updates(this); } @@ -1159,9 +1165,13 @@ class GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder try { _$result = _$v ?? new _$GHeroWithFragmentsData_hero_friendsConnection_edges._( - G__typename: G__typename, node: _node?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GHeroWithFragmentsData_hero_friendsConnection_edges', + 'G__typename'), + node: _node?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'node'; _node?.build(); @@ -1187,24 +1197,21 @@ class _$GHeroWithFragmentsData_hero_friendsConnection_edges_node factory _$GHeroWithFragmentsData_hero_friendsConnection_edges_node( [void Function( - GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder) + GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder)? updates]) => (new GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder() ..update(updates)) .build(); _$GHeroWithFragmentsData_hero_friendsConnection_edges_node._( - {this.G__typename, this.name}) + {required this.G__typename, required this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData_hero_friendsConnection_edges_node', - 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GHeroWithFragmentsData_hero_friendsConnection_edges_node', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GHeroWithFragmentsData_hero_friendsConnection_edges_node', + 'G__typename'); + BuiltValueNullFieldError.checkNotNull(name, + 'GHeroWithFragmentsData_hero_friendsConnection_edges_node', 'name'); } @override @@ -1246,15 +1253,15 @@ class GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder implements Builder { - _$GHeroWithFragmentsData_hero_friendsConnection_edges_node _$v; + _$GHeroWithFragmentsData_hero_friendsConnection_edges_node? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder() { GHeroWithFragmentsData_hero_friendsConnection_edges_node._initializeBuilder( @@ -1262,9 +1269,10 @@ class GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder } GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; _$v = null; } return this; @@ -1272,16 +1280,14 @@ class GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder @override void replace(GHeroWithFragmentsData_hero_friendsConnection_edges_node other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragmentsData_hero_friendsConnection_edges_node; } @override void update( void Function( - GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder) + GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder)? updates) { if (updates != null) updates(this); } @@ -1290,7 +1296,14 @@ class GHeroWithFragmentsData_hero_friendsConnection_edges_nodeBuilder _$GHeroWithFragmentsData_hero_friendsConnection_edges_node build() { final _$result = _$v ?? new _$GHeroWithFragmentsData_hero_friendsConnection_edges_node._( - G__typename: G__typename, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GHeroWithFragmentsData_hero_friendsConnection_edges_node', + 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, + 'GHeroWithFragmentsData_hero_friendsConnection_edges_node', + 'name')); replace(_$result); return _$result; } @@ -1302,16 +1315,14 @@ class _$GheroDataData extends GheroDataData { @override final String name; - factory _$GheroDataData([void Function(GheroDataDataBuilder) updates]) => + factory _$GheroDataData([void Function(GheroDataDataBuilder)? updates]) => (new GheroDataDataBuilder()..update(updates)).build(); - _$GheroDataData._({this.G__typename, this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GheroDataData', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GheroDataData', 'name'); - } + _$GheroDataData._({required this.G__typename, required this.name}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GheroDataData', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(name, 'GheroDataData', 'name'); } @override @@ -1345,24 +1356,25 @@ class _$GheroDataData extends GheroDataData { class GheroDataDataBuilder implements Builder { - _$GheroDataData _$v; + _$GheroDataData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GheroDataDataBuilder() { GheroDataData._initializeBuilder(this); } GheroDataDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; _$v = null; } return this; @@ -1370,21 +1382,23 @@ class GheroDataDataBuilder @override void replace(GheroDataData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GheroDataData; } @override - void update(void Function(GheroDataDataBuilder) updates) { + void update(void Function(GheroDataDataBuilder)? updates) { if (updates != null) updates(this); } @override _$GheroDataData build() { - final _$result = - _$v ?? new _$GheroDataData._(G__typename: G__typename, name: name); + final _$result = _$v ?? + new _$GheroDataData._( + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GheroDataData', 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GheroDataData', 'name')); replace(_$result); return _$result; } @@ -1401,26 +1415,22 @@ class _$GcomparisonFieldsData extends GcomparisonFieldsData { final GcomparisonFieldsData_friendsConnection friendsConnection; factory _$GcomparisonFieldsData( - [void Function(GcomparisonFieldsDataBuilder) updates]) => + [void Function(GcomparisonFieldsDataBuilder)? updates]) => (new GcomparisonFieldsDataBuilder()..update(updates)).build(); _$GcomparisonFieldsData._( - {this.G__typename, this.id, this.name, this.friendsConnection}) + {required this.G__typename, + required this.id, + required this.name, + required this.friendsConnection}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GcomparisonFieldsData', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GcomparisonFieldsData', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GcomparisonFieldsData', 'name'); - } - if (friendsConnection == null) { - throw new BuiltValueNullFieldError( - 'GcomparisonFieldsData', 'friendsConnection'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GcomparisonFieldsData', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, 'GcomparisonFieldsData', 'id'); + BuiltValueNullFieldError.checkNotNull( + name, 'GcomparisonFieldsData', 'name'); + BuiltValueNullFieldError.checkNotNull( + friendsConnection, 'GcomparisonFieldsData', 'friendsConnection'); } @override @@ -1462,26 +1472,26 @@ class _$GcomparisonFieldsData extends GcomparisonFieldsData { class GcomparisonFieldsDataBuilder implements Builder { - _$GcomparisonFieldsData _$v; + _$GcomparisonFieldsData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - GcomparisonFieldsData_friendsConnectionBuilder _friendsConnection; + GcomparisonFieldsData_friendsConnectionBuilder? _friendsConnection; GcomparisonFieldsData_friendsConnectionBuilder get friendsConnection => _$this._friendsConnection ??= new GcomparisonFieldsData_friendsConnectionBuilder(); set friendsConnection( - GcomparisonFieldsData_friendsConnectionBuilder friendsConnection) => + GcomparisonFieldsData_friendsConnectionBuilder? friendsConnection) => _$this._friendsConnection = friendsConnection; GcomparisonFieldsDataBuilder() { @@ -1489,11 +1499,12 @@ class GcomparisonFieldsDataBuilder } GcomparisonFieldsDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _friendsConnection = _$v.friendsConnection?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _friendsConnection = $v.friendsConnection.toBuilder(); _$v = null; } return this; @@ -1501,14 +1512,12 @@ class GcomparisonFieldsDataBuilder @override void replace(GcomparisonFieldsData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GcomparisonFieldsData; } @override - void update(void Function(GcomparisonFieldsDataBuilder) updates) { + void update(void Function(GcomparisonFieldsDataBuilder)? updates) { if (updates != null) updates(this); } @@ -1518,12 +1527,15 @@ class GcomparisonFieldsDataBuilder try { _$result = _$v ?? new _$GcomparisonFieldsData._( - G__typename: G__typename, - id: id, - name: name, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GcomparisonFieldsData', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GcomparisonFieldsData', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GcomparisonFieldsData', 'name'), friendsConnection: friendsConnection.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'friendsConnection'; friendsConnection.build(); @@ -1543,23 +1555,21 @@ class _$GcomparisonFieldsData_friendsConnection @override final String G__typename; @override - final int totalCount; + final int? totalCount; @override - final BuiltList edges; + final BuiltList? edges; factory _$GcomparisonFieldsData_friendsConnection( - [void Function(GcomparisonFieldsData_friendsConnectionBuilder) + [void Function(GcomparisonFieldsData_friendsConnectionBuilder)? updates]) => (new GcomparisonFieldsData_friendsConnectionBuilder()..update(updates)) .build(); _$GcomparisonFieldsData_friendsConnection._( - {this.G__typename, this.totalCount, this.edges}) + {required this.G__typename, this.totalCount, this.edges}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GcomparisonFieldsData_friendsConnection', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GcomparisonFieldsData_friendsConnection', 'G__typename'); } @override @@ -1602,21 +1612,22 @@ class GcomparisonFieldsData_friendsConnectionBuilder implements Builder { - _$GcomparisonFieldsData_friendsConnection _$v; + _$GcomparisonFieldsData_friendsConnection? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - int _totalCount; - int get totalCount => _$this._totalCount; - set totalCount(int totalCount) => _$this._totalCount = totalCount; + int? _totalCount; + int? get totalCount => _$this._totalCount; + set totalCount(int? totalCount) => _$this._totalCount = totalCount; - ListBuilder _edges; + ListBuilder? _edges; ListBuilder get edges => _$this._edges ??= new ListBuilder(); - set edges(ListBuilder edges) => + set edges( + ListBuilder? edges) => _$this._edges = edges; GcomparisonFieldsData_friendsConnectionBuilder() { @@ -1624,10 +1635,11 @@ class GcomparisonFieldsData_friendsConnectionBuilder } GcomparisonFieldsData_friendsConnectionBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _totalCount = _$v.totalCount; - _edges = _$v.edges?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _totalCount = $v.totalCount; + _edges = $v.edges?.toBuilder(); _$v = null; } return this; @@ -1635,15 +1647,13 @@ class GcomparisonFieldsData_friendsConnectionBuilder @override void replace(GcomparisonFieldsData_friendsConnection other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GcomparisonFieldsData_friendsConnection; } @override void update( - void Function(GcomparisonFieldsData_friendsConnectionBuilder) updates) { + void Function(GcomparisonFieldsData_friendsConnectionBuilder)? updates) { if (updates != null) updates(this); } @@ -1653,11 +1663,12 @@ class GcomparisonFieldsData_friendsConnectionBuilder try { _$result = _$v ?? new _$GcomparisonFieldsData_friendsConnection._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GcomparisonFieldsData_friendsConnection', 'G__typename'), totalCount: totalCount, edges: _edges?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'edges'; _edges?.build(); @@ -1679,22 +1690,20 @@ class _$GcomparisonFieldsData_friendsConnection_edges @override final String G__typename; @override - final GcomparisonFieldsData_friendsConnection_edges_node node; + final GcomparisonFieldsData_friendsConnection_edges_node? node; factory _$GcomparisonFieldsData_friendsConnection_edges( - [void Function(GcomparisonFieldsData_friendsConnection_edgesBuilder) + [void Function(GcomparisonFieldsData_friendsConnection_edgesBuilder)? updates]) => (new GcomparisonFieldsData_friendsConnection_edgesBuilder() ..update(updates)) .build(); _$GcomparisonFieldsData_friendsConnection_edges._( - {this.G__typename, this.node}) + {required this.G__typename, this.node}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GcomparisonFieldsData_friendsConnection_edges', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GcomparisonFieldsData_friendsConnection_edges', 'G__typename'); } @override @@ -1734,17 +1743,17 @@ class GcomparisonFieldsData_friendsConnection_edgesBuilder implements Builder { - _$GcomparisonFieldsData_friendsConnection_edges _$v; + _$GcomparisonFieldsData_friendsConnection_edges? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GcomparisonFieldsData_friendsConnection_edges_nodeBuilder _node; + GcomparisonFieldsData_friendsConnection_edges_nodeBuilder? _node; GcomparisonFieldsData_friendsConnection_edges_nodeBuilder get node => _$this._node ??= new GcomparisonFieldsData_friendsConnection_edges_nodeBuilder(); - set node(GcomparisonFieldsData_friendsConnection_edges_nodeBuilder node) => + set node(GcomparisonFieldsData_friendsConnection_edges_nodeBuilder? node) => _$this._node = node; GcomparisonFieldsData_friendsConnection_edgesBuilder() { @@ -1752,9 +1761,10 @@ class GcomparisonFieldsData_friendsConnection_edgesBuilder } GcomparisonFieldsData_friendsConnection_edgesBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _node = _$v.node?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _node = $v.node?.toBuilder(); _$v = null; } return this; @@ -1762,15 +1772,13 @@ class GcomparisonFieldsData_friendsConnection_edgesBuilder @override void replace(GcomparisonFieldsData_friendsConnection_edges other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GcomparisonFieldsData_friendsConnection_edges; } @override void update( - void Function(GcomparisonFieldsData_friendsConnection_edgesBuilder) + void Function(GcomparisonFieldsData_friendsConnection_edgesBuilder)? updates) { if (updates != null) updates(this); } @@ -1781,9 +1789,13 @@ class GcomparisonFieldsData_friendsConnection_edgesBuilder try { _$result = _$v ?? new _$GcomparisonFieldsData_friendsConnection_edges._( - G__typename: G__typename, node: _node?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GcomparisonFieldsData_friendsConnection_edges', + 'G__typename'), + node: _node?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'node'; _node?.build(); @@ -1809,23 +1821,19 @@ class _$GcomparisonFieldsData_friendsConnection_edges_node factory _$GcomparisonFieldsData_friendsConnection_edges_node( [void Function( - GcomparisonFieldsData_friendsConnection_edges_nodeBuilder) + GcomparisonFieldsData_friendsConnection_edges_nodeBuilder)? updates]) => (new GcomparisonFieldsData_friendsConnection_edges_nodeBuilder() ..update(updates)) .build(); _$GcomparisonFieldsData_friendsConnection_edges_node._( - {this.G__typename, this.name}) + {required this.G__typename, required this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GcomparisonFieldsData_friendsConnection_edges_node', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GcomparisonFieldsData_friendsConnection_edges_node', 'name'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GcomparisonFieldsData_friendsConnection_edges_node', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + name, 'GcomparisonFieldsData_friendsConnection_edges_node', 'name'); } @override @@ -1867,24 +1875,25 @@ class GcomparisonFieldsData_friendsConnection_edges_nodeBuilder implements Builder { - _$GcomparisonFieldsData_friendsConnection_edges_node _$v; + _$GcomparisonFieldsData_friendsConnection_edges_node? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GcomparisonFieldsData_friendsConnection_edges_nodeBuilder() { GcomparisonFieldsData_friendsConnection_edges_node._initializeBuilder(this); } GcomparisonFieldsData_friendsConnection_edges_nodeBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; _$v = null; } return this; @@ -1892,15 +1901,13 @@ class GcomparisonFieldsData_friendsConnection_edges_nodeBuilder @override void replace(GcomparisonFieldsData_friendsConnection_edges_node other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GcomparisonFieldsData_friendsConnection_edges_node; } @override void update( - void Function(GcomparisonFieldsData_friendsConnection_edges_nodeBuilder) + void Function(GcomparisonFieldsData_friendsConnection_edges_nodeBuilder)? updates) { if (updates != null) updates(this); } @@ -1909,7 +1916,12 @@ class GcomparisonFieldsData_friendsConnection_edges_nodeBuilder _$GcomparisonFieldsData_friendsConnection_edges_node build() { final _$result = _$v ?? new _$GcomparisonFieldsData_friendsConnection_edges_node._( - G__typename: G__typename, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GcomparisonFieldsData_friendsConnection_edges_node', + 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull(name, + 'GcomparisonFieldsData_friendsConnection_edges_node', 'name')); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.dart b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.dart index f116f14ba..eeb9fccb0 100644 --- a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.dart +++ b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.dart @@ -26,7 +26,8 @@ abstract class GHeroWithFragments static Serializer get serializer => _$gHeroWithFragmentsSerializer; Map toJson() => - _i4.serializers.serializeWith(GHeroWithFragments.serializer, this); - static GHeroWithFragments fromJson(Map json) => + (_i4.serializers.serializeWith(GHeroWithFragments.serializer, this) + as Map); + static GHeroWithFragments? fromJson(Map json) => _i4.serializers.deserializeWith(GHeroWithFragments.serializer, json); } diff --git a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.g.dart b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.g.dart index 1b09668db..224ed9eb4 100644 --- a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.req.gql.g.dart @@ -17,9 +17,10 @@ class _$GHeroWithFragmentsSerializer final String wireName = 'GHeroWithFragments'; @override - Iterable serialize(Serializers serializers, GHeroWithFragments object, + Iterable serialize( + Serializers serializers, GHeroWithFragments object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GHeroWithFragmentsVars)), @@ -33,7 +34,7 @@ class _$GHeroWithFragmentsSerializer @override GHeroWithFragments deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsBuilder(); @@ -41,11 +42,11 @@ class _$GHeroWithFragmentsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GHeroWithFragmentsVars)) + specifiedType: const FullType(_i3.GHeroWithFragmentsVars))! as _i3.GHeroWithFragmentsVars); break; case 'operation': @@ -66,16 +67,14 @@ class _$GHeroWithFragments extends GHeroWithFragments { final _i1.Operation operation; factory _$GHeroWithFragments( - [void Function(GHeroWithFragmentsBuilder) updates]) => + [void Function(GHeroWithFragmentsBuilder)? updates]) => (new GHeroWithFragmentsBuilder()..update(updates)).build(); - _$GHeroWithFragments._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GHeroWithFragments', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GHeroWithFragments', 'operation'); - } + _$GHeroWithFragments._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GHeroWithFragments', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GHeroWithFragments', 'operation'); } @override @@ -111,25 +110,26 @@ class _$GHeroWithFragments extends GHeroWithFragments { class GHeroWithFragmentsBuilder implements Builder { - _$GHeroWithFragments _$v; + _$GHeroWithFragments? _$v; - _i3.GHeroWithFragmentsVarsBuilder _vars; + _i3.GHeroWithFragmentsVarsBuilder? _vars; _i3.GHeroWithFragmentsVarsBuilder get vars => _$this._vars ??= new _i3.GHeroWithFragmentsVarsBuilder(); - set vars(_i3.GHeroWithFragmentsVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GHeroWithFragmentsVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GHeroWithFragmentsBuilder() { GHeroWithFragments._initializeBuilder(this); } GHeroWithFragmentsBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -137,14 +137,12 @@ class GHeroWithFragmentsBuilder @override void replace(GHeroWithFragments other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragments; } @override - void update(void Function(GHeroWithFragmentsBuilder) updates) { + void update(void Function(GHeroWithFragmentsBuilder)? updates) { if (updates != null) updates(this); } @@ -153,9 +151,12 @@ class GHeroWithFragmentsBuilder _$GHeroWithFragments _$result; try { _$result = _$v ?? - new _$GHeroWithFragments._(vars: vars.build(), operation: operation); + new _$GHeroWithFragments._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GHeroWithFragments', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.dart b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.dart index 420ceaaef..417aa31d2 100644 --- a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.dart +++ b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.dart @@ -14,13 +14,13 @@ abstract class GHeroWithFragmentsVars [Function(GHeroWithFragmentsVarsBuilder b) updates]) = _$GHeroWithFragmentsVars; - @nullable - int get first; + int? get first; static Serializer get serializer => _$gHeroWithFragmentsVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GHeroWithFragmentsVars.serializer, this); - static GHeroWithFragmentsVars fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroWithFragmentsVars.serializer, this) + as Map); + static GHeroWithFragmentsVars? fromJson(Map json) => _i1.serializers.deserializeWith(GHeroWithFragmentsVars.serializer, json); } @@ -33,8 +33,9 @@ abstract class GheroDataVars static Serializer get serializer => _$gheroDataVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GheroDataVars.serializer, this); - static GheroDataVars fromJson(Map json) => + (_i1.serializers.serializeWith(GheroDataVars.serializer, this) + as Map); + static GheroDataVars? fromJson(Map json) => _i1.serializers.deserializeWith(GheroDataVars.serializer, json); } @@ -46,12 +47,12 @@ abstract class GcomparisonFieldsVars [Function(GcomparisonFieldsVarsBuilder b) updates]) = _$GcomparisonFieldsVars; - @nullable - int get first; + int? get first; static Serializer get serializer => _$gcomparisonFieldsVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GcomparisonFieldsVars.serializer, this); - static GcomparisonFieldsVars fromJson(Map json) => + (_i1.serializers.serializeWith(GcomparisonFieldsVars.serializer, this) + as Map); + static GcomparisonFieldsVars? fromJson(Map json) => _i1.serializers.deserializeWith(GcomparisonFieldsVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.g.dart b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.g.dart index d9d9fb9fa..4640d99b8 100644 --- a/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/fragments/hero_with_fragments.var.gql.g.dart @@ -24,22 +24,23 @@ class _$GHeroWithFragmentsVarsSerializer final String wireName = 'GHeroWithFragmentsVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroWithFragmentsVars object, {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.first != null) { + final result = []; + Object? value; + value = object.first; + if (value != null) { result ..add('first') - ..add(serializers.serialize(object.first, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } return result; } @override GHeroWithFragmentsVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroWithFragmentsVarsBuilder(); @@ -47,7 +48,7 @@ class _$GHeroWithFragmentsVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'first': result.first = serializers.deserialize(value, @@ -67,14 +68,14 @@ class _$GheroDataVarsSerializer implements StructuredSerializer { final String wireName = 'GheroDataVars'; @override - Iterable serialize(Serializers serializers, GheroDataVars object, + Iterable serialize(Serializers serializers, GheroDataVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override GheroDataVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GheroDataVarsBuilder().build(); } @@ -91,22 +92,23 @@ class _$GcomparisonFieldsVarsSerializer final String wireName = 'GcomparisonFieldsVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GcomparisonFieldsVars object, {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.first != null) { + final result = []; + Object? value; + value = object.first; + if (value != null) { result ..add('first') - ..add(serializers.serialize(object.first, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } return result; } @override GcomparisonFieldsVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GcomparisonFieldsVarsBuilder(); @@ -114,7 +116,7 @@ class _$GcomparisonFieldsVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'first': result.first = serializers.deserialize(value, @@ -129,10 +131,10 @@ class _$GcomparisonFieldsVarsSerializer class _$GHeroWithFragmentsVars extends GHeroWithFragmentsVars { @override - final int first; + final int? first; factory _$GHeroWithFragmentsVars( - [void Function(GHeroWithFragmentsVarsBuilder) updates]) => + [void Function(GHeroWithFragmentsVarsBuilder)? updates]) => (new GHeroWithFragmentsVarsBuilder()..update(updates)).build(); _$GHeroWithFragmentsVars._({this.first}) : super._(); @@ -167,17 +169,18 @@ class _$GHeroWithFragmentsVars extends GHeroWithFragmentsVars { class GHeroWithFragmentsVarsBuilder implements Builder { - _$GHeroWithFragmentsVars _$v; + _$GHeroWithFragmentsVars? _$v; - int _first; - int get first => _$this._first; - set first(int first) => _$this._first = first; + int? _first; + int? get first => _$this._first; + set first(int? first) => _$this._first = first; GHeroWithFragmentsVarsBuilder(); GHeroWithFragmentsVarsBuilder get _$this { - if (_$v != null) { - _first = _$v.first; + final $v = _$v; + if ($v != null) { + _first = $v.first; _$v = null; } return this; @@ -185,14 +188,12 @@ class GHeroWithFragmentsVarsBuilder @override void replace(GHeroWithFragmentsVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroWithFragmentsVars; } @override - void update(void Function(GHeroWithFragmentsVarsBuilder) updates) { + void update(void Function(GHeroWithFragmentsVarsBuilder)? updates) { if (updates != null) updates(this); } @@ -205,7 +206,7 @@ class GHeroWithFragmentsVarsBuilder } class _$GheroDataVars extends GheroDataVars { - factory _$GheroDataVars([void Function(GheroDataVarsBuilder) updates]) => + factory _$GheroDataVars([void Function(GheroDataVarsBuilder)? updates]) => (new GheroDataVarsBuilder()..update(updates)).build(); _$GheroDataVars._() : super._(); @@ -236,20 +237,18 @@ class _$GheroDataVars extends GheroDataVars { class GheroDataVarsBuilder implements Builder { - _$GheroDataVars _$v; + _$GheroDataVars? _$v; GheroDataVarsBuilder(); @override void replace(GheroDataVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GheroDataVars; } @override - void update(void Function(GheroDataVarsBuilder) updates) { + void update(void Function(GheroDataVarsBuilder)? updates) { if (updates != null) updates(this); } @@ -263,10 +262,10 @@ class GheroDataVarsBuilder class _$GcomparisonFieldsVars extends GcomparisonFieldsVars { @override - final int first; + final int? first; factory _$GcomparisonFieldsVars( - [void Function(GcomparisonFieldsVarsBuilder) updates]) => + [void Function(GcomparisonFieldsVarsBuilder)? updates]) => (new GcomparisonFieldsVarsBuilder()..update(updates)).build(); _$GcomparisonFieldsVars._({this.first}) : super._(); @@ -301,17 +300,18 @@ class _$GcomparisonFieldsVars extends GcomparisonFieldsVars { class GcomparisonFieldsVarsBuilder implements Builder { - _$GcomparisonFieldsVars _$v; + _$GcomparisonFieldsVars? _$v; - int _first; - int get first => _$this._first; - set first(int first) => _$this._first = first; + int? _first; + int? get first => _$this._first; + set first(int? first) => _$this._first = first; GcomparisonFieldsVarsBuilder(); GcomparisonFieldsVarsBuilder get _$this { - if (_$v != null) { - _first = _$v.first; + final $v = _$v; + if ($v != null) { + _first = $v.first; _$v = null; } return this; @@ -319,14 +319,12 @@ class GcomparisonFieldsVarsBuilder @override void replace(GcomparisonFieldsVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GcomparisonFieldsVars; } @override - void update(void Function(GcomparisonFieldsVarsBuilder) updates) { + void update(void Function(GcomparisonFieldsVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/codegen/end_to_end_test/lib/graphql/schema.schema.gql.dart b/codegen/end_to_end_test/lib/graphql/schema.schema.gql.dart index 82ebd8dc8..9ed9933a6 100644 --- a/codegen/end_to_end_test/lib/graphql/schema.schema.gql.dart +++ b/codegen/end_to_end_test/lib/graphql/schema.schema.gql.dart @@ -44,16 +44,14 @@ abstract class GReviewInput _$GReviewInput; int get stars; - @nullable - String get commentary; - @nullable - GColorInput get favorite_color; - @nullable - BuiltList get seenOn; + String? get commentary; + GColorInput? get favorite_color; + BuiltList? get seenOn; static Serializer get serializer => _$gReviewInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GReviewInput.serializer, this); - static GReviewInput fromJson(Map json) => + (_i1.serializers.serializeWith(GReviewInput.serializer, this) + as Map); + static GReviewInput? fromJson(Map json) => _i1.serializers.deserializeWith(GReviewInput.serializer, json); } @@ -67,20 +65,21 @@ abstract class GColorInput implements Built { int get blue; static Serializer get serializer => _$gColorInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GColorInput.serializer, this); - static GColorInput fromJson(Map json) => + (_i1.serializers.serializeWith(GColorInput.serializer, this) + as Map); + static GColorInput? fromJson(Map json) => _i1.serializers.deserializeWith(GColorInput.serializer, json); } abstract class GISODate implements Built { GISODate._(); - factory GISODate([String value]) => + factory GISODate([String? value]) => _$GISODate((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GISODate(serialized)); + (Object serialized) => GISODate((serialized as String?))); } diff --git a/codegen/end_to_end_test/lib/graphql/schema.schema.gql.g.dart b/codegen/end_to_end_test/lib/graphql/schema.schema.gql.g.dart index 0517f2015..2df32cec0 100644 --- a/codegen/end_to_end_test/lib/graphql/schema.schema.gql.g.dart +++ b/codegen/end_to_end_test/lib/graphql/schema.schema.gql.g.dart @@ -104,28 +104,32 @@ class _$GReviewInputSerializer implements StructuredSerializer { final String wireName = 'GReviewInput'; @override - Iterable serialize(Serializers serializers, GReviewInput object, + Iterable serialize(Serializers serializers, GReviewInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'stars', serializers.serialize(object.stars, specifiedType: const FullType(int)), ]; - if (object.commentary != null) { + Object? value; + value = object.commentary; + if (value != null) { result ..add('commentary') - ..add(serializers.serialize(object.commentary, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.favorite_color != null) { + value = object.favorite_color; + if (value != null) { result ..add('favorite_color') - ..add(serializers.serialize(object.favorite_color, + ..add(serializers.serialize(value, specifiedType: const FullType(GColorInput))); } - if (object.seenOn != null) { + value = object.seenOn; + if (value != null) { result ..add('seenOn') - ..add(serializers.serialize(object.seenOn, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [const FullType(DateTime)]))); } @@ -133,7 +137,8 @@ class _$GReviewInputSerializer implements StructuredSerializer { } @override - GReviewInput deserialize(Serializers serializers, Iterable serialized, + GReviewInput deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReviewInputBuilder(); @@ -141,7 +146,7 @@ class _$GReviewInputSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'stars': result.stars = serializers.deserialize(value, @@ -153,12 +158,12 @@ class _$GReviewInputSerializer implements StructuredSerializer { break; case 'favorite_color': result.favorite_color.replace(serializers.deserialize(value, - specifiedType: const FullType(GColorInput)) as GColorInput); + specifiedType: const FullType(GColorInput))! as GColorInput); break; case 'seenOn': result.seenOn.replace(serializers.deserialize(value, specifiedType: const FullType( - BuiltList, const [const FullType(DateTime)])) + BuiltList, const [const FullType(DateTime)]))! as BuiltList); break; } @@ -175,9 +180,9 @@ class _$GColorInputSerializer implements StructuredSerializer { final String wireName = 'GColorInput'; @override - Iterable serialize(Serializers serializers, GColorInput object, + Iterable serialize(Serializers serializers, GColorInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'red', serializers.serialize(object.red, specifiedType: const FullType(int)), 'green', @@ -190,7 +195,7 @@ class _$GColorInputSerializer implements StructuredSerializer { } @override - GColorInput deserialize(Serializers serializers, Iterable serialized, + GColorInput deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GColorInputBuilder(); @@ -198,7 +203,7 @@ class _$GColorInputSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'red': result.red = serializers.deserialize(value, @@ -223,21 +228,19 @@ class _$GReviewInput extends GReviewInput { @override final int stars; @override - final String commentary; + final String? commentary; @override - final GColorInput favorite_color; + final GColorInput? favorite_color; @override - final BuiltList seenOn; + final BuiltList? seenOn; - factory _$GReviewInput([void Function(GReviewInputBuilder) updates]) => + factory _$GReviewInput([void Function(GReviewInputBuilder)? updates]) => (new GReviewInputBuilder()..update(updates)).build(); _$GReviewInput._( - {this.stars, this.commentary, this.favorite_color, this.seenOn}) + {required this.stars, this.commentary, this.favorite_color, this.seenOn}) : super._() { - if (stars == null) { - throw new BuiltValueNullFieldError('GReviewInput', 'stars'); - } + BuiltValueNullFieldError.checkNotNull(stars, 'GReviewInput', 'stars'); } @override @@ -278,35 +281,36 @@ class _$GReviewInput extends GReviewInput { class GReviewInputBuilder implements Builder { - _$GReviewInput _$v; + _$GReviewInput? _$v; - int _stars; - int get stars => _$this._stars; - set stars(int stars) => _$this._stars = stars; + int? _stars; + int? get stars => _$this._stars; + set stars(int? stars) => _$this._stars = stars; - String _commentary; - String get commentary => _$this._commentary; - set commentary(String commentary) => _$this._commentary = commentary; + String? _commentary; + String? get commentary => _$this._commentary; + set commentary(String? commentary) => _$this._commentary = commentary; - GColorInputBuilder _favorite_color; + GColorInputBuilder? _favorite_color; GColorInputBuilder get favorite_color => _$this._favorite_color ??= new GColorInputBuilder(); - set favorite_color(GColorInputBuilder favorite_color) => + set favorite_color(GColorInputBuilder? favorite_color) => _$this._favorite_color = favorite_color; - ListBuilder _seenOn; + ListBuilder? _seenOn; ListBuilder get seenOn => _$this._seenOn ??= new ListBuilder(); - set seenOn(ListBuilder seenOn) => _$this._seenOn = seenOn; + set seenOn(ListBuilder? seenOn) => _$this._seenOn = seenOn; GReviewInputBuilder(); GReviewInputBuilder get _$this { - if (_$v != null) { - _stars = _$v.stars; - _commentary = _$v.commentary; - _favorite_color = _$v.favorite_color?.toBuilder(); - _seenOn = _$v.seenOn?.toBuilder(); + final $v = _$v; + if ($v != null) { + _stars = $v.stars; + _commentary = $v.commentary; + _favorite_color = $v.favorite_color?.toBuilder(); + _seenOn = $v.seenOn?.toBuilder(); _$v = null; } return this; @@ -314,14 +318,12 @@ class GReviewInputBuilder @override void replace(GReviewInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReviewInput; } @override - void update(void Function(GReviewInputBuilder) updates) { + void update(void Function(GReviewInputBuilder)? updates) { if (updates != null) updates(this); } @@ -331,12 +333,13 @@ class GReviewInputBuilder try { _$result = _$v ?? new _$GReviewInput._( - stars: stars, + stars: BuiltValueNullFieldError.checkNotNull( + stars, 'GReviewInput', 'stars'), commentary: commentary, favorite_color: _favorite_color?.build(), seenOn: _seenOn?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'favorite_color'; _favorite_color?.build(); @@ -361,19 +364,14 @@ class _$GColorInput extends GColorInput { @override final int blue; - factory _$GColorInput([void Function(GColorInputBuilder) updates]) => + factory _$GColorInput([void Function(GColorInputBuilder)? updates]) => (new GColorInputBuilder()..update(updates)).build(); - _$GColorInput._({this.red, this.green, this.blue}) : super._() { - if (red == null) { - throw new BuiltValueNullFieldError('GColorInput', 'red'); - } - if (green == null) { - throw new BuiltValueNullFieldError('GColorInput', 'green'); - } - if (blue == null) { - throw new BuiltValueNullFieldError('GColorInput', 'blue'); - } + _$GColorInput._({required this.red, required this.green, required this.blue}) + : super._() { + BuiltValueNullFieldError.checkNotNull(red, 'GColorInput', 'red'); + BuiltValueNullFieldError.checkNotNull(green, 'GColorInput', 'green'); + BuiltValueNullFieldError.checkNotNull(blue, 'GColorInput', 'blue'); } @override @@ -408,27 +406,28 @@ class _$GColorInput extends GColorInput { } class GColorInputBuilder implements Builder { - _$GColorInput _$v; + _$GColorInput? _$v; - int _red; - int get red => _$this._red; - set red(int red) => _$this._red = red; + int? _red; + int? get red => _$this._red; + set red(int? red) => _$this._red = red; - int _green; - int get green => _$this._green; - set green(int green) => _$this._green = green; + int? _green; + int? get green => _$this._green; + set green(int? green) => _$this._green = green; - int _blue; - int get blue => _$this._blue; - set blue(int blue) => _$this._blue = blue; + int? _blue; + int? get blue => _$this._blue; + set blue(int? blue) => _$this._blue = blue; GColorInputBuilder(); GColorInputBuilder get _$this { - if (_$v != null) { - _red = _$v.red; - _green = _$v.green; - _blue = _$v.blue; + final $v = _$v; + if ($v != null) { + _red = $v.red; + _green = $v.green; + _blue = $v.blue; _$v = null; } return this; @@ -436,21 +435,25 @@ class GColorInputBuilder implements Builder { @override void replace(GColorInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GColorInput; } @override - void update(void Function(GColorInputBuilder) updates) { + void update(void Function(GColorInputBuilder)? updates) { if (updates != null) updates(this); } @override _$GColorInput build() { - final _$result = - _$v ?? new _$GColorInput._(red: red, green: green, blue: blue); + final _$result = _$v ?? + new _$GColorInput._( + red: BuiltValueNullFieldError.checkNotNull( + red, 'GColorInput', 'red'), + green: BuiltValueNullFieldError.checkNotNull( + green, 'GColorInput', 'green'), + blue: BuiltValueNullFieldError.checkNotNull( + blue, 'GColorInput', 'blue')); replace(_$result); return _$result; } @@ -460,13 +463,11 @@ class _$GISODate extends GISODate { @override final String value; - factory _$GISODate([void Function(GISODateBuilder) updates]) => + factory _$GISODate([void Function(GISODateBuilder)? updates]) => (new GISODateBuilder()..update(updates)).build(); - _$GISODate._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GISODate', 'value'); - } + _$GISODate._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GISODate', 'value'); } @override @@ -495,17 +496,18 @@ class _$GISODate extends GISODate { } class GISODateBuilder implements Builder { - _$GISODate _$v; + _$GISODate? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GISODateBuilder(); GISODateBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -513,20 +515,21 @@ class GISODateBuilder implements Builder { @override void replace(GISODate other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GISODate; } @override - void update(void Function(GISODateBuilder) updates) { + void update(void Function(GISODateBuilder)? updates) { if (updates != null) updates(this); } @override _$GISODate build() { - final _$result = _$v ?? new _$GISODate._(value: value); + final _$result = _$v ?? + new _$GISODate._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GISODate', 'value')); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.dart b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.dart index 1b737a7b4..04104fc5a 100644 --- a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.dart +++ b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.dart @@ -20,13 +20,13 @@ abstract class GHeroForEpisodeData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GHeroForEpisodeData_hero get hero; + GHeroForEpisodeData_hero? get hero; static Serializer get serializer => _$gHeroForEpisodeDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GHeroForEpisodeData.serializer, this); - static GHeroForEpisodeData fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroForEpisodeData.serializer, this) + as Map); + static GHeroForEpisodeData? fromJson(Map json) => _i1.serializers.deserializeWith(GHeroForEpisodeData.serializer, json); } @@ -34,16 +34,16 @@ abstract class GHeroForEpisodeData_hero { @BuiltValueField(wireName: '__typename') String get G__typename; String get name; - @nullable - BuiltList get friends; + BuiltList? get friends; static Serializer get serializer => _i2.InlineFragmentSerializer( 'GHeroForEpisodeData_hero', GHeroForEpisodeData_hero__base, [GHeroForEpisodeData_hero__asDroid]); Map toJson() => - _i1.serializers.serializeWith(GHeroForEpisodeData_hero.serializer, this); - static GHeroForEpisodeData_hero fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroForEpisodeData_hero.serializer, this) + as Map); + static GHeroForEpisodeData_hero? fromJson(Map json) => _i1.serializers .deserializeWith(GHeroForEpisodeData_hero.serializer, json); } @@ -64,13 +64,12 @@ abstract class GHeroForEpisodeData_hero__base @BuiltValueField(wireName: '__typename') String get G__typename; String get name; - @nullable - BuiltList get friends; + BuiltList? get friends; static Serializer get serializer => _$gHeroForEpisodeDataHeroBaseSerializer; - Map toJson() => _i1.serializers - .serializeWith(GHeroForEpisodeData_hero__base.serializer, this); - static GHeroForEpisodeData_hero__base fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GHeroForEpisodeData_hero__base.serializer, this) as Map); + static GHeroForEpisodeData_hero__base? fromJson(Map json) => _i1.serializers .deserializeWith(GHeroForEpisodeData_hero__base.serializer, json); } @@ -94,9 +93,10 @@ abstract class GHeroForEpisodeData_hero__base_friends String get name; static Serializer get serializer => _$gHeroForEpisodeDataHeroBaseFriendsSerializer; - Map toJson() => _i1.serializers - .serializeWith(GHeroForEpisodeData_hero__base_friends.serializer, this); - static GHeroForEpisodeData_hero__base_friends fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GHeroForEpisodeData_hero__base_friends.serializer, this) + as Map); + static GHeroForEpisodeData_hero__base_friends? fromJson( Map json) => _i1.serializers.deserializeWith( GHeroForEpisodeData_hero__base_friends.serializer, json); @@ -119,15 +119,14 @@ abstract class GHeroForEpisodeData_hero__asDroid @BuiltValueField(wireName: '__typename') String get G__typename; String get name; - @nullable - BuiltList get friends; - @nullable - String get primaryFunction; + BuiltList? get friends; + String? get primaryFunction; static Serializer get serializer => _$gHeroForEpisodeDataHeroAsDroidSerializer; - Map toJson() => _i1.serializers - .serializeWith(GHeroForEpisodeData_hero__asDroid.serializer, this); - static GHeroForEpisodeData_hero__asDroid fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GHeroForEpisodeData_hero__asDroid.serializer, this) + as Map); + static GHeroForEpisodeData_hero__asDroid? fromJson( Map json) => _i1.serializers .deserializeWith(GHeroForEpisodeData_hero__asDroid.serializer, json); @@ -152,9 +151,10 @@ abstract class GHeroForEpisodeData_hero__asDroid_friends String get name; static Serializer get serializer => _$gHeroForEpisodeDataHeroAsDroidFriendsSerializer; - Map toJson() => _i1.serializers.serializeWith( - GHeroForEpisodeData_hero__asDroid_friends.serializer, this); - static GHeroForEpisodeData_hero__asDroid_friends fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GHeroForEpisodeData_hero__asDroid_friends.serializer, this) + as Map); + static GHeroForEpisodeData_hero__asDroid_friends? fromJson( Map json) => _i1.serializers.deserializeWith( GHeroForEpisodeData_hero__asDroid_friends.serializer, json); @@ -168,7 +168,7 @@ abstract class GHeroForEpisodeData_hero_friends { abstract class GDroidFragment { String get G__typename; - String get primaryFunction; + String? get primaryFunction; Map toJson(); } @@ -185,12 +185,12 @@ abstract class GDroidFragmentData b..G__typename = 'Droid'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get primaryFunction; + String? get primaryFunction; static Serializer get serializer => _$gDroidFragmentDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GDroidFragmentData.serializer, this); - static GDroidFragmentData fromJson(Map json) => + (_i1.serializers.serializeWith(GDroidFragmentData.serializer, this) + as Map); + static GDroidFragmentData? fromJson(Map json) => _i1.serializers.deserializeWith(GDroidFragmentData.serializer, json); } diff --git a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.g.dart b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.g.dart index 8eaa291af..16f708bd0 100644 --- a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.data.gql.g.dart @@ -34,18 +34,20 @@ class _$GHeroForEpisodeDataSerializer final String wireName = 'GHeroForEpisodeData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroForEpisodeData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.hero != null) { + Object? value; + value = object.hero; + if (value != null) { result ..add('hero') - ..add(serializers.serialize(object.hero, + ..add(serializers.serialize(value, specifiedType: const FullType(GHeroForEpisodeData_hero))); } return result; @@ -53,7 +55,7 @@ class _$GHeroForEpisodeDataSerializer @override GHeroForEpisodeData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeDataBuilder(); @@ -61,7 +63,7 @@ class _$GHeroForEpisodeDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -90,20 +92,22 @@ class _$GHeroForEpisodeData_hero__baseSerializer final String wireName = 'GHeroForEpisodeData_hero__base'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroForEpisodeData_hero__base object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), ]; - if (object.friends != null) { + Object? value; + value = object.friends; + if (value != null) { result ..add('friends') - ..add(serializers.serialize(object.friends, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GHeroForEpisodeData_hero__base_friends) ]))); @@ -113,7 +117,7 @@ class _$GHeroForEpisodeData_hero__baseSerializer @override GHeroForEpisodeData_hero__base deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeData_hero__baseBuilder(); @@ -121,7 +125,7 @@ class _$GHeroForEpisodeData_hero__baseSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -135,7 +139,7 @@ class _$GHeroForEpisodeData_hero__baseSerializer result.friends.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GHeroForEpisodeData_hero__base_friends) - ])) as BuiltList); + ]))! as BuiltList); break; } } @@ -155,10 +159,10 @@ class _$GHeroForEpisodeData_hero__base_friendsSerializer final String wireName = 'GHeroForEpisodeData_hero__base_friends'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroForEpisodeData_hero__base_friends object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -171,7 +175,7 @@ class _$GHeroForEpisodeData_hero__base_friendsSerializer @override GHeroForEpisodeData_hero__base_friends deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeData_hero__base_friendsBuilder(); @@ -179,7 +183,7 @@ class _$GHeroForEpisodeData_hero__base_friendsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -207,28 +211,31 @@ class _$GHeroForEpisodeData_hero__asDroidSerializer final String wireName = 'GHeroForEpisodeData_hero__asDroid'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroForEpisodeData_hero__asDroid object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), ]; - if (object.friends != null) { + Object? value; + value = object.friends; + if (value != null) { result ..add('friends') - ..add(serializers.serialize(object.friends, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GHeroForEpisodeData_hero__asDroid_friends) ]))); } - if (object.primaryFunction != null) { + value = object.primaryFunction; + if (value != null) { result ..add('primaryFunction') - ..add(serializers.serialize(object.primaryFunction, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -236,7 +243,7 @@ class _$GHeroForEpisodeData_hero__asDroidSerializer @override GHeroForEpisodeData_hero__asDroid deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeData_hero__asDroidBuilder(); @@ -244,7 +251,7 @@ class _$GHeroForEpisodeData_hero__asDroidSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -258,7 +265,7 @@ class _$GHeroForEpisodeData_hero__asDroidSerializer result.friends.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GHeroForEpisodeData_hero__asDroid_friends) - ])) as BuiltList); + ]))! as BuiltList); break; case 'primaryFunction': result.primaryFunction = serializers.deserialize(value, @@ -282,10 +289,10 @@ class _$GHeroForEpisodeData_hero__asDroid_friendsSerializer final String wireName = 'GHeroForEpisodeData_hero__asDroid_friends'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroForEpisodeData_hero__asDroid_friends object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -298,7 +305,7 @@ class _$GHeroForEpisodeData_hero__asDroid_friendsSerializer @override GHeroForEpisodeData_hero__asDroid_friends deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeData_hero__asDroid_friendsBuilder(); @@ -306,7 +313,7 @@ class _$GHeroForEpisodeData_hero__asDroid_friendsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -331,17 +338,20 @@ class _$GDroidFragmentDataSerializer final String wireName = 'GDroidFragmentData'; @override - Iterable serialize(Serializers serializers, GDroidFragmentData object, + Iterable serialize( + Serializers serializers, GDroidFragmentData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.primaryFunction != null) { + Object? value; + value = object.primaryFunction; + if (value != null) { result ..add('primaryFunction') - ..add(serializers.serialize(object.primaryFunction, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -349,7 +359,7 @@ class _$GDroidFragmentDataSerializer @override GDroidFragmentData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDroidFragmentDataBuilder(); @@ -357,7 +367,7 @@ class _$GDroidFragmentDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -378,16 +388,15 @@ class _$GHeroForEpisodeData extends GHeroForEpisodeData { @override final String G__typename; @override - final GHeroForEpisodeData_hero hero; + final GHeroForEpisodeData_hero? hero; factory _$GHeroForEpisodeData( - [void Function(GHeroForEpisodeDataBuilder) updates]) => + [void Function(GHeroForEpisodeDataBuilder)? updates]) => (new GHeroForEpisodeDataBuilder()..update(updates)).build(); - _$GHeroForEpisodeData._({this.G__typename, this.hero}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GHeroForEpisodeData', 'G__typename'); - } + _$GHeroForEpisodeData._({required this.G__typename, this.hero}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroForEpisodeData', 'G__typename'); } @override @@ -423,24 +432,25 @@ class _$GHeroForEpisodeData extends GHeroForEpisodeData { class GHeroForEpisodeDataBuilder implements Builder { - _$GHeroForEpisodeData _$v; + _$GHeroForEpisodeData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GHeroForEpisodeData_hero _hero; - GHeroForEpisodeData_hero get hero => _$this._hero; - set hero(GHeroForEpisodeData_hero hero) => _$this._hero = hero; + GHeroForEpisodeData_hero? _hero; + GHeroForEpisodeData_hero? get hero => _$this._hero; + set hero(GHeroForEpisodeData_hero? hero) => _$this._hero = hero; GHeroForEpisodeDataBuilder() { GHeroForEpisodeData._initializeBuilder(this); } GHeroForEpisodeDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _hero = _$v.hero; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _hero = $v.hero; _$v = null; } return this; @@ -448,21 +458,22 @@ class GHeroForEpisodeDataBuilder @override void replace(GHeroForEpisodeData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisodeData; } @override - void update(void Function(GHeroForEpisodeDataBuilder) updates) { + void update(void Function(GHeroForEpisodeDataBuilder)? updates) { if (updates != null) updates(this); } @override _$GHeroForEpisodeData build() { final _$result = _$v ?? - new _$GHeroForEpisodeData._(G__typename: G__typename, hero: hero); + new _$GHeroForEpisodeData._( + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroForEpisodeData', 'G__typename'), + hero: hero); replace(_$result); return _$result; } @@ -474,23 +485,19 @@ class _$GHeroForEpisodeData_hero__base extends GHeroForEpisodeData_hero__base { @override final String name; @override - final BuiltList friends; + final BuiltList? friends; factory _$GHeroForEpisodeData_hero__base( - [void Function(GHeroForEpisodeData_hero__baseBuilder) updates]) => + [void Function(GHeroForEpisodeData_hero__baseBuilder)? updates]) => (new GHeroForEpisodeData_hero__baseBuilder()..update(updates)).build(); _$GHeroForEpisodeData_hero__base._( - {this.G__typename, this.name, this.friends}) + {required this.G__typename, required this.name, this.friends}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__base', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__base', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroForEpisodeData_hero__base', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__base', 'name'); } @override @@ -531,21 +538,21 @@ class GHeroForEpisodeData_hero__baseBuilder implements Builder { - _$GHeroForEpisodeData_hero__base _$v; + _$GHeroForEpisodeData_hero__base? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - ListBuilder _friends; + ListBuilder? _friends; ListBuilder get friends => _$this._friends ??= new ListBuilder(); - set friends(ListBuilder friends) => + set friends(ListBuilder? friends) => _$this._friends = friends; GHeroForEpisodeData_hero__baseBuilder() { @@ -553,10 +560,11 @@ class GHeroForEpisodeData_hero__baseBuilder } GHeroForEpisodeData_hero__baseBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; - _friends = _$v.friends?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; + _friends = $v.friends?.toBuilder(); _$v = null; } return this; @@ -564,14 +572,12 @@ class GHeroForEpisodeData_hero__baseBuilder @override void replace(GHeroForEpisodeData_hero__base other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisodeData_hero__base; } @override - void update(void Function(GHeroForEpisodeData_hero__baseBuilder) updates) { + void update(void Function(GHeroForEpisodeData_hero__baseBuilder)? updates) { if (updates != null) updates(this); } @@ -581,9 +587,13 @@ class GHeroForEpisodeData_hero__baseBuilder try { _$result = _$v ?? new _$GHeroForEpisodeData_hero__base._( - G__typename: G__typename, name: name, friends: _friends?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroForEpisodeData_hero__base', 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__base', 'name'), + friends: _friends?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'friends'; _friends?.build(); @@ -606,21 +616,18 @@ class _$GHeroForEpisodeData_hero__base_friends final String name; factory _$GHeroForEpisodeData_hero__base_friends( - [void Function(GHeroForEpisodeData_hero__base_friendsBuilder) + [void Function(GHeroForEpisodeData_hero__base_friendsBuilder)? updates]) => (new GHeroForEpisodeData_hero__base_friendsBuilder()..update(updates)) .build(); - _$GHeroForEpisodeData_hero__base_friends._({this.G__typename, this.name}) + _$GHeroForEpisodeData_hero__base_friends._( + {required this.G__typename, required this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__base_friends', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__base_friends', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroForEpisodeData_hero__base_friends', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__base_friends', 'name'); } @override @@ -660,24 +667,25 @@ class GHeroForEpisodeData_hero__base_friendsBuilder implements Builder { - _$GHeroForEpisodeData_hero__base_friends _$v; + _$GHeroForEpisodeData_hero__base_friends? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GHeroForEpisodeData_hero__base_friendsBuilder() { GHeroForEpisodeData_hero__base_friends._initializeBuilder(this); } GHeroForEpisodeData_hero__base_friendsBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; _$v = null; } return this; @@ -685,15 +693,13 @@ class GHeroForEpisodeData_hero__base_friendsBuilder @override void replace(GHeroForEpisodeData_hero__base_friends other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisodeData_hero__base_friends; } @override void update( - void Function(GHeroForEpisodeData_hero__base_friendsBuilder) updates) { + void Function(GHeroForEpisodeData_hero__base_friendsBuilder)? updates) { if (updates != null) updates(this); } @@ -701,7 +707,10 @@ class GHeroForEpisodeData_hero__base_friendsBuilder _$GHeroForEpisodeData_hero__base_friends build() { final _$result = _$v ?? new _$GHeroForEpisodeData_hero__base_friends._( - G__typename: G__typename, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GHeroForEpisodeData_hero__base_friends', 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__base_friends', 'name')); replace(_$result); return _$result; } @@ -714,25 +723,24 @@ class _$GHeroForEpisodeData_hero__asDroid @override final String name; @override - final BuiltList friends; + final BuiltList? friends; @override - final String primaryFunction; + final String? primaryFunction; factory _$GHeroForEpisodeData_hero__asDroid( - [void Function(GHeroForEpisodeData_hero__asDroidBuilder) updates]) => + [void Function(GHeroForEpisodeData_hero__asDroidBuilder)? updates]) => (new GHeroForEpisodeData_hero__asDroidBuilder()..update(updates)).build(); _$GHeroForEpisodeData_hero__asDroid._( - {this.G__typename, this.name, this.friends, this.primaryFunction}) + {required this.G__typename, + required this.name, + this.friends, + this.primaryFunction}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__asDroid', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__asDroid', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroForEpisodeData_hero__asDroid', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__asDroid', 'name'); } @override @@ -776,26 +784,27 @@ class GHeroForEpisodeData_hero__asDroidBuilder implements Builder { - _$GHeroForEpisodeData_hero__asDroid _$v; + _$GHeroForEpisodeData_hero__asDroid? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - ListBuilder _friends; + ListBuilder? _friends; ListBuilder get friends => _$this._friends ??= new ListBuilder(); - set friends(ListBuilder friends) => + set friends( + ListBuilder? friends) => _$this._friends = friends; - String _primaryFunction; - String get primaryFunction => _$this._primaryFunction; - set primaryFunction(String primaryFunction) => + String? _primaryFunction; + String? get primaryFunction => _$this._primaryFunction; + set primaryFunction(String? primaryFunction) => _$this._primaryFunction = primaryFunction; GHeroForEpisodeData_hero__asDroidBuilder() { @@ -803,11 +812,12 @@ class GHeroForEpisodeData_hero__asDroidBuilder } GHeroForEpisodeData_hero__asDroidBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; - _friends = _$v.friends?.toBuilder(); - _primaryFunction = _$v.primaryFunction; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; + _friends = $v.friends?.toBuilder(); + _primaryFunction = $v.primaryFunction; _$v = null; } return this; @@ -815,14 +825,13 @@ class GHeroForEpisodeData_hero__asDroidBuilder @override void replace(GHeroForEpisodeData_hero__asDroid other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisodeData_hero__asDroid; } @override - void update(void Function(GHeroForEpisodeData_hero__asDroidBuilder) updates) { + void update( + void Function(GHeroForEpisodeData_hero__asDroidBuilder)? updates) { if (updates != null) updates(this); } @@ -832,12 +841,14 @@ class GHeroForEpisodeData_hero__asDroidBuilder try { _$result = _$v ?? new _$GHeroForEpisodeData_hero__asDroid._( - G__typename: G__typename, - name: name, + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GHeroForEpisodeData_hero__asDroid', 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__asDroid', 'name'), friends: _friends?.build(), primaryFunction: primaryFunction); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'friends'; _friends?.build(); @@ -860,21 +871,18 @@ class _$GHeroForEpisodeData_hero__asDroid_friends final String name; factory _$GHeroForEpisodeData_hero__asDroid_friends( - [void Function(GHeroForEpisodeData_hero__asDroid_friendsBuilder) + [void Function(GHeroForEpisodeData_hero__asDroid_friendsBuilder)? updates]) => (new GHeroForEpisodeData_hero__asDroid_friendsBuilder()..update(updates)) .build(); - _$GHeroForEpisodeData_hero__asDroid_friends._({this.G__typename, this.name}) + _$GHeroForEpisodeData_hero__asDroid_friends._( + {required this.G__typename, required this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__asDroid_friends', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GHeroForEpisodeData_hero__asDroid_friends', 'name'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GHeroForEpisodeData_hero__asDroid_friends', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__asDroid_friends', 'name'); } @override @@ -914,24 +922,25 @@ class GHeroForEpisodeData_hero__asDroid_friendsBuilder implements Builder { - _$GHeroForEpisodeData_hero__asDroid_friends _$v; + _$GHeroForEpisodeData_hero__asDroid_friends? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GHeroForEpisodeData_hero__asDroid_friendsBuilder() { GHeroForEpisodeData_hero__asDroid_friends._initializeBuilder(this); } GHeroForEpisodeData_hero__asDroid_friendsBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; _$v = null; } return this; @@ -939,15 +948,14 @@ class GHeroForEpisodeData_hero__asDroid_friendsBuilder @override void replace(GHeroForEpisodeData_hero__asDroid_friends other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisodeData_hero__asDroid_friends; } @override void update( - void Function(GHeroForEpisodeData_hero__asDroid_friendsBuilder) updates) { + void Function(GHeroForEpisodeData_hero__asDroid_friendsBuilder)? + updates) { if (updates != null) updates(this); } @@ -955,7 +963,10 @@ class GHeroForEpisodeData_hero__asDroid_friendsBuilder _$GHeroForEpisodeData_hero__asDroid_friends build() { final _$result = _$v ?? new _$GHeroForEpisodeData_hero__asDroid_friends._( - G__typename: G__typename, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GHeroForEpisodeData_hero__asDroid_friends', 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHeroForEpisodeData_hero__asDroid_friends', 'name')); replace(_$result); return _$result; } @@ -965,16 +976,16 @@ class _$GDroidFragmentData extends GDroidFragmentData { @override final String G__typename; @override - final String primaryFunction; + final String? primaryFunction; factory _$GDroidFragmentData( - [void Function(GDroidFragmentDataBuilder) updates]) => + [void Function(GDroidFragmentDataBuilder)? updates]) => (new GDroidFragmentDataBuilder()..update(updates)).build(); - _$GDroidFragmentData._({this.G__typename, this.primaryFunction}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GDroidFragmentData', 'G__typename'); - } + _$GDroidFragmentData._({required this.G__typename, this.primaryFunction}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GDroidFragmentData', 'G__typename'); } @override @@ -1010,15 +1021,15 @@ class _$GDroidFragmentData extends GDroidFragmentData { class GDroidFragmentDataBuilder implements Builder { - _$GDroidFragmentData _$v; + _$GDroidFragmentData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _primaryFunction; - String get primaryFunction => _$this._primaryFunction; - set primaryFunction(String primaryFunction) => + String? _primaryFunction; + String? get primaryFunction => _$this._primaryFunction; + set primaryFunction(String? primaryFunction) => _$this._primaryFunction = primaryFunction; GDroidFragmentDataBuilder() { @@ -1026,9 +1037,10 @@ class GDroidFragmentDataBuilder } GDroidFragmentDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _primaryFunction = _$v.primaryFunction; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _primaryFunction = $v.primaryFunction; _$v = null; } return this; @@ -1036,14 +1048,12 @@ class GDroidFragmentDataBuilder @override void replace(GDroidFragmentData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDroidFragmentData; } @override - void update(void Function(GDroidFragmentDataBuilder) updates) { + void update(void Function(GDroidFragmentDataBuilder)? updates) { if (updates != null) updates(this); } @@ -1051,7 +1061,9 @@ class GDroidFragmentDataBuilder _$GDroidFragmentData build() { final _$result = _$v ?? new _$GDroidFragmentData._( - G__typename: G__typename, primaryFunction: primaryFunction); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GDroidFragmentData', 'G__typename'), + primaryFunction: primaryFunction); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.dart b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.dart index 7db131824..76b96b365 100644 --- a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.dart +++ b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.dart @@ -26,7 +26,8 @@ abstract class GHeroForEpisode static Serializer get serializer => _$gHeroForEpisodeSerializer; Map toJson() => - _i4.serializers.serializeWith(GHeroForEpisode.serializer, this); - static GHeroForEpisode fromJson(Map json) => + (_i4.serializers.serializeWith(GHeroForEpisode.serializer, this) + as Map); + static GHeroForEpisode? fromJson(Map json) => _i4.serializers.deserializeWith(GHeroForEpisode.serializer, json); } diff --git a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.g.dart b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.g.dart index 85fca1e7d..ff876fa17 100644 --- a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.req.gql.g.dart @@ -17,9 +17,9 @@ class _$GHeroForEpisodeSerializer final String wireName = 'GHeroForEpisode'; @override - Iterable serialize(Serializers serializers, GHeroForEpisode object, + Iterable serialize(Serializers serializers, GHeroForEpisode object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GHeroForEpisodeVars)), @@ -33,7 +33,7 @@ class _$GHeroForEpisodeSerializer @override GHeroForEpisode deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeBuilder(); @@ -41,11 +41,11 @@ class _$GHeroForEpisodeSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GHeroForEpisodeVars)) + specifiedType: const FullType(_i3.GHeroForEpisodeVars))! as _i3.GHeroForEpisodeVars); break; case 'operation': @@ -65,16 +65,14 @@ class _$GHeroForEpisode extends GHeroForEpisode { @override final _i1.Operation operation; - factory _$GHeroForEpisode([void Function(GHeroForEpisodeBuilder) updates]) => + factory _$GHeroForEpisode([void Function(GHeroForEpisodeBuilder)? updates]) => (new GHeroForEpisodeBuilder()..update(updates)).build(); - _$GHeroForEpisode._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GHeroForEpisode', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GHeroForEpisode', 'operation'); - } + _$GHeroForEpisode._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GHeroForEpisode', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GHeroForEpisode', 'operation'); } @override @@ -109,25 +107,26 @@ class _$GHeroForEpisode extends GHeroForEpisode { class GHeroForEpisodeBuilder implements Builder { - _$GHeroForEpisode _$v; + _$GHeroForEpisode? _$v; - _i3.GHeroForEpisodeVarsBuilder _vars; + _i3.GHeroForEpisodeVarsBuilder? _vars; _i3.GHeroForEpisodeVarsBuilder get vars => _$this._vars ??= new _i3.GHeroForEpisodeVarsBuilder(); - set vars(_i3.GHeroForEpisodeVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GHeroForEpisodeVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GHeroForEpisodeBuilder() { GHeroForEpisode._initializeBuilder(this); } GHeroForEpisodeBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -135,14 +134,12 @@ class GHeroForEpisodeBuilder @override void replace(GHeroForEpisode other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisode; } @override - void update(void Function(GHeroForEpisodeBuilder) updates) { + void update(void Function(GHeroForEpisodeBuilder)? updates) { if (updates != null) updates(this); } @@ -151,9 +148,12 @@ class GHeroForEpisodeBuilder _$GHeroForEpisode _$result; try { _$result = _$v ?? - new _$GHeroForEpisode._(vars: vars.build(), operation: operation); + new _$GHeroForEpisode._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GHeroForEpisode', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.dart b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.dart index e1701a05c..21fb27bcc 100644 --- a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.dart +++ b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.dart @@ -18,8 +18,9 @@ abstract class GHeroForEpisodeVars static Serializer get serializer => _$gHeroForEpisodeVarsSerializer; Map toJson() => - _i2.serializers.serializeWith(GHeroForEpisodeVars.serializer, this); - static GHeroForEpisodeVars fromJson(Map json) => + (_i2.serializers.serializeWith(GHeroForEpisodeVars.serializer, this) + as Map); + static GHeroForEpisodeVars? fromJson(Map json) => _i2.serializers.deserializeWith(GHeroForEpisodeVars.serializer, json); } @@ -33,7 +34,8 @@ abstract class GDroidFragmentVars static Serializer get serializer => _$gDroidFragmentVarsSerializer; Map toJson() => - _i2.serializers.serializeWith(GDroidFragmentVars.serializer, this); - static GDroidFragmentVars fromJson(Map json) => + (_i2.serializers.serializeWith(GDroidFragmentVars.serializer, this) + as Map); + static GDroidFragmentVars? fromJson(Map json) => _i2.serializers.deserializeWith(GDroidFragmentVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.g.dart b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.g.dart index 343ef7b32..1e38e515f 100644 --- a/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/interfaces/hero_for_episode.var.gql.g.dart @@ -22,10 +22,10 @@ class _$GHeroForEpisodeVarsSerializer final String wireName = 'GHeroForEpisodeVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroForEpisodeVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'ep', serializers.serialize(object.ep, specifiedType: const FullType(_i1.GEpisode)), @@ -36,7 +36,7 @@ class _$GHeroForEpisodeVarsSerializer @override GHeroForEpisodeVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroForEpisodeVarsBuilder(); @@ -44,7 +44,7 @@ class _$GHeroForEpisodeVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'ep': result.ep = serializers.deserialize(value, @@ -65,14 +65,15 @@ class _$GDroidFragmentVarsSerializer final String wireName = 'GDroidFragmentVars'; @override - Iterable serialize(Serializers serializers, GDroidFragmentVars object, + Iterable serialize( + Serializers serializers, GDroidFragmentVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override GDroidFragmentVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GDroidFragmentVarsBuilder().build(); } @@ -83,13 +84,11 @@ class _$GHeroForEpisodeVars extends GHeroForEpisodeVars { final _i1.GEpisode ep; factory _$GHeroForEpisodeVars( - [void Function(GHeroForEpisodeVarsBuilder) updates]) => + [void Function(GHeroForEpisodeVarsBuilder)? updates]) => (new GHeroForEpisodeVarsBuilder()..update(updates)).build(); - _$GHeroForEpisodeVars._({this.ep}) : super._() { - if (ep == null) { - throw new BuiltValueNullFieldError('GHeroForEpisodeVars', 'ep'); - } + _$GHeroForEpisodeVars._({required this.ep}) : super._() { + BuiltValueNullFieldError.checkNotNull(ep, 'GHeroForEpisodeVars', 'ep'); } @override @@ -121,17 +120,18 @@ class _$GHeroForEpisodeVars extends GHeroForEpisodeVars { class GHeroForEpisodeVarsBuilder implements Builder { - _$GHeroForEpisodeVars _$v; + _$GHeroForEpisodeVars? _$v; - _i1.GEpisode _ep; - _i1.GEpisode get ep => _$this._ep; - set ep(_i1.GEpisode ep) => _$this._ep = ep; + _i1.GEpisode? _ep; + _i1.GEpisode? get ep => _$this._ep; + set ep(_i1.GEpisode? ep) => _$this._ep = ep; GHeroForEpisodeVarsBuilder(); GHeroForEpisodeVarsBuilder get _$this { - if (_$v != null) { - _ep = _$v.ep; + final $v = _$v; + if ($v != null) { + _ep = $v.ep; _$v = null; } return this; @@ -139,20 +139,21 @@ class GHeroForEpisodeVarsBuilder @override void replace(GHeroForEpisodeVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroForEpisodeVars; } @override - void update(void Function(GHeroForEpisodeVarsBuilder) updates) { + void update(void Function(GHeroForEpisodeVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GHeroForEpisodeVars build() { - final _$result = _$v ?? new _$GHeroForEpisodeVars._(ep: ep); + final _$result = _$v ?? + new _$GHeroForEpisodeVars._( + ep: BuiltValueNullFieldError.checkNotNull( + ep, 'GHeroForEpisodeVars', 'ep')); replace(_$result); return _$result; } @@ -160,7 +161,7 @@ class GHeroForEpisodeVarsBuilder class _$GDroidFragmentVars extends GDroidFragmentVars { factory _$GDroidFragmentVars( - [void Function(GDroidFragmentVarsBuilder) updates]) => + [void Function(GDroidFragmentVarsBuilder)? updates]) => (new GDroidFragmentVarsBuilder()..update(updates)).build(); _$GDroidFragmentVars._() : super._(); @@ -193,20 +194,18 @@ class _$GDroidFragmentVars extends GDroidFragmentVars { class GDroidFragmentVarsBuilder implements Builder { - _$GDroidFragmentVars _$v; + _$GDroidFragmentVars? _$v; GDroidFragmentVarsBuilder(); @override void replace(GDroidFragmentVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDroidFragmentVars; } @override - void update(void Function(GDroidFragmentVarsBuilder) updates) { + void update(void Function(GDroidFragmentVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.dart b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.dart index b9fcc777d..50cc0b17b 100644 --- a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.dart +++ b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.dart @@ -17,13 +17,13 @@ abstract class GHeroNoVarsData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GHeroNoVarsData_hero get hero; + GHeroNoVarsData_hero? get hero; static Serializer get serializer => _$gHeroNoVarsDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GHeroNoVarsData.serializer, this); - static GHeroNoVarsData fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroNoVarsData.serializer, this) + as Map); + static GHeroNoVarsData? fromJson(Map json) => _i1.serializers.deserializeWith(GHeroNoVarsData.serializer, json); } @@ -44,7 +44,8 @@ abstract class GHeroNoVarsData_hero static Serializer get serializer => _$gHeroNoVarsDataHeroSerializer; Map toJson() => - _i1.serializers.serializeWith(GHeroNoVarsData_hero.serializer, this); - static GHeroNoVarsData_hero fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroNoVarsData_hero.serializer, this) + as Map); + static GHeroNoVarsData_hero? fromJson(Map json) => _i1.serializers.deserializeWith(GHeroNoVarsData_hero.serializer, json); } diff --git a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.g.dart b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.g.dart index c8c20915b..82feae7e8 100644 --- a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.data.gql.g.dart @@ -19,17 +19,19 @@ class _$GHeroNoVarsDataSerializer final String wireName = 'GHeroNoVarsData'; @override - Iterable serialize(Serializers serializers, GHeroNoVarsData object, + Iterable serialize(Serializers serializers, GHeroNoVarsData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.hero != null) { + Object? value; + value = object.hero; + if (value != null) { result ..add('hero') - ..add(serializers.serialize(object.hero, + ..add(serializers.serialize(value, specifiedType: const FullType(GHeroNoVarsData_hero))); } return result; @@ -37,7 +39,7 @@ class _$GHeroNoVarsDataSerializer @override GHeroNoVarsData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroNoVarsDataBuilder(); @@ -45,7 +47,7 @@ class _$GHeroNoVarsDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -53,7 +55,7 @@ class _$GHeroNoVarsDataSerializer break; case 'hero': result.hero.replace(serializers.deserialize(value, - specifiedType: const FullType(GHeroNoVarsData_hero)) + specifiedType: const FullType(GHeroNoVarsData_hero))! as GHeroNoVarsData_hero); break; } @@ -74,10 +76,10 @@ class _$GHeroNoVarsData_heroSerializer final String wireName = 'GHeroNoVarsData_hero'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHeroNoVarsData_hero object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -92,7 +94,7 @@ class _$GHeroNoVarsData_heroSerializer @override GHeroNoVarsData_hero deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroNoVarsData_heroBuilder(); @@ -100,7 +102,7 @@ class _$GHeroNoVarsData_heroSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -125,15 +127,14 @@ class _$GHeroNoVarsData extends GHeroNoVarsData { @override final String G__typename; @override - final GHeroNoVarsData_hero hero; + final GHeroNoVarsData_hero? hero; - factory _$GHeroNoVarsData([void Function(GHeroNoVarsDataBuilder) updates]) => + factory _$GHeroNoVarsData([void Function(GHeroNoVarsDataBuilder)? updates]) => (new GHeroNoVarsDataBuilder()..update(updates)).build(); - _$GHeroNoVarsData._({this.G__typename, this.hero}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GHeroNoVarsData', 'G__typename'); - } + _$GHeroNoVarsData._({required this.G__typename, this.hero}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroNoVarsData', 'G__typename'); } @override @@ -168,25 +169,26 @@ class _$GHeroNoVarsData extends GHeroNoVarsData { class GHeroNoVarsDataBuilder implements Builder { - _$GHeroNoVarsData _$v; + _$GHeroNoVarsData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GHeroNoVarsData_heroBuilder _hero; + GHeroNoVarsData_heroBuilder? _hero; GHeroNoVarsData_heroBuilder get hero => _$this._hero ??= new GHeroNoVarsData_heroBuilder(); - set hero(GHeroNoVarsData_heroBuilder hero) => _$this._hero = hero; + set hero(GHeroNoVarsData_heroBuilder? hero) => _$this._hero = hero; GHeroNoVarsDataBuilder() { GHeroNoVarsData._initializeBuilder(this); } GHeroNoVarsDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _hero = _$v.hero?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _hero = $v.hero?.toBuilder(); _$v = null; } return this; @@ -194,14 +196,12 @@ class GHeroNoVarsDataBuilder @override void replace(GHeroNoVarsData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroNoVarsData; } @override - void update(void Function(GHeroNoVarsDataBuilder) updates) { + void update(void Function(GHeroNoVarsDataBuilder)? updates) { if (updates != null) updates(this); } @@ -211,9 +211,11 @@ class GHeroNoVarsDataBuilder try { _$result = _$v ?? new _$GHeroNoVarsData._( - G__typename: G__typename, hero: _hero?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroNoVarsData', 'G__typename'), + hero: _hero?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'hero'; _hero?.build(); @@ -237,19 +239,16 @@ class _$GHeroNoVarsData_hero extends GHeroNoVarsData_hero { final String name; factory _$GHeroNoVarsData_hero( - [void Function(GHeroNoVarsData_heroBuilder) updates]) => + [void Function(GHeroNoVarsData_heroBuilder)? updates]) => (new GHeroNoVarsData_heroBuilder()..update(updates)).build(); - _$GHeroNoVarsData_hero._({this.G__typename, this.id, this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GHeroNoVarsData_hero', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GHeroNoVarsData_hero', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GHeroNoVarsData_hero', 'name'); - } + _$GHeroNoVarsData_hero._( + {required this.G__typename, required this.id, required this.name}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroNoVarsData_hero', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, 'GHeroNoVarsData_hero', 'id'); + BuiltValueNullFieldError.checkNotNull(name, 'GHeroNoVarsData_hero', 'name'); } @override @@ -288,29 +287,30 @@ class _$GHeroNoVarsData_hero extends GHeroNoVarsData_hero { class GHeroNoVarsData_heroBuilder implements Builder { - _$GHeroNoVarsData_hero _$v; + _$GHeroNoVarsData_hero? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GHeroNoVarsData_heroBuilder() { GHeroNoVarsData_hero._initializeBuilder(this); } GHeroNoVarsData_heroBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; _$v = null; } return this; @@ -318,14 +318,12 @@ class GHeroNoVarsData_heroBuilder @override void replace(GHeroNoVarsData_hero other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroNoVarsData_hero; } @override - void update(void Function(GHeroNoVarsData_heroBuilder) updates) { + void update(void Function(GHeroNoVarsData_heroBuilder)? updates) { if (updates != null) updates(this); } @@ -333,7 +331,12 @@ class GHeroNoVarsData_heroBuilder _$GHeroNoVarsData_hero build() { final _$result = _$v ?? new _$GHeroNoVarsData_hero._( - G__typename: G__typename, id: id, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHeroNoVarsData_hero', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GHeroNoVarsData_hero', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHeroNoVarsData_hero', 'name')); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.dart b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.dart index d369c3c13..a0df78169 100644 --- a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.dart +++ b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.dart @@ -21,7 +21,8 @@ abstract class GHeroNoVars implements Built { _i1.Operation get operation; static Serializer get serializer => _$gHeroNoVarsSerializer; Map toJson() => - _i4.serializers.serializeWith(GHeroNoVars.serializer, this); - static GHeroNoVars fromJson(Map json) => + (_i4.serializers.serializeWith(GHeroNoVars.serializer, this) + as Map); + static GHeroNoVars? fromJson(Map json) => _i4.serializers.deserializeWith(GHeroNoVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.g.dart b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.g.dart index d88c1c14c..3b9386aff 100644 --- a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.req.gql.g.dart @@ -15,9 +15,9 @@ class _$GHeroNoVarsSerializer implements StructuredSerializer { final String wireName = 'GHeroNoVars'; @override - Iterable serialize(Serializers serializers, GHeroNoVars object, + Iterable serialize(Serializers serializers, GHeroNoVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GHeroNoVarsVars)), @@ -30,7 +30,7 @@ class _$GHeroNoVarsSerializer implements StructuredSerializer { } @override - GHeroNoVars deserialize(Serializers serializers, Iterable serialized, + GHeroNoVars deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHeroNoVarsBuilder(); @@ -38,11 +38,11 @@ class _$GHeroNoVarsSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GHeroNoVarsVars)) + specifiedType: const FullType(_i3.GHeroNoVarsVars))! as _i3.GHeroNoVarsVars); break; case 'operation': @@ -62,16 +62,13 @@ class _$GHeroNoVars extends GHeroNoVars { @override final _i1.Operation operation; - factory _$GHeroNoVars([void Function(GHeroNoVarsBuilder) updates]) => + factory _$GHeroNoVars([void Function(GHeroNoVarsBuilder)? updates]) => (new GHeroNoVarsBuilder()..update(updates)).build(); - _$GHeroNoVars._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GHeroNoVars', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GHeroNoVars', 'operation'); - } + _$GHeroNoVars._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GHeroNoVars', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GHeroNoVars', 'operation'); } @override @@ -104,25 +101,26 @@ class _$GHeroNoVars extends GHeroNoVars { } class GHeroNoVarsBuilder implements Builder { - _$GHeroNoVars _$v; + _$GHeroNoVars? _$v; - _i3.GHeroNoVarsVarsBuilder _vars; + _i3.GHeroNoVarsVarsBuilder? _vars; _i3.GHeroNoVarsVarsBuilder get vars => _$this._vars ??= new _i3.GHeroNoVarsVarsBuilder(); - set vars(_i3.GHeroNoVarsVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GHeroNoVarsVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GHeroNoVarsBuilder() { GHeroNoVars._initializeBuilder(this); } GHeroNoVarsBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -130,14 +128,12 @@ class GHeroNoVarsBuilder implements Builder { @override void replace(GHeroNoVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroNoVars; } @override - void update(void Function(GHeroNoVarsBuilder) updates) { + void update(void Function(GHeroNoVarsBuilder)? updates) { if (updates != null) updates(this); } @@ -145,10 +141,13 @@ class GHeroNoVarsBuilder implements Builder { _$GHeroNoVars build() { _$GHeroNoVars _$result; try { - _$result = - _$v ?? new _$GHeroNoVars._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GHeroNoVars._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GHeroNoVars', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.dart b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.dart index d19de1842..4bb771d22 100644 --- a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.dart +++ b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.dart @@ -16,7 +16,8 @@ abstract class GHeroNoVarsVars static Serializer get serializer => _$gHeroNoVarsVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GHeroNoVarsVars.serializer, this); - static GHeroNoVarsVars fromJson(Map json) => + (_i1.serializers.serializeWith(GHeroNoVarsVars.serializer, this) + as Map); + static GHeroNoVarsVars? fromJson(Map json) => _i1.serializers.deserializeWith(GHeroNoVarsVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.g.dart b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.g.dart index ab435c029..f48af3e1a 100644 --- a/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/no_vars/hero_no_vars.var.gql.g.dart @@ -17,21 +17,21 @@ class _$GHeroNoVarsVarsSerializer final String wireName = 'GHeroNoVarsVars'; @override - Iterable serialize(Serializers serializers, GHeroNoVarsVars object, + Iterable serialize(Serializers serializers, GHeroNoVarsVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override GHeroNoVarsVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GHeroNoVarsVarsBuilder().build(); } } class _$GHeroNoVarsVars extends GHeroNoVarsVars { - factory _$GHeroNoVarsVars([void Function(GHeroNoVarsVarsBuilder) updates]) => + factory _$GHeroNoVarsVars([void Function(GHeroNoVarsVarsBuilder)? updates]) => (new GHeroNoVarsVarsBuilder()..update(updates)).build(); _$GHeroNoVarsVars._() : super._(); @@ -63,20 +63,18 @@ class _$GHeroNoVarsVars extends GHeroNoVarsVars { class GHeroNoVarsVarsBuilder implements Builder { - _$GHeroNoVarsVars _$v; + _$GHeroNoVarsVars? _$v; GHeroNoVarsVarsBuilder(); @override void replace(GHeroNoVarsVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHeroNoVarsVars; } @override - void update(void Function(GHeroNoVarsVarsBuilder) updates) { + void update(void Function(GHeroNoVarsVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.dart b/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.dart index 573932672..f7b005472 100644 --- a/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.dart +++ b/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.dart @@ -20,13 +20,13 @@ abstract class GReviewWithDateData b..G__typename = 'Mutation'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GReviewWithDateData_createReview get createReview; + GReviewWithDateData_createReview? get createReview; static Serializer get serializer => _$gReviewWithDateDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GReviewWithDateData.serializer, this); - static GReviewWithDateData fromJson(Map json) => + (_i1.serializers.serializeWith(GReviewWithDateData.serializer, this) + as Map); + static GReviewWithDateData? fromJson(Map json) => _i1.serializers.deserializeWith(GReviewWithDateData.serializer, json); } @@ -44,20 +44,19 @@ abstract class GReviewWithDateData_createReview b..G__typename = 'Review'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - _i2.GEpisode get episode; + _i2.GEpisode? get episode; int get stars; - @nullable - String get commentary; - @nullable - DateTime get createdAt; + String? get commentary; + DateTime? get createdAt; BuiltList get seenOn; BuiltList<_i3.CustomField> get custom; static Serializer get serializer => _$gReviewWithDateDataCreateReviewSerializer; - Map toJson() => _i1.serializers - .serializeWith(GReviewWithDateData_createReview.serializer, this); - static GReviewWithDateData_createReview fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GReviewWithDateData_createReview.serializer, this) + as Map); + static GReviewWithDateData_createReview? fromJson( + Map json) => _i1.serializers .deserializeWith(GReviewWithDateData_createReview.serializer, json); } diff --git a/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.g.dart b/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.g.dart index f67323dfc..213979d35 100644 --- a/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/scalars/review_with_date.data.gql.g.dart @@ -23,18 +23,20 @@ class _$GReviewWithDateDataSerializer final String wireName = 'GReviewWithDateData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReviewWithDateData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.createReview != null) { + Object? value; + value = object.createReview; + if (value != null) { result ..add('createReview') - ..add(serializers.serialize(object.createReview, + ..add(serializers.serialize(value, specifiedType: const FullType(GReviewWithDateData_createReview))); } return result; @@ -42,7 +44,7 @@ class _$GReviewWithDateDataSerializer @override GReviewWithDateData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReviewWithDateDataBuilder(); @@ -50,7 +52,7 @@ class _$GReviewWithDateDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -59,7 +61,7 @@ class _$GReviewWithDateDataSerializer case 'createReview': result.createReview.replace(serializers.deserialize(value, specifiedType: - const FullType(GReviewWithDateData_createReview)) + const FullType(GReviewWithDateData_createReview))! as GReviewWithDateData_createReview); break; } @@ -80,10 +82,10 @@ class _$GReviewWithDateData_createReviewSerializer final String wireName = 'GReviewWithDateData_createReview'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReviewWithDateData_createReview object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -98,22 +100,26 @@ class _$GReviewWithDateData_createReviewSerializer specifiedType: const FullType( BuiltList, const [const FullType(_i3.CustomField)])), ]; - if (object.episode != null) { + Object? value; + value = object.episode; + if (value != null) { result ..add('episode') - ..add(serializers.serialize(object.episode, + ..add(serializers.serialize(value, specifiedType: const FullType(_i2.GEpisode))); } - if (object.commentary != null) { + value = object.commentary; + if (value != null) { result ..add('commentary') - ..add(serializers.serialize(object.commentary, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.createdAt != null) { + value = object.createdAt; + if (value != null) { result ..add('createdAt') - ..add(serializers.serialize(object.createdAt, + ..add(serializers.serialize(value, specifiedType: const FullType(DateTime))); } return result; @@ -121,7 +127,7 @@ class _$GReviewWithDateData_createReviewSerializer @override GReviewWithDateData_createReview deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReviewWithDateData_createReviewBuilder(); @@ -129,7 +135,7 @@ class _$GReviewWithDateData_createReviewSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -154,13 +160,13 @@ class _$GReviewWithDateData_createReviewSerializer case 'seenOn': result.seenOn.replace(serializers.deserialize(value, specifiedType: const FullType( - BuiltList, const [const FullType(DateTime)])) + BuiltList, const [const FullType(DateTime)]))! as BuiltList); break; case 'custom': result.custom.replace(serializers.deserialize(value, specifiedType: const FullType( - BuiltList, const [const FullType(_i3.CustomField)])) + BuiltList, const [const FullType(_i3.CustomField)]))! as BuiltList); break; } @@ -174,16 +180,16 @@ class _$GReviewWithDateData extends GReviewWithDateData { @override final String G__typename; @override - final GReviewWithDateData_createReview createReview; + final GReviewWithDateData_createReview? createReview; factory _$GReviewWithDateData( - [void Function(GReviewWithDateDataBuilder) updates]) => + [void Function(GReviewWithDateDataBuilder)? updates]) => (new GReviewWithDateDataBuilder()..update(updates)).build(); - _$GReviewWithDateData._({this.G__typename, this.createReview}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GReviewWithDateData', 'G__typename'); - } + _$GReviewWithDateData._({required this.G__typename, this.createReview}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReviewWithDateData', 'G__typename'); } @override @@ -219,16 +225,16 @@ class _$GReviewWithDateData extends GReviewWithDateData { class GReviewWithDateDataBuilder implements Builder { - _$GReviewWithDateData _$v; + _$GReviewWithDateData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GReviewWithDateData_createReviewBuilder _createReview; + GReviewWithDateData_createReviewBuilder? _createReview; GReviewWithDateData_createReviewBuilder get createReview => _$this._createReview ??= new GReviewWithDateData_createReviewBuilder(); - set createReview(GReviewWithDateData_createReviewBuilder createReview) => + set createReview(GReviewWithDateData_createReviewBuilder? createReview) => _$this._createReview = createReview; GReviewWithDateDataBuilder() { @@ -236,9 +242,10 @@ class GReviewWithDateDataBuilder } GReviewWithDateDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _createReview = _$v.createReview?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _createReview = $v.createReview?.toBuilder(); _$v = null; } return this; @@ -246,14 +253,12 @@ class GReviewWithDateDataBuilder @override void replace(GReviewWithDateData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReviewWithDateData; } @override - void update(void Function(GReviewWithDateDataBuilder) updates) { + void update(void Function(GReviewWithDateDataBuilder)? updates) { if (updates != null) updates(this); } @@ -263,9 +268,11 @@ class GReviewWithDateDataBuilder try { _$result = _$v ?? new _$GReviewWithDateData._( - G__typename: G__typename, createReview: _createReview?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReviewWithDateData', 'G__typename'), + createReview: _createReview?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'createReview'; _createReview?.build(); @@ -285,47 +292,39 @@ class _$GReviewWithDateData_createReview @override final String G__typename; @override - final _i2.GEpisode episode; + final _i2.GEpisode? episode; @override final int stars; @override - final String commentary; + final String? commentary; @override - final DateTime createdAt; + final DateTime? createdAt; @override final BuiltList seenOn; @override final BuiltList<_i3.CustomField> custom; factory _$GReviewWithDateData_createReview( - [void Function(GReviewWithDateData_createReviewBuilder) updates]) => + [void Function(GReviewWithDateData_createReviewBuilder)? updates]) => (new GReviewWithDateData_createReviewBuilder()..update(updates)).build(); _$GReviewWithDateData_createReview._( - {this.G__typename, + {required this.G__typename, this.episode, - this.stars, + required this.stars, this.commentary, this.createdAt, - this.seenOn, - this.custom}) + required this.seenOn, + required this.custom}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GReviewWithDateData_createReview', 'G__typename'); - } - if (stars == null) { - throw new BuiltValueNullFieldError( - 'GReviewWithDateData_createReview', 'stars'); - } - if (seenOn == null) { - throw new BuiltValueNullFieldError( - 'GReviewWithDateData_createReview', 'seenOn'); - } - if (custom == null) { - throw new BuiltValueNullFieldError( - 'GReviewWithDateData_createReview', 'custom'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReviewWithDateData_createReview', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + stars, 'GReviewWithDateData_createReview', 'stars'); + BuiltValueNullFieldError.checkNotNull( + seenOn, 'GReviewWithDateData_createReview', 'seenOn'); + BuiltValueNullFieldError.checkNotNull( + custom, 'GReviewWithDateData_createReview', 'custom'); } @override @@ -382,51 +381,52 @@ class GReviewWithDateData_createReviewBuilder implements Builder { - _$GReviewWithDateData_createReview _$v; + _$GReviewWithDateData_createReview? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - _i2.GEpisode _episode; - _i2.GEpisode get episode => _$this._episode; - set episode(_i2.GEpisode episode) => _$this._episode = episode; + _i2.GEpisode? _episode; + _i2.GEpisode? get episode => _$this._episode; + set episode(_i2.GEpisode? episode) => _$this._episode = episode; - int _stars; - int get stars => _$this._stars; - set stars(int stars) => _$this._stars = stars; + int? _stars; + int? get stars => _$this._stars; + set stars(int? stars) => _$this._stars = stars; - String _commentary; - String get commentary => _$this._commentary; - set commentary(String commentary) => _$this._commentary = commentary; + String? _commentary; + String? get commentary => _$this._commentary; + set commentary(String? commentary) => _$this._commentary = commentary; - DateTime _createdAt; - DateTime get createdAt => _$this._createdAt; - set createdAt(DateTime createdAt) => _$this._createdAt = createdAt; + DateTime? _createdAt; + DateTime? get createdAt => _$this._createdAt; + set createdAt(DateTime? createdAt) => _$this._createdAt = createdAt; - ListBuilder _seenOn; + ListBuilder? _seenOn; ListBuilder get seenOn => _$this._seenOn ??= new ListBuilder(); - set seenOn(ListBuilder seenOn) => _$this._seenOn = seenOn; + set seenOn(ListBuilder? seenOn) => _$this._seenOn = seenOn; - ListBuilder<_i3.CustomField> _custom; + ListBuilder<_i3.CustomField>? _custom; ListBuilder<_i3.CustomField> get custom => _$this._custom ??= new ListBuilder<_i3.CustomField>(); - set custom(ListBuilder<_i3.CustomField> custom) => _$this._custom = custom; + set custom(ListBuilder<_i3.CustomField>? custom) => _$this._custom = custom; GReviewWithDateData_createReviewBuilder() { GReviewWithDateData_createReview._initializeBuilder(this); } GReviewWithDateData_createReviewBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _episode = _$v.episode; - _stars = _$v.stars; - _commentary = _$v.commentary; - _createdAt = _$v.createdAt; - _seenOn = _$v.seenOn?.toBuilder(); - _custom = _$v.custom?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _episode = $v.episode; + _stars = $v.stars; + _commentary = $v.commentary; + _createdAt = $v.createdAt; + _seenOn = $v.seenOn.toBuilder(); + _custom = $v.custom.toBuilder(); _$v = null; } return this; @@ -434,14 +434,12 @@ class GReviewWithDateData_createReviewBuilder @override void replace(GReviewWithDateData_createReview other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReviewWithDateData_createReview; } @override - void update(void Function(GReviewWithDateData_createReviewBuilder) updates) { + void update(void Function(GReviewWithDateData_createReviewBuilder)? updates) { if (updates != null) updates(this); } @@ -451,15 +449,17 @@ class GReviewWithDateData_createReviewBuilder try { _$result = _$v ?? new _$GReviewWithDateData_createReview._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GReviewWithDateData_createReview', 'G__typename'), episode: episode, - stars: stars, + stars: BuiltValueNullFieldError.checkNotNull( + stars, 'GReviewWithDateData_createReview', 'stars'), commentary: commentary, createdAt: createdAt, seenOn: seenOn.build(), custom: custom.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'seenOn'; seenOn.build(); diff --git a/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.dart b/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.dart index 362aafd7e..8f3b3802d 100644 --- a/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.dart +++ b/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.dart @@ -24,7 +24,8 @@ abstract class GReviewWithDate static Serializer get serializer => _$gReviewWithDateSerializer; Map toJson() => - _i4.serializers.serializeWith(GReviewWithDate.serializer, this); - static GReviewWithDate fromJson(Map json) => + (_i4.serializers.serializeWith(GReviewWithDate.serializer, this) + as Map); + static GReviewWithDate? fromJson(Map json) => _i4.serializers.deserializeWith(GReviewWithDate.serializer, json); } diff --git a/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.g.dart b/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.g.dart index 1298f8e66..e84b9e943 100644 --- a/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/scalars/review_with_date.req.gql.g.dart @@ -17,9 +17,9 @@ class _$GReviewWithDateSerializer final String wireName = 'GReviewWithDate'; @override - Iterable serialize(Serializers serializers, GReviewWithDate object, + Iterable serialize(Serializers serializers, GReviewWithDate object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GReviewWithDateVars)), @@ -33,7 +33,7 @@ class _$GReviewWithDateSerializer @override GReviewWithDate deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReviewWithDateBuilder(); @@ -41,11 +41,11 @@ class _$GReviewWithDateSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GReviewWithDateVars)) + specifiedType: const FullType(_i3.GReviewWithDateVars))! as _i3.GReviewWithDateVars); break; case 'operation': @@ -65,16 +65,14 @@ class _$GReviewWithDate extends GReviewWithDate { @override final _i1.Operation operation; - factory _$GReviewWithDate([void Function(GReviewWithDateBuilder) updates]) => + factory _$GReviewWithDate([void Function(GReviewWithDateBuilder)? updates]) => (new GReviewWithDateBuilder()..update(updates)).build(); - _$GReviewWithDate._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GReviewWithDate', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GReviewWithDate', 'operation'); - } + _$GReviewWithDate._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GReviewWithDate', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GReviewWithDate', 'operation'); } @override @@ -109,25 +107,26 @@ class _$GReviewWithDate extends GReviewWithDate { class GReviewWithDateBuilder implements Builder { - _$GReviewWithDate _$v; + _$GReviewWithDate? _$v; - _i3.GReviewWithDateVarsBuilder _vars; + _i3.GReviewWithDateVarsBuilder? _vars; _i3.GReviewWithDateVarsBuilder get vars => _$this._vars ??= new _i3.GReviewWithDateVarsBuilder(); - set vars(_i3.GReviewWithDateVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GReviewWithDateVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GReviewWithDateBuilder() { GReviewWithDate._initializeBuilder(this); } GReviewWithDateBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -135,14 +134,12 @@ class GReviewWithDateBuilder @override void replace(GReviewWithDate other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReviewWithDate; } @override - void update(void Function(GReviewWithDateBuilder) updates) { + void update(void Function(GReviewWithDateBuilder)? updates) { if (updates != null) updates(this); } @@ -151,9 +148,12 @@ class GReviewWithDateBuilder _$GReviewWithDate _$result; try { _$result = _$v ?? - new _$GReviewWithDate._(vars: vars.build(), operation: operation); + new _$GReviewWithDate._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GReviewWithDate', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.dart b/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.dart index bc3cf3364..ac1a599fa 100644 --- a/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.dart +++ b/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.dart @@ -14,15 +14,14 @@ abstract class GReviewWithDateVars factory GReviewWithDateVars( [Function(GReviewWithDateVarsBuilder b) updates]) = _$GReviewWithDateVars; - @nullable - _i1.GEpisode get episode; + _i1.GEpisode? get episode; _i1.GReviewInput get review; - @nullable - DateTime get createdAt; + DateTime? get createdAt; static Serializer get serializer => _$gReviewWithDateVarsSerializer; Map toJson() => - _i2.serializers.serializeWith(GReviewWithDateVars.serializer, this); - static GReviewWithDateVars fromJson(Map json) => + (_i2.serializers.serializeWith(GReviewWithDateVars.serializer, this) + as Map); + static GReviewWithDateVars? fromJson(Map json) => _i2.serializers.deserializeWith(GReviewWithDateVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.g.dart b/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.g.dart index 1a0cb392e..ffcf2f175 100644 --- a/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/scalars/review_with_date.var.gql.g.dart @@ -20,24 +20,27 @@ class _$GReviewWithDateVarsSerializer final String wireName = 'GReviewWithDateVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReviewWithDateVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'review', serializers.serialize(object.review, specifiedType: const FullType(_i1.GReviewInput)), ]; - if (object.episode != null) { + Object? value; + value = object.episode; + if (value != null) { result ..add('episode') - ..add(serializers.serialize(object.episode, + ..add(serializers.serialize(value, specifiedType: const FullType(_i1.GEpisode))); } - if (object.createdAt != null) { + value = object.createdAt; + if (value != null) { result ..add('createdAt') - ..add(serializers.serialize(object.createdAt, + ..add(serializers.serialize(value, specifiedType: const FullType(DateTime))); } return result; @@ -45,7 +48,7 @@ class _$GReviewWithDateVarsSerializer @override GReviewWithDateVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReviewWithDateVarsBuilder(); @@ -53,7 +56,7 @@ class _$GReviewWithDateVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'episode': result.episode = serializers.deserialize(value, @@ -61,7 +64,7 @@ class _$GReviewWithDateVarsSerializer break; case 'review': result.review.replace(serializers.deserialize(value, - specifiedType: const FullType(_i1.GReviewInput)) + specifiedType: const FullType(_i1.GReviewInput))! as _i1.GReviewInput); break; case 'createdAt': @@ -77,21 +80,20 @@ class _$GReviewWithDateVarsSerializer class _$GReviewWithDateVars extends GReviewWithDateVars { @override - final _i1.GEpisode episode; + final _i1.GEpisode? episode; @override final _i1.GReviewInput review; @override - final DateTime createdAt; + final DateTime? createdAt; factory _$GReviewWithDateVars( - [void Function(GReviewWithDateVarsBuilder) updates]) => + [void Function(GReviewWithDateVarsBuilder)? updates]) => (new GReviewWithDateVarsBuilder()..update(updates)).build(); - _$GReviewWithDateVars._({this.episode, this.review, this.createdAt}) + _$GReviewWithDateVars._({this.episode, required this.review, this.createdAt}) : super._() { - if (review == null) { - throw new BuiltValueNullFieldError('GReviewWithDateVars', 'review'); - } + BuiltValueNullFieldError.checkNotNull( + review, 'GReviewWithDateVars', 'review'); } @override @@ -130,28 +132,29 @@ class _$GReviewWithDateVars extends GReviewWithDateVars { class GReviewWithDateVarsBuilder implements Builder { - _$GReviewWithDateVars _$v; + _$GReviewWithDateVars? _$v; - _i1.GEpisode _episode; - _i1.GEpisode get episode => _$this._episode; - set episode(_i1.GEpisode episode) => _$this._episode = episode; + _i1.GEpisode? _episode; + _i1.GEpisode? get episode => _$this._episode; + set episode(_i1.GEpisode? episode) => _$this._episode = episode; - _i1.GReviewInputBuilder _review; + _i1.GReviewInputBuilder? _review; _i1.GReviewInputBuilder get review => _$this._review ??= new _i1.GReviewInputBuilder(); - set review(_i1.GReviewInputBuilder review) => _$this._review = review; + set review(_i1.GReviewInputBuilder? review) => _$this._review = review; - DateTime _createdAt; - DateTime get createdAt => _$this._createdAt; - set createdAt(DateTime createdAt) => _$this._createdAt = createdAt; + DateTime? _createdAt; + DateTime? get createdAt => _$this._createdAt; + set createdAt(DateTime? createdAt) => _$this._createdAt = createdAt; GReviewWithDateVarsBuilder(); GReviewWithDateVarsBuilder get _$this { - if (_$v != null) { - _episode = _$v.episode; - _review = _$v.review?.toBuilder(); - _createdAt = _$v.createdAt; + final $v = _$v; + if ($v != null) { + _episode = $v.episode; + _review = $v.review.toBuilder(); + _createdAt = $v.createdAt; _$v = null; } return this; @@ -159,14 +162,12 @@ class GReviewWithDateVarsBuilder @override void replace(GReviewWithDateVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReviewWithDateVars; } @override - void update(void Function(GReviewWithDateVarsBuilder) updates) { + void update(void Function(GReviewWithDateVarsBuilder)? updates) { if (updates != null) updates(this); } @@ -178,7 +179,7 @@ class GReviewWithDateVarsBuilder new _$GReviewWithDateVars._( episode: episode, review: review.build(), createdAt: createdAt); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'review'; review.build(); diff --git a/codegen/end_to_end_test/lib/variables/create_review.data.gql.dart b/codegen/end_to_end_test/lib/variables/create_review.data.gql.dart index 8e632ad76..3eb99da64 100644 --- a/codegen/end_to_end_test/lib/variables/create_review.data.gql.dart +++ b/codegen/end_to_end_test/lib/variables/create_review.data.gql.dart @@ -18,13 +18,13 @@ abstract class GCreateReviewData b..G__typename = 'Mutation'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GCreateReviewData_createReview get createReview; + GCreateReviewData_createReview? get createReview; static Serializer get serializer => _$gCreateReviewDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GCreateReviewData.serializer, this); - static GCreateReviewData fromJson(Map json) => + (_i1.serializers.serializeWith(GCreateReviewData.serializer, this) + as Map); + static GCreateReviewData? fromJson(Map json) => _i1.serializers.deserializeWith(GCreateReviewData.serializer, json); } @@ -42,16 +42,14 @@ abstract class GCreateReviewData_createReview b..G__typename = 'Review'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - _i2.GEpisode get episode; + _i2.GEpisode? get episode; int get stars; - @nullable - String get commentary; + String? get commentary; static Serializer get serializer => _$gCreateReviewDataCreateReviewSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCreateReviewData_createReview.serializer, this); - static GCreateReviewData_createReview fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GCreateReviewData_createReview.serializer, this) as Map); + static GCreateReviewData_createReview? fromJson(Map json) => _i1.serializers .deserializeWith(GCreateReviewData_createReview.serializer, json); } diff --git a/codegen/end_to_end_test/lib/variables/create_review.data.gql.g.dart b/codegen/end_to_end_test/lib/variables/create_review.data.gql.g.dart index 22aa99509..e4b848743 100644 --- a/codegen/end_to_end_test/lib/variables/create_review.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/variables/create_review.data.gql.g.dart @@ -20,17 +20,19 @@ class _$GCreateReviewDataSerializer final String wireName = 'GCreateReviewData'; @override - Iterable serialize(Serializers serializers, GCreateReviewData object, + Iterable serialize(Serializers serializers, GCreateReviewData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.createReview != null) { + Object? value; + value = object.createReview; + if (value != null) { result ..add('createReview') - ..add(serializers.serialize(object.createReview, + ..add(serializers.serialize(value, specifiedType: const FullType(GCreateReviewData_createReview))); } return result; @@ -38,7 +40,7 @@ class _$GCreateReviewDataSerializer @override GCreateReviewData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateReviewDataBuilder(); @@ -46,7 +48,7 @@ class _$GCreateReviewDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -54,7 +56,8 @@ class _$GCreateReviewDataSerializer break; case 'createReview': result.createReview.replace(serializers.deserialize(value, - specifiedType: const FullType(GCreateReviewData_createReview)) + specifiedType: + const FullType(GCreateReviewData_createReview))! as GCreateReviewData_createReview); break; } @@ -75,26 +78,29 @@ class _$GCreateReviewData_createReviewSerializer final String wireName = 'GCreateReviewData_createReview'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateReviewData_createReview object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'stars', serializers.serialize(object.stars, specifiedType: const FullType(int)), ]; - if (object.episode != null) { + Object? value; + value = object.episode; + if (value != null) { result ..add('episode') - ..add(serializers.serialize(object.episode, + ..add(serializers.serialize(value, specifiedType: const FullType(_i2.GEpisode))); } - if (object.commentary != null) { + value = object.commentary; + if (value != null) { result ..add('commentary') - ..add(serializers.serialize(object.commentary, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -102,7 +108,7 @@ class _$GCreateReviewData_createReviewSerializer @override GCreateReviewData_createReview deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateReviewData_createReviewBuilder(); @@ -110,7 +116,7 @@ class _$GCreateReviewData_createReviewSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -139,16 +145,16 @@ class _$GCreateReviewData extends GCreateReviewData { @override final String G__typename; @override - final GCreateReviewData_createReview createReview; + final GCreateReviewData_createReview? createReview; factory _$GCreateReviewData( - [void Function(GCreateReviewDataBuilder) updates]) => + [void Function(GCreateReviewDataBuilder)? updates]) => (new GCreateReviewDataBuilder()..update(updates)).build(); - _$GCreateReviewData._({this.G__typename, this.createReview}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GCreateReviewData', 'G__typename'); - } + _$GCreateReviewData._({required this.G__typename, this.createReview}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GCreateReviewData', 'G__typename'); } @override @@ -183,16 +189,16 @@ class _$GCreateReviewData extends GCreateReviewData { class GCreateReviewDataBuilder implements Builder { - _$GCreateReviewData _$v; + _$GCreateReviewData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GCreateReviewData_createReviewBuilder _createReview; + GCreateReviewData_createReviewBuilder? _createReview; GCreateReviewData_createReviewBuilder get createReview => _$this._createReview ??= new GCreateReviewData_createReviewBuilder(); - set createReview(GCreateReviewData_createReviewBuilder createReview) => + set createReview(GCreateReviewData_createReviewBuilder? createReview) => _$this._createReview = createReview; GCreateReviewDataBuilder() { @@ -200,9 +206,10 @@ class GCreateReviewDataBuilder } GCreateReviewDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _createReview = _$v.createReview?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _createReview = $v.createReview?.toBuilder(); _$v = null; } return this; @@ -210,14 +217,12 @@ class GCreateReviewDataBuilder @override void replace(GCreateReviewData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateReviewData; } @override - void update(void Function(GCreateReviewDataBuilder) updates) { + void update(void Function(GCreateReviewDataBuilder)? updates) { if (updates != null) updates(this); } @@ -227,9 +232,11 @@ class GCreateReviewDataBuilder try { _$result = _$v ?? new _$GCreateReviewData._( - G__typename: G__typename, createReview: _createReview?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GCreateReviewData', 'G__typename'), + createReview: _createReview?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'createReview'; _createReview?.build(); @@ -248,27 +255,26 @@ class _$GCreateReviewData_createReview extends GCreateReviewData_createReview { @override final String G__typename; @override - final _i2.GEpisode episode; + final _i2.GEpisode? episode; @override final int stars; @override - final String commentary; + final String? commentary; factory _$GCreateReviewData_createReview( - [void Function(GCreateReviewData_createReviewBuilder) updates]) => + [void Function(GCreateReviewData_createReviewBuilder)? updates]) => (new GCreateReviewData_createReviewBuilder()..update(updates)).build(); _$GCreateReviewData_createReview._( - {this.G__typename, this.episode, this.stars, this.commentary}) + {required this.G__typename, + this.episode, + required this.stars, + this.commentary}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GCreateReviewData_createReview', 'G__typename'); - } - if (stars == null) { - throw new BuiltValueNullFieldError( - 'GCreateReviewData_createReview', 'stars'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GCreateReviewData_createReview', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + stars, 'GCreateReviewData_createReview', 'stars'); } @override @@ -313,34 +319,35 @@ class GCreateReviewData_createReviewBuilder implements Builder { - _$GCreateReviewData_createReview _$v; + _$GCreateReviewData_createReview? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - _i2.GEpisode _episode; - _i2.GEpisode get episode => _$this._episode; - set episode(_i2.GEpisode episode) => _$this._episode = episode; + _i2.GEpisode? _episode; + _i2.GEpisode? get episode => _$this._episode; + set episode(_i2.GEpisode? episode) => _$this._episode = episode; - int _stars; - int get stars => _$this._stars; - set stars(int stars) => _$this._stars = stars; + int? _stars; + int? get stars => _$this._stars; + set stars(int? stars) => _$this._stars = stars; - String _commentary; - String get commentary => _$this._commentary; - set commentary(String commentary) => _$this._commentary = commentary; + String? _commentary; + String? get commentary => _$this._commentary; + set commentary(String? commentary) => _$this._commentary = commentary; GCreateReviewData_createReviewBuilder() { GCreateReviewData_createReview._initializeBuilder(this); } GCreateReviewData_createReviewBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _episode = _$v.episode; - _stars = _$v.stars; - _commentary = _$v.commentary; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _episode = $v.episode; + _stars = $v.stars; + _commentary = $v.commentary; _$v = null; } return this; @@ -348,14 +355,12 @@ class GCreateReviewData_createReviewBuilder @override void replace(GCreateReviewData_createReview other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateReviewData_createReview; } @override - void update(void Function(GCreateReviewData_createReviewBuilder) updates) { + void update(void Function(GCreateReviewData_createReviewBuilder)? updates) { if (updates != null) updates(this); } @@ -363,9 +368,11 @@ class GCreateReviewData_createReviewBuilder _$GCreateReviewData_createReview build() { final _$result = _$v ?? new _$GCreateReviewData_createReview._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GCreateReviewData_createReview', 'G__typename'), episode: episode, - stars: stars, + stars: BuiltValueNullFieldError.checkNotNull( + stars, 'GCreateReviewData_createReview', 'stars'), commentary: commentary); replace(_$result); return _$result; diff --git a/codegen/end_to_end_test/lib/variables/create_review.req.gql.dart b/codegen/end_to_end_test/lib/variables/create_review.req.gql.dart index 958af7e40..77912afcb 100644 --- a/codegen/end_to_end_test/lib/variables/create_review.req.gql.dart +++ b/codegen/end_to_end_test/lib/variables/create_review.req.gql.dart @@ -23,7 +23,8 @@ abstract class GCreateReview _i1.Operation get operation; static Serializer get serializer => _$gCreateReviewSerializer; Map toJson() => - _i4.serializers.serializeWith(GCreateReview.serializer, this); - static GCreateReview fromJson(Map json) => + (_i4.serializers.serializeWith(GCreateReview.serializer, this) + as Map); + static GCreateReview? fromJson(Map json) => _i4.serializers.deserializeWith(GCreateReview.serializer, json); } diff --git a/codegen/end_to_end_test/lib/variables/create_review.req.gql.g.dart b/codegen/end_to_end_test/lib/variables/create_review.req.gql.g.dart index 1b59f1bd6..099e951c2 100644 --- a/codegen/end_to_end_test/lib/variables/create_review.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/variables/create_review.req.gql.g.dart @@ -16,9 +16,9 @@ class _$GCreateReviewSerializer implements StructuredSerializer { final String wireName = 'GCreateReview'; @override - Iterable serialize(Serializers serializers, GCreateReview object, + Iterable serialize(Serializers serializers, GCreateReview object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GCreateReviewVars)), @@ -32,7 +32,7 @@ class _$GCreateReviewSerializer implements StructuredSerializer { @override GCreateReview deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateReviewBuilder(); @@ -40,11 +40,11 @@ class _$GCreateReviewSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GCreateReviewVars)) + specifiedType: const FullType(_i3.GCreateReviewVars))! as _i3.GCreateReviewVars); break; case 'operation': @@ -64,16 +64,13 @@ class _$GCreateReview extends GCreateReview { @override final _i1.Operation operation; - factory _$GCreateReview([void Function(GCreateReviewBuilder) updates]) => + factory _$GCreateReview([void Function(GCreateReviewBuilder)? updates]) => (new GCreateReviewBuilder()..update(updates)).build(); - _$GCreateReview._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GCreateReview', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GCreateReview', 'operation'); - } + _$GCreateReview._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GCreateReview', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GCreateReview', 'operation'); } @override @@ -107,25 +104,26 @@ class _$GCreateReview extends GCreateReview { class GCreateReviewBuilder implements Builder { - _$GCreateReview _$v; + _$GCreateReview? _$v; - _i3.GCreateReviewVarsBuilder _vars; + _i3.GCreateReviewVarsBuilder? _vars; _i3.GCreateReviewVarsBuilder get vars => _$this._vars ??= new _i3.GCreateReviewVarsBuilder(); - set vars(_i3.GCreateReviewVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GCreateReviewVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GCreateReviewBuilder() { GCreateReview._initializeBuilder(this); } GCreateReviewBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -133,14 +131,12 @@ class GCreateReviewBuilder @override void replace(GCreateReview other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateReview; } @override - void update(void Function(GCreateReviewBuilder) updates) { + void update(void Function(GCreateReviewBuilder)? updates) { if (updates != null) updates(this); } @@ -149,9 +145,12 @@ class GCreateReviewBuilder _$GCreateReview _$result; try { _$result = _$v ?? - new _$GCreateReview._(vars: vars.build(), operation: operation); + new _$GCreateReview._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GCreateReview', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/variables/create_review.var.gql.dart b/codegen/end_to_end_test/lib/variables/create_review.var.gql.dart index 03ea68b1b..7749908e3 100644 --- a/codegen/end_to_end_test/lib/variables/create_review.var.gql.dart +++ b/codegen/end_to_end_test/lib/variables/create_review.var.gql.dart @@ -14,13 +14,13 @@ abstract class GCreateReviewVars factory GCreateReviewVars([Function(GCreateReviewVarsBuilder b) updates]) = _$GCreateReviewVars; - @nullable - _i1.GEpisode get episode; + _i1.GEpisode? get episode; _i1.GReviewInput get review; static Serializer get serializer => _$gCreateReviewVarsSerializer; Map toJson() => - _i2.serializers.serializeWith(GCreateReviewVars.serializer, this); - static GCreateReviewVars fromJson(Map json) => + (_i2.serializers.serializeWith(GCreateReviewVars.serializer, this) + as Map); + static GCreateReviewVars? fromJson(Map json) => _i2.serializers.deserializeWith(GCreateReviewVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/variables/create_review.var.gql.g.dart b/codegen/end_to_end_test/lib/variables/create_review.var.gql.g.dart index a55c1e8b4..ecf1af512 100644 --- a/codegen/end_to_end_test/lib/variables/create_review.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/variables/create_review.var.gql.g.dart @@ -17,17 +17,19 @@ class _$GCreateReviewVarsSerializer final String wireName = 'GCreateReviewVars'; @override - Iterable serialize(Serializers serializers, GCreateReviewVars object, + Iterable serialize(Serializers serializers, GCreateReviewVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'review', serializers.serialize(object.review, specifiedType: const FullType(_i1.GReviewInput)), ]; - if (object.episode != null) { + Object? value; + value = object.episode; + if (value != null) { result ..add('episode') - ..add(serializers.serialize(object.episode, + ..add(serializers.serialize(value, specifiedType: const FullType(_i1.GEpisode))); } return result; @@ -35,7 +37,7 @@ class _$GCreateReviewVarsSerializer @override GCreateReviewVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateReviewVarsBuilder(); @@ -43,7 +45,7 @@ class _$GCreateReviewVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'episode': result.episode = serializers.deserialize(value, @@ -51,7 +53,7 @@ class _$GCreateReviewVarsSerializer break; case 'review': result.review.replace(serializers.deserialize(value, - specifiedType: const FullType(_i1.GReviewInput)) + specifiedType: const FullType(_i1.GReviewInput))! as _i1.GReviewInput); break; } @@ -63,18 +65,17 @@ class _$GCreateReviewVarsSerializer class _$GCreateReviewVars extends GCreateReviewVars { @override - final _i1.GEpisode episode; + final _i1.GEpisode? episode; @override final _i1.GReviewInput review; factory _$GCreateReviewVars( - [void Function(GCreateReviewVarsBuilder) updates]) => + [void Function(GCreateReviewVarsBuilder)? updates]) => (new GCreateReviewVarsBuilder()..update(updates)).build(); - _$GCreateReviewVars._({this.episode, this.review}) : super._() { - if (review == null) { - throw new BuiltValueNullFieldError('GCreateReviewVars', 'review'); - } + _$GCreateReviewVars._({this.episode, required this.review}) : super._() { + BuiltValueNullFieldError.checkNotNull( + review, 'GCreateReviewVars', 'review'); } @override @@ -109,23 +110,24 @@ class _$GCreateReviewVars extends GCreateReviewVars { class GCreateReviewVarsBuilder implements Builder { - _$GCreateReviewVars _$v; + _$GCreateReviewVars? _$v; - _i1.GEpisode _episode; - _i1.GEpisode get episode => _$this._episode; - set episode(_i1.GEpisode episode) => _$this._episode = episode; + _i1.GEpisode? _episode; + _i1.GEpisode? get episode => _$this._episode; + set episode(_i1.GEpisode? episode) => _$this._episode = episode; - _i1.GReviewInputBuilder _review; + _i1.GReviewInputBuilder? _review; _i1.GReviewInputBuilder get review => _$this._review ??= new _i1.GReviewInputBuilder(); - set review(_i1.GReviewInputBuilder review) => _$this._review = review; + set review(_i1.GReviewInputBuilder? review) => _$this._review = review; GCreateReviewVarsBuilder(); GCreateReviewVarsBuilder get _$this { - if (_$v != null) { - _episode = _$v.episode; - _review = _$v.review?.toBuilder(); + final $v = _$v; + if ($v != null) { + _episode = $v.episode; + _review = $v.review.toBuilder(); _$v = null; } return this; @@ -133,14 +135,12 @@ class GCreateReviewVarsBuilder @override void replace(GCreateReviewVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateReviewVars; } @override - void update(void Function(GCreateReviewVarsBuilder) updates) { + void update(void Function(GCreateReviewVarsBuilder)? updates) { if (updates != null) updates(this); } @@ -151,7 +151,7 @@ class GCreateReviewVarsBuilder _$result = _$v ?? new _$GCreateReviewVars._(episode: episode, review: review.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'review'; review.build(); diff --git a/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.dart b/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.dart index 98178ab27..b5a4ee95b 100644 --- a/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.dart +++ b/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.dart @@ -17,13 +17,13 @@ abstract class GHumanWithArgsData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GHumanWithArgsData_human get human; + GHumanWithArgsData_human? get human; static Serializer get serializer => _$gHumanWithArgsDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GHumanWithArgsData.serializer, this); - static GHumanWithArgsData fromJson(Map json) => + (_i1.serializers.serializeWith(GHumanWithArgsData.serializer, this) + as Map); + static GHumanWithArgsData? fromJson(Map json) => _i1.serializers.deserializeWith(GHumanWithArgsData.serializer, json); } @@ -41,13 +41,13 @@ abstract class GHumanWithArgsData_human @BuiltValueField(wireName: '__typename') String get G__typename; String get name; - @nullable - double get height; + double? get height; static Serializer get serializer => _$gHumanWithArgsDataHumanSerializer; Map toJson() => - _i1.serializers.serializeWith(GHumanWithArgsData_human.serializer, this); - static GHumanWithArgsData_human fromJson(Map json) => + (_i1.serializers.serializeWith(GHumanWithArgsData_human.serializer, this) + as Map); + static GHumanWithArgsData_human? fromJson(Map json) => _i1.serializers .deserializeWith(GHumanWithArgsData_human.serializer, json); } diff --git a/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.g.dart b/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.g.dart index ba5c9b472..2638c1382 100644 --- a/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.g.dart +++ b/codegen/end_to_end_test/lib/variables/human_with_args.data.gql.g.dart @@ -19,17 +19,20 @@ class _$GHumanWithArgsDataSerializer final String wireName = 'GHumanWithArgsData'; @override - Iterable serialize(Serializers serializers, GHumanWithArgsData object, + Iterable serialize( + Serializers serializers, GHumanWithArgsData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.human != null) { + Object? value; + value = object.human; + if (value != null) { result ..add('human') - ..add(serializers.serialize(object.human, + ..add(serializers.serialize(value, specifiedType: const FullType(GHumanWithArgsData_human))); } return result; @@ -37,7 +40,7 @@ class _$GHumanWithArgsDataSerializer @override GHumanWithArgsData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHumanWithArgsDataBuilder(); @@ -45,7 +48,7 @@ class _$GHumanWithArgsDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -53,7 +56,7 @@ class _$GHumanWithArgsDataSerializer break; case 'human': result.human.replace(serializers.deserialize(value, - specifiedType: const FullType(GHumanWithArgsData_human)) + specifiedType: const FullType(GHumanWithArgsData_human))! as GHumanWithArgsData_human); break; } @@ -74,20 +77,22 @@ class _$GHumanWithArgsData_humanSerializer final String wireName = 'GHumanWithArgsData_human'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GHumanWithArgsData_human object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), ]; - if (object.height != null) { + Object? value; + value = object.height; + if (value != null) { result ..add('height') - ..add(serializers.serialize(object.height, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } return result; @@ -95,7 +100,7 @@ class _$GHumanWithArgsData_humanSerializer @override GHumanWithArgsData_human deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHumanWithArgsData_humanBuilder(); @@ -103,7 +108,7 @@ class _$GHumanWithArgsData_humanSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -128,16 +133,15 @@ class _$GHumanWithArgsData extends GHumanWithArgsData { @override final String G__typename; @override - final GHumanWithArgsData_human human; + final GHumanWithArgsData_human? human; factory _$GHumanWithArgsData( - [void Function(GHumanWithArgsDataBuilder) updates]) => + [void Function(GHumanWithArgsDataBuilder)? updates]) => (new GHumanWithArgsDataBuilder()..update(updates)).build(); - _$GHumanWithArgsData._({this.G__typename, this.human}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GHumanWithArgsData', 'G__typename'); - } + _$GHumanWithArgsData._({required this.G__typename, this.human}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHumanWithArgsData', 'G__typename'); } @override @@ -173,25 +177,26 @@ class _$GHumanWithArgsData extends GHumanWithArgsData { class GHumanWithArgsDataBuilder implements Builder { - _$GHumanWithArgsData _$v; + _$GHumanWithArgsData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GHumanWithArgsData_humanBuilder _human; + GHumanWithArgsData_humanBuilder? _human; GHumanWithArgsData_humanBuilder get human => _$this._human ??= new GHumanWithArgsData_humanBuilder(); - set human(GHumanWithArgsData_humanBuilder human) => _$this._human = human; + set human(GHumanWithArgsData_humanBuilder? human) => _$this._human = human; GHumanWithArgsDataBuilder() { GHumanWithArgsData._initializeBuilder(this); } GHumanWithArgsDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _human = _$v.human?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _human = $v.human?.toBuilder(); _$v = null; } return this; @@ -199,14 +204,12 @@ class GHumanWithArgsDataBuilder @override void replace(GHumanWithArgsData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHumanWithArgsData; } @override - void update(void Function(GHumanWithArgsDataBuilder) updates) { + void update(void Function(GHumanWithArgsDataBuilder)? updates) { if (updates != null) updates(this); } @@ -216,9 +219,11 @@ class GHumanWithArgsDataBuilder try { _$result = _$v ?? new _$GHumanWithArgsData._( - G__typename: G__typename, human: _human?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHumanWithArgsData', 'G__typename'), + human: _human?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'human'; _human?.build(); @@ -239,21 +244,19 @@ class _$GHumanWithArgsData_human extends GHumanWithArgsData_human { @override final String name; @override - final double height; + final double? height; factory _$GHumanWithArgsData_human( - [void Function(GHumanWithArgsData_humanBuilder) updates]) => + [void Function(GHumanWithArgsData_humanBuilder)? updates]) => (new GHumanWithArgsData_humanBuilder()..update(updates)).build(); - _$GHumanWithArgsData_human._({this.G__typename, this.name, this.height}) + _$GHumanWithArgsData_human._( + {required this.G__typename, required this.name, this.height}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GHumanWithArgsData_human', 'G__typename'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GHumanWithArgsData_human', 'name'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHumanWithArgsData_human', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + name, 'GHumanWithArgsData_human', 'name'); } @override @@ -293,29 +296,30 @@ class _$GHumanWithArgsData_human extends GHumanWithArgsData_human { class GHumanWithArgsData_humanBuilder implements Builder { - _$GHumanWithArgsData_human _$v; + _$GHumanWithArgsData_human? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - double _height; - double get height => _$this._height; - set height(double height) => _$this._height = height; + double? _height; + double? get height => _$this._height; + set height(double? height) => _$this._height = height; GHumanWithArgsData_humanBuilder() { GHumanWithArgsData_human._initializeBuilder(this); } GHumanWithArgsData_humanBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _name = _$v.name; - _height = _$v.height; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _name = $v.name; + _height = $v.height; _$v = null; } return this; @@ -323,14 +327,12 @@ class GHumanWithArgsData_humanBuilder @override void replace(GHumanWithArgsData_human other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHumanWithArgsData_human; } @override - void update(void Function(GHumanWithArgsData_humanBuilder) updates) { + void update(void Function(GHumanWithArgsData_humanBuilder)? updates) { if (updates != null) updates(this); } @@ -338,7 +340,11 @@ class GHumanWithArgsData_humanBuilder _$GHumanWithArgsData_human build() { final _$result = _$v ?? new _$GHumanWithArgsData_human._( - G__typename: G__typename, name: name, height: height); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GHumanWithArgsData_human', 'G__typename'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GHumanWithArgsData_human', 'name'), + height: height); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.dart b/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.dart index fed056714..f6129a45f 100644 --- a/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.dart +++ b/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.dart @@ -24,7 +24,8 @@ abstract class GHumanWithArgs static Serializer get serializer => _$gHumanWithArgsSerializer; Map toJson() => - _i4.serializers.serializeWith(GHumanWithArgs.serializer, this); - static GHumanWithArgs fromJson(Map json) => + (_i4.serializers.serializeWith(GHumanWithArgs.serializer, this) + as Map); + static GHumanWithArgs? fromJson(Map json) => _i4.serializers.deserializeWith(GHumanWithArgs.serializer, json); } diff --git a/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.g.dart b/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.g.dart index 1c72eb592..5952e290f 100644 --- a/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.g.dart +++ b/codegen/end_to_end_test/lib/variables/human_with_args.req.gql.g.dart @@ -17,9 +17,9 @@ class _$GHumanWithArgsSerializer final String wireName = 'GHumanWithArgs'; @override - Iterable serialize(Serializers serializers, GHumanWithArgs object, + Iterable serialize(Serializers serializers, GHumanWithArgs object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GHumanWithArgsVars)), @@ -33,7 +33,7 @@ class _$GHumanWithArgsSerializer @override GHumanWithArgs deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHumanWithArgsBuilder(); @@ -41,11 +41,11 @@ class _$GHumanWithArgsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GHumanWithArgsVars)) + specifiedType: const FullType(_i3.GHumanWithArgsVars))! as _i3.GHumanWithArgsVars); break; case 'operation': @@ -65,16 +65,14 @@ class _$GHumanWithArgs extends GHumanWithArgs { @override final _i1.Operation operation; - factory _$GHumanWithArgs([void Function(GHumanWithArgsBuilder) updates]) => + factory _$GHumanWithArgs([void Function(GHumanWithArgsBuilder)? updates]) => (new GHumanWithArgsBuilder()..update(updates)).build(); - _$GHumanWithArgs._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GHumanWithArgs', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GHumanWithArgs', 'operation'); - } + _$GHumanWithArgs._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GHumanWithArgs', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GHumanWithArgs', 'operation'); } @override @@ -109,25 +107,26 @@ class _$GHumanWithArgs extends GHumanWithArgs { class GHumanWithArgsBuilder implements Builder { - _$GHumanWithArgs _$v; + _$GHumanWithArgs? _$v; - _i3.GHumanWithArgsVarsBuilder _vars; + _i3.GHumanWithArgsVarsBuilder? _vars; _i3.GHumanWithArgsVarsBuilder get vars => _$this._vars ??= new _i3.GHumanWithArgsVarsBuilder(); - set vars(_i3.GHumanWithArgsVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GHumanWithArgsVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GHumanWithArgsBuilder() { GHumanWithArgs._initializeBuilder(this); } GHumanWithArgsBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -135,14 +134,12 @@ class GHumanWithArgsBuilder @override void replace(GHumanWithArgs other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHumanWithArgs; } @override - void update(void Function(GHumanWithArgsBuilder) updates) { + void update(void Function(GHumanWithArgsBuilder)? updates) { if (updates != null) updates(this); } @@ -151,9 +148,12 @@ class GHumanWithArgsBuilder _$GHumanWithArgs _$result; try { _$result = _$v ?? - new _$GHumanWithArgs._(vars: vars.build(), operation: operation); + new _$GHumanWithArgs._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GHumanWithArgs', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.dart b/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.dart index 7a5ccfb16..d16f4cbe1 100644 --- a/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.dart +++ b/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.dart @@ -17,7 +17,8 @@ abstract class GHumanWithArgsVars static Serializer get serializer => _$gHumanWithArgsVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GHumanWithArgsVars.serializer, this); - static GHumanWithArgsVars fromJson(Map json) => + (_i1.serializers.serializeWith(GHumanWithArgsVars.serializer, this) + as Map); + static GHumanWithArgsVars? fromJson(Map json) => _i1.serializers.deserializeWith(GHumanWithArgsVars.serializer, json); } diff --git a/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.g.dart b/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.g.dart index dfa2664b7..edee32edd 100644 --- a/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.g.dart +++ b/codegen/end_to_end_test/lib/variables/human_with_args.var.gql.g.dart @@ -17,9 +17,10 @@ class _$GHumanWithArgsVarsSerializer final String wireName = 'GHumanWithArgsVars'; @override - Iterable serialize(Serializers serializers, GHumanWithArgsVars object, + Iterable serialize( + Serializers serializers, GHumanWithArgsVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; @@ -29,7 +30,7 @@ class _$GHumanWithArgsVarsSerializer @override GHumanWithArgsVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GHumanWithArgsVarsBuilder(); @@ -37,7 +38,7 @@ class _$GHumanWithArgsVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -55,13 +56,11 @@ class _$GHumanWithArgsVars extends GHumanWithArgsVars { final String id; factory _$GHumanWithArgsVars( - [void Function(GHumanWithArgsVarsBuilder) updates]) => + [void Function(GHumanWithArgsVarsBuilder)? updates]) => (new GHumanWithArgsVarsBuilder()..update(updates)).build(); - _$GHumanWithArgsVars._({this.id}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('GHumanWithArgsVars', 'id'); - } + _$GHumanWithArgsVars._({required this.id}) : super._() { + BuiltValueNullFieldError.checkNotNull(id, 'GHumanWithArgsVars', 'id'); } @override @@ -93,17 +92,18 @@ class _$GHumanWithArgsVars extends GHumanWithArgsVars { class GHumanWithArgsVarsBuilder implements Builder { - _$GHumanWithArgsVars _$v; + _$GHumanWithArgsVars? _$v; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GHumanWithArgsVarsBuilder(); GHumanWithArgsVarsBuilder get _$this { - if (_$v != null) { - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _id = $v.id; _$v = null; } return this; @@ -111,20 +111,21 @@ class GHumanWithArgsVarsBuilder @override void replace(GHumanWithArgsVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHumanWithArgsVars; } @override - void update(void Function(GHumanWithArgsVarsBuilder) updates) { + void update(void Function(GHumanWithArgsVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GHumanWithArgsVars build() { - final _$result = _$v ?? new _$GHumanWithArgsVars._(id: id); + final _$result = _$v ?? + new _$GHumanWithArgsVars._( + id: BuiltValueNullFieldError.checkNotNull( + id, 'GHumanWithArgsVars', 'id')); replace(_$result); return _$result; } diff --git a/codegen/end_to_end_test/pubspec.yaml b/codegen/end_to_end_test/pubspec.yaml index 9e7fffbed..10b141481 100644 --- a/codegen/end_to_end_test/pubspec.yaml +++ b/codegen/end_to_end_test/pubspec.yaml @@ -4,15 +4,14 @@ publish_to: none description: Tests, not for publishing.\n repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.0.0-dev <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - built_collection: '>=2.0.0 <5.0.0' - built_value: ^7.0.2 - gql_exec: ^0.2.5 - gql_build: ^0.1.3 - gql_code_builder: ^0.1.3 + built_collection: ^5.0.0 + built_value: ^8.0.6 + gql_exec: ^0.3.0-nullsafety.2 + gql_build: ^0.2.0-nullsafety.1 + gql_code_builder: ^0.2.0-nullsafety.1 dev_dependencies: - collection: ^1.14.13 - build: ^1.0.0 - build_runner: ^1.10.1 - test: ^1.0.0 + build: ^2.0.0 + build_runner: ^2.0.0 + test: ^1.16.8 diff --git a/codegen/end_to_end_test/test/custom_serializers/operation_serializer_test.dart b/codegen/end_to_end_test/test/custom_serializers/operation_serializer_test.dart index d80b21b9a..75eb391f6 100644 --- a/codegen/end_to_end_test/test/custom_serializers/operation_serializer_test.dart +++ b/codegen/end_to_end_test/test/custom_serializers/operation_serializer_test.dart @@ -14,7 +14,7 @@ void main() { ); final json = serializers.serialize(operation); final Operation deserialized = - serializers.deserializeWith(OperationSerializer(), json); + serializers.deserializeWith(OperationSerializer(), json)!; expect(deserialized, equals(operation)); }); @@ -22,7 +22,7 @@ void main() { final operation = Operation(document: document); final json = serializers.serialize(operation); final Operation deserialized = - serializers.deserializeWith(OperationSerializer(), json); + serializers.deserializeWith(OperationSerializer(), json)!; expect(deserialized, equals(operation)); }); }); diff --git a/codegen/end_to_end_test/test/schema/scalars_test.dart b/codegen/end_to_end_test/test/schema/scalars_test.dart index 226dbb5a0..fbf50179d 100644 --- a/codegen/end_to_end_test/test/schema/scalars_test.dart +++ b/codegen/end_to_end_test/test/schema/scalars_test.dart @@ -34,9 +34,9 @@ void main() { ..createReview.stars = 1); test('can use in GraphQL operation data', () { - expect(data.createReview.custom.first, equals(customField)); + expect(data.createReview!.custom.first, equals(customField)); expect( - data.createReview.toJson()['custom'].first, + data.createReview!.toJson()['custom'].first, equals(customField.toJson()), ); }); @@ -61,7 +61,7 @@ void main() { ..seenOn.add(DateTime.fromMillisecondsSinceEpoch(1591892597000)), ); test('correctly overrides scalars in input types', () { - expect(input.seenOn.first, TypeMatcher()); + expect(input.seenOn!.first, TypeMatcher()); }); test('can be serialized and deserialized with custom serializer', () { @@ -109,8 +109,8 @@ void main() { ); test('correctly overrides scalars in data types', () { - expect(data.createReview.seenOn.first, TypeMatcher()); - expect(data.createReview.createdAt, TypeMatcher()); + expect(data.createReview!.seenOn.first, TypeMatcher()); + expect(data.createReview!.createdAt, TypeMatcher()); }); test('can be serialized and deserialized with custom serializer', () { diff --git a/codegen/gql_build/CHANGELOG.md b/codegen/gql_build/CHANGELOG.md index cd898adb6..e2664c592 100644 --- a/codegen/gql_build/CHANGELOG.md +++ b/codegen/gql_build/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.2.0-nullsafety.1 + +- bump `built_value` + +## 0.2.0-nullsafety.0 + +- add initial null-safety support + ## 0.1.4+2 - bump `gql` version diff --git a/codegen/gql_build/lib/gql_build.dart b/codegen/gql_build/lib/gql_build.dart index 50bff978d..b051ccc88 100644 --- a/codegen/gql_build/lib/gql_build.dart +++ b/codegen/gql_build/lib/gql_build.dart @@ -22,7 +22,7 @@ Builder dataBuilder( options.config["schema"] as String, ), (options.config["add_typenames"] ?? true) as bool, - typeOverrideMap(options?.config["type_overrides"]), + typeOverrideMap(options.config["type_overrides"]), ); /// Builds GraphQL type-safe request builder @@ -43,7 +43,7 @@ Builder varBuilder( AssetId.parse( options.config["schema"] as String, ), - typeOverrideMap(options?.config["type_overrides"]), + typeOverrideMap(options.config["type_overrides"]), ); /// Builds GraphQL schema types @@ -51,8 +51,8 @@ Builder schemaBuilder( BuilderOptions options, ) => SchemaBuilder( - typeOverrideMap(options?.config["type_overrides"]), - enumFallbackConfig(options?.config), + typeOverrideMap(options.config["type_overrides"]), + enumFallbackConfig(options.config), ); /// Builds an aggregate Serlializers object for [built_value]s @@ -65,6 +65,6 @@ Builder serializerBuilder( AssetId.parse( options.config["schema"] as String, ), - customSerializers(options?.config["custom_serializers"]), - typeOverrideMap(options?.config["type_overrides"]), + customSerializers(options.config["custom_serializers"]), + typeOverrideMap(options.config["type_overrides"]), ); diff --git a/codegen/gql_build/lib/src/allocators/gql_allocator.dart b/codegen/gql_build/lib/src/allocators/gql_allocator.dart index bfd71d450..f78fec52b 100644 --- a/codegen/gql_build/lib/src/allocators/gql_allocator.dart +++ b/codegen/gql_build/lib/src/allocators/gql_allocator.dart @@ -16,9 +16,9 @@ class GqlAllocator implements Allocator { final String sourceUrl; final String currentUrl; - final String schemaUrl; + final String? schemaUrl; - final _imports = {}; + final _imports = {}; var _keys = 1; GqlAllocator( @@ -29,18 +29,17 @@ class GqlAllocator implements Allocator { @override String allocate(Reference reference) { - final symbol = reference.symbol; + final symbol = reference.symbol!; + final url = reference.url; - if (reference.url == null || _doNotImport.contains(reference.url)) { + if (url == null || _doNotImport.contains(url)) { return symbol; - } - - if (_doNotPrefix.contains(reference.url)) { - _imports.putIfAbsent(reference.url, () => null); + } else if (_doNotPrefix.contains(url)) { + _imports.putIfAbsent(url, () => null); return symbol; } - final uri = Uri.parse(reference.url); + final uri = Uri.parse(url); if (uri.path.endsWith(sourceExtension)) { final replacedUrl = uri @@ -63,9 +62,9 @@ class GqlAllocator implements Allocator { if (uri.path.isEmpty && uri.fragment.isNotEmpty) { String replacedUrl; if (uri.fragment == "schema") { - replacedUrl = schemaUrl; + replacedUrl = schemaUrl!; } else if (uri.fragment == "serializer") { - replacedUrl = "${p.dirname(schemaUrl)}/serializers.gql.dart"; + replacedUrl = "${p.dirname(schemaUrl!)}/serializers.gql.dart"; } else { replacedUrl = sourceUrl.replaceAll( RegExp(r".graphql$"), @@ -80,7 +79,7 @@ class GqlAllocator implements Allocator { return "_i${_imports.putIfAbsent(replacedUrl, _nextKey)}.$symbol"; } - return "_i${_imports.putIfAbsent(reference.url, _nextKey)}.$symbol"; + return "_i${_imports.putIfAbsent(url, _nextKey)}.$symbol"; } int _nextKey() => _keys++; diff --git a/codegen/gql_build/lib/src/allocators/pick_allocator.dart b/codegen/gql_build/lib/src/allocators/pick_allocator.dart index 2dfc3ea79..2e547d3d8 100644 --- a/codegen/gql_build/lib/src/allocators/pick_allocator.dart +++ b/codegen/gql_build/lib/src/allocators/pick_allocator.dart @@ -5,9 +5,12 @@ class PickAllocator implements Allocator { final List doNotPick; final List include; - final Map> _imports = {}; + final Map?> _imports = {}; - PickAllocator({this.doNotPick, this.include}) { + PickAllocator({ + this.doNotPick = const [], + this.include = const [], + }) { for (final url in include) { _imports[url] = null; } @@ -19,26 +22,26 @@ class PickAllocator implements Allocator { @override String allocate(Reference reference) { - final symbol = reference.symbol; - if (reference.url == null || _doNotImport.contains(reference.url)) { - return symbol; - } + final symbol = reference.symbol!; + final url = reference.url; - if (doNotPick.contains(reference.url) || include.contains(reference.url)) { - _imports.putIfAbsent(reference.url, () => null); + if (url == null || _doNotImport.contains(url)) { + return symbol; + } else if (doNotPick.contains(url) || include.contains(url)) { + _imports.putIfAbsent(url, () => null); return symbol; } - _imports.update(reference.url, (symbols) => symbols..add(reference.symbol), - ifAbsent: () => [reference.symbol]); + _imports.update(url, (symbols) => symbols?..add(symbol), + ifAbsent: () => [symbol]); return symbol; } @override Iterable get imports => _imports.entries.map( - (u) => _imports[u.key] == null + (u) => u.value == null ? Directive.import(u.key) - : Directive.import(u.key, show: u.value), + : Directive.import(u.key, show: u.value!), ); } diff --git a/codegen/gql_build/lib/src/serializer_builder.dart b/codegen/gql_build/lib/src/serializer_builder.dart index 1fbb86dfc..4227f1c24 100644 --- a/codegen/gql_build/lib/src/serializer_builder.dart +++ b/codegen/gql_build/lib/src/serializer_builder.dart @@ -53,8 +53,8 @@ class SerializerBuilder implements Builder { final hasSerializer = (ClassElement c) => c.fields.any((field) => field.isStatic && field.name == "serializer" && - field.type.element.name == "Serializer" && - field.type.element.source.uri.toString() == + field.type.element?.name == "Serializer" && + field.type.element?.source?.uri.toString() == "package:built_value/serializer.dart"); final isBuiltValue = (ClassElement c) => c.allSupertypes.any((interface) => @@ -99,16 +99,15 @@ class SerializerBuilder implements Builder { ); final _emitter = DartEmitter( - PickAllocator( + allocator: PickAllocator( doNotPick: ["package:built_value/serializer.dart"], include: [ "package:built_collection/built_collection.dart", - ...typeOverrides.values - .map((ref) => ref.url) - .where((url) => url != null) + ...typeOverrides.values.map((ref) => ref.url).whereType() ], ), - true, + orderDirectives: true, + useNullSafetySyntax: true, ); final output = AssetId( diff --git a/codegen/gql_build/lib/src/utils/add_introspection.dart b/codegen/gql_build/lib/src/utils/add_introspection.dart index 70e9de875..cbe0eb2e6 100644 --- a/codegen/gql_build/lib/src/utils/add_introspection.dart +++ b/codegen/gql_build/lib/src/utils/add_introspection.dart @@ -53,7 +53,7 @@ class AddTypenameField extends TransformingVisitor { return node; } - final hasTypename = node.selectionSet.selections + final hasTypename = node.selectionSet!.selections .whereType() .any((node) => node.name.value == "__typename"); @@ -69,7 +69,7 @@ class AddTypenameField extends TransformingVisitor { FieldNode( name: NameNode(value: "__typename"), ), - ...node.selectionSet.selections, + ...node.selectionSet!.selections, ], ), ); diff --git a/codegen/gql_build/lib/src/utils/reader.dart b/codegen/gql_build/lib/src/utils/reader.dart index ee6f0c867..ff3d24b6f 100644 --- a/codegen/gql_build/lib/src/utils/reader.dart +++ b/codegen/gql_build/lib/src/utils/reader.dart @@ -9,9 +9,9 @@ import "package:gql_build/src/config.dart"; Set _getImports( String source, { - AssetId from, + AssetId? from, }) { - final imports = {}; + final imports = {}; final patterns = [ RegExp(r'^#\s*import\s+"([^"]+)"', multiLine: true), @@ -19,12 +19,14 @@ Set _getImports( ]; for (final pattern in patterns) { - pattern.allMatches(source)?.forEach( + pattern.allMatches(source).forEach( (match) { - final path = match?.group(1); + final path = match.group(1); if (path != null) { imports.add( - path.endsWith(sourceExtension) ? path : "$path$sourceExtension", + Uri.parse( + path.endsWith(sourceExtension) ? path : "$path$sourceExtension", + ), ); } }, @@ -73,7 +75,7 @@ Future _assetToSourceNode( Future readDocument( BuildStep buildStep, [ - AssetId rootId, + AssetId? rootId, ]) => _assetToSourceNode( buildStep, diff --git a/codegen/gql_build/lib/src/utils/writer.dart b/codegen/gql_build/lib/src/utils/writer.dart index bb34fdd4a..9991d5d2f 100644 --- a/codegen/gql_build/lib/src/utils/writer.dart +++ b/codegen/gql_build/lib/src/utils/writer.dart @@ -12,20 +12,21 @@ Future writeDocument( Library library, BuildStep buildStep, String extension, [ - String schemaUrl, + String? schemaUrl, ]) { - if (library.body.isEmpty) return null; + if (library.body.isEmpty) return Future.value(null); final generatedAsset = buildStep.inputId.changeExtension(extension); final genSrc = _dartfmt.format("${library.accept( DartEmitter( - GqlAllocator( + allocator: GqlAllocator( buildStep.inputId.uri.toString(), generatedAsset.uri.toString(), schemaUrl, ), - true, + orderDirectives: true, + useNullSafetySyntax: true, ), )}"); diff --git a/codegen/gql_build/pubspec.yaml b/codegen/gql_build/pubspec.yaml index bc69d2881..2150b6d27 100644 --- a/codegen/gql_build/pubspec.yaml +++ b/codegen/gql_build/pubspec.yaml @@ -1,22 +1,22 @@ name: gql_build -version: 0.1.4+2 +version: 0.2.0-nullsafety.1 description: Useful builders for your GraphQL SDL and documents. Based on package:gql_code_builder and package:build repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - analyzer: ^0.39.14 - gql: ^0.12.4 - path: ^1.6.4 - glob: ^1.2.0 - build: ^1.0.0 - gql_code_builder: ^0.1.4 - code_builder: ^3.3.0 - dart_style: ^1.2.9 - built_value: ^7.1.0 - built_value_generator: ^7.1.0 - built_collection: ^4.3.2 - yaml: ^2.2.1 + analyzer: ^1.2.0 + build: ^2.0.0 + built_collection: ^5.0.0 + built_value: ^8.0.6 + built_value_generator: ^8.0.6 + code_builder: ^4.0.0 + dart_style: ^2.0.0 + glob: ^2.0.0 + gql: ^0.13.0-nullsafety.2 + gql_code_builder: ^0.2.0-nullsafety.1 + path: ^1.8.0 + yaml: ^3.1.0 dev_dependencies: - build_test: ^0.10.7 + build_test: ^2.0.0 gql_pedantic: ^1.0.2 diff --git a/codegen/gql_code_builder/CHANGELOG.md b/codegen/gql_code_builder/CHANGELOG.md index bbf1735e5..3239f9310 100644 --- a/codegen/gql_code_builder/CHANGELOG.md +++ b/codegen/gql_code_builder/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.2.0-nullsafety.1 + +- bump `built_value` + +## 0.2.0-nullsafety.0 + +- add initial null-safety support + ## 0.1.4+1 - bump `gql` version diff --git a/codegen/gql_code_builder/lib/ast.dart b/codegen/gql_code_builder/lib/ast.dart index ff1e1ccde..8b5f651c2 100644 --- a/codegen/gql_code_builder/lib/ast.dart +++ b/codegen/gql_code_builder/lib/ast.dart @@ -22,7 +22,7 @@ Library buildAstLibrary( source.getRefs().map( (ref) => Reference( ref.symbol, - ref.url + "#ast", + ref.url! + "#ast", ), ), ), @@ -43,15 +43,18 @@ Library buildAstLibrary( } String _getName(DefinitionNode def) { - if (def.name != null && def.name.value != null) return def.name.value; + if (def is DirectiveDefinitionNode) return def.name.value; + if (def is TypeDefinitionNode) return def.name.value; + if (def is FragmentDefinitionNode) return def.name.value; + if (def is TypeExtensionNode) return def.name.value; if (def is SchemaDefinitionNode) return "schema"; if (def is OperationDefinitionNode) { + if (def.name != null) return def.name!.value; if (def.type == OperationType.query) return "query"; if (def.type == OperationType.mutation) return "mutation"; if (def.type == OperationType.subscription) return "subscription"; } - - return null; + throw Exception("Unknown DefinitionNode type"); } diff --git a/codegen/gql_code_builder/lib/schema.dart b/codegen/gql_code_builder/lib/schema.dart index 4a548d863..38bbee264 100644 --- a/codegen/gql_code_builder/lib/schema.dart +++ b/codegen/gql_code_builder/lib/schema.dart @@ -1,7 +1,6 @@ import "package:code_builder/code_builder.dart"; import "package:gql_code_builder/src/schema.dart"; import "package:gql_code_builder/source.dart"; -import "package:meta/meta.dart"; Library buildSchemaLibrary( SourceNode schemaSource, @@ -24,15 +23,13 @@ Library buildSchemaLibrary( class EnumFallbackConfig { final bool generateFallbackValuesGlobally; - final String globalEnumFallbackName; + final String? globalEnumFallbackName; final Map fallbackValueMap; const EnumFallbackConfig({ - @required this.generateFallbackValuesGlobally, + required this.generateFallbackValuesGlobally, this.globalEnumFallbackName, - @required this.fallbackValueMap, - }) : assert(fallbackValueMap != null), - assert(generateFallbackValuesGlobally != null), - assert( + required this.fallbackValueMap, + }) : assert( !generateFallbackValuesGlobally || globalEnumFallbackName != null); } diff --git a/codegen/gql_code_builder/lib/serializer.dart b/codegen/gql_code_builder/lib/serializer.dart index 4f19b0cd6..9355d3f14 100644 --- a/codegen/gql_code_builder/lib/serializer.dart +++ b/codegen/gql_code_builder/lib/serializer.dart @@ -42,7 +42,7 @@ Library buildSerializerLibrary( (c) => refer(c.name, c.source.uri.toString()), ) .toList() - ..sort((a, b) => a.symbol.compareTo(b.symbol)), + ..sort((a, b) => a.symbol!.compareTo(b.symbol!)), ) ]), refer("_serializersBuilder") diff --git a/codegen/gql_code_builder/lib/source.dart b/codegen/gql_code_builder/lib/source.dart index 3f6f68d03..b634da666 100644 --- a/codegen/gql_code_builder/lib/source.dart +++ b/codegen/gql_code_builder/lib/source.dart @@ -8,8 +8,8 @@ class SourceNode { final Set imports; const SourceNode({ - this.url, - this.document, + required this.url, + required this.document, this.imports = const {}, }); @@ -38,15 +38,18 @@ class SourceNode { } String _getName(DefinitionNode def) { - if (def.name != null && def.name.value != null) return def.name.value; + if (def is DirectiveDefinitionNode) return def.name.value; + if (def is TypeDefinitionNode) return def.name.value; + if (def is FragmentDefinitionNode) return def.name.value; + if (def is TypeExtensionNode) return def.name.value; if (def is SchemaDefinitionNode) return "schema"; if (def is OperationDefinitionNode) { + if (def.name != null) return def.name!.value; if (def.type == OperationType.query) return "query"; if (def.type == OperationType.mutation) return "mutation"; if (def.type == OperationType.subscription) return "subscription"; } - - return null; + throw Exception("Unknown DefinitionNode type"); } diff --git a/codegen/gql_code_builder/lib/src/ast.dart b/codegen/gql_code_builder/lib/src/ast.dart index fb90b5fe4..1a50b3a16 100644 --- a/codegen/gql_code_builder/lib/src/ast.dart +++ b/codegen/gql_code_builder/lib/src/ast.dart @@ -30,7 +30,7 @@ Expression _node( class _PrintVisitor extends Visitor { Expression _acceptOne( - Node node, + Node? node, ) => node != null ? node.accept(this) : literalNull; @@ -613,9 +613,6 @@ Expression _opType(OperationType t) { case OperationType.subscription: return _ref("OperationType.subscription"); } - - // dead code to satisfy lint - return null; } Expression _directiveLocation(DirectiveLocation location) { @@ -657,7 +654,4 @@ Expression _directiveLocation(DirectiveLocation location) { case DirectiveLocation.inputFieldDefinition: return _ref("DirectiveLocation.inputFieldDefinition"); } - - // dead code to satisfy lint - return null; } diff --git a/codegen/gql_code_builder/lib/src/built_class.dart b/codegen/gql_code_builder/lib/src/built_class.dart index 5d864ccd6..0e7795eb5 100644 --- a/codegen/gql_code_builder/lib/src/built_class.dart +++ b/codegen/gql_code_builder/lib/src/built_class.dart @@ -1,15 +1,14 @@ import "package:built_collection/built_collection.dart"; import "package:code_builder/code_builder.dart"; -import "package:meta/meta.dart"; import "package:recase/recase.dart"; import "./common.dart"; /// Generates a class that implements [Built], along with its serializers Class builtClass({ - @required String name, - Iterable getters, - Map initializers, + required String name, + Iterable? getters, + Map? initializers, }) { final className = builtClassName(name); return Class( @@ -66,7 +65,7 @@ Class builtClass({ initializers, ).code, ), - ...getters, + if (getters != null) ...getters, // Serlialization methods buildSerializerGetter(className).rebuild( (b) => b..body = Code("_\$${className.camelCase}Serializer"), diff --git a/codegen/gql_code_builder/lib/src/common.dart b/codegen/gql_code_builder/lib/src/common.dart index 44d8d12cb..f2258d827 100644 --- a/codegen/gql_code_builder/lib/src/common.dart +++ b/codegen/gql_code_builder/lib/src/common.dart @@ -1,7 +1,7 @@ import "package:built_collection/built_collection.dart"; import "package:code_builder/code_builder.dart"; import "package:gql/ast.dart"; -import "package:meta/meta.dart"; +import "package:collection/collection.dart"; import "../source.dart"; @@ -50,12 +50,12 @@ const _reserved = [ ]; class SourceSelections { - final String url; + final String? url; final List selections; const SourceSelections({ this.url, - this.selections, + required this.selections, }); } @@ -81,20 +81,33 @@ const defaultTypeMap = { Reference _typeRef( TypeNode type, - Map typeMap, -) { + Map typeMap, [ + + /// TODO: remove + /// https://github.com/google/built_value.dart/issues/1011#issuecomment-804843573 + bool inList = false, +]) { if (type is NamedTypeNode) { - return typeMap[type.name.value] ?? Reference(type.name.value); + final ref = typeMap[type.name.value] ?? Reference(type.name.value); + return TypeReference( + (b) => b + ..url = ref.url + ..symbol = ref.symbol + + /// TODO: remove `inList` check + /// https://github.com/google/built_value.dart/issues/1011#issuecomment-804843573 + ..isNullable = !inList && !type.isNonNull, + ); } else if (type is ListTypeNode) { return TypeReference( (b) => b ..url = "package:built_collection/built_collection.dart" ..symbol = "BuiltList" - ..types.add(_typeRef(type.type, typeMap)), + ..isNullable = !type.isNonNull + ..types.add(_typeRef(type.type, typeMap, true)), ); } - - return null; + throw Exception("Unrecognized TypeNode type"); } const defaultRootTypes = { @@ -106,37 +119,30 @@ const defaultRootTypes = { NamedTypeNode unwrapTypeNode( TypeNode node, ) { - if (node is NamedTypeNode) { - return node; - } - if (node is ListTypeNode) { return unwrapTypeNode(node.type); } - - return null; + return node as NamedTypeNode; } -TypeDefinitionNode getTypeDefinitionNode( +TypeDefinitionNode? getTypeDefinitionNode( DocumentNode schema, String name, ) => - schema.definitions.whereType().firstWhere( - (node) => node.name.value == name, - orElse: () => null, - ); + schema.definitions + .whereType() + .firstWhereOrNull((node) => node.name.value == name); Method buildGetter({ - @required NameNode nameNode, - @required TypeNode typeNode, - @required SourceNode schemaSource, + required NameNode nameNode, + required TypeNode typeNode, + required SourceNode schemaSource, Map typeOverrides = const {}, - String typeRefPrefix, + String? typeRefPrefix, bool built = true, }) { final unwrappedTypeNode = unwrapTypeNode(typeNode); final typeName = unwrappedTypeNode.name.value; - final nullable = !unwrappedTypeNode.isNonNull; final typeDef = getTypeDefinitionNode( schemaSource.document, typeName, @@ -162,8 +168,6 @@ Method buildGetter({ return Method( (b) => b ..annotations = ListBuilder([ - if (built && nullable) - refer("nullable", "package:built_value/built_value.dart"), if (built && identifier(nameNode.value) != nameNode.value) refer("BuiltValueField", "package:built_value/built_value.dart") .call([], {"wireName": literalString(nameNode.value)}), @@ -203,16 +207,22 @@ Method buildToJsonGetter( ? refer("serializers", "#serializer") .property("serializeWith") .call([ - refer(className).property("serializer"), - refer("this"), - ]).code + refer(className).property("serializer"), + refer("this"), + ]) + .asA(refer("Map")) + .code : null, ); Method buildFromJsonGetter(String className) => Method( (b) => b ..static = true - ..returns = refer(className) + ..returns = TypeReference( + (b) => b + ..symbol = className + ..isNullable = true, + ) ..name = "fromJson" ..requiredParameters.add(Parameter((b) => b ..type = refer("Map") diff --git a/codegen/gql_code_builder/lib/src/frag_vars.dart b/codegen/gql_code_builder/lib/src/frag_vars.dart index c3b1b0961..768b5da27 100644 --- a/codegen/gql_code_builder/lib/src/frag_vars.dart +++ b/codegen/gql_code_builder/lib/src/frag_vars.dart @@ -1,26 +1,25 @@ import "package:gql/ast.dart"; -import "package:meta/meta.dart"; import "./common.dart"; /// Recursively traverses a fragment and returns a map of variable types from the schema Map fragmentVarTypes({ - @required FragmentDefinitionNode fragment, - @required Map fragmentMap, - @required DocumentNode schema, + required FragmentDefinitionNode fragment, + required Map fragmentMap, + required DocumentNode schema, }) => _varTypesForSelections( fragmentMap: fragmentMap, - selections: fragment.selectionSet?.selections ?? [], + selections: fragment.selectionSet.selections, parentType: fragment.typeCondition.on, schema: schema, ); Map _varTypesForSelections({ - @required List selections, - @required Map fragmentMap, - @required NamedTypeNode parentType, - @required DocumentNode schema, + required List selections, + required Map fragmentMap, + required NamedTypeNode parentType, + required DocumentNode schema, }) => selections.fold({}, (argMap, selection) { if (selection is FieldNode) { @@ -33,7 +32,7 @@ Map _varTypesForSelections({ ), if (selection.selectionSet != null) ..._varTypesForSelections( - selections: selection.selectionSet.selections, + selections: selection.selectionSet!.selections, fragmentMap: fragmentMap, parentType: unwrapTypeNode( _fieldDefinition( @@ -51,12 +50,16 @@ Map _varTypesForSelections({ ..._varTypesForSelections( selections: selection.selectionSet.selections, fragmentMap: fragmentMap, - parentType: selection.typeCondition.on, + parentType: selection.typeCondition?.on ?? parentType, schema: schema, ), }; } else if (selection is FragmentSpreadNode) { final fragment = fragmentMap[selection.name.value]; + if (fragment == null) { + throw Exception( + "Missing fragment definition for ${selection.name.value}"); + } return { ...argMap, ..._varTypesForSelections( @@ -67,13 +70,14 @@ Map _varTypesForSelections({ ), }; } + throw Exception("Unrecognized SelectionNode Type"); }); /// Returns a map of a field's argument variables to their respective types from the schema Map _varTypesForField({ - @required FieldNode field, - @required NamedTypeNode parentType, - @required DocumentNode schema, + required FieldNode field, + required NamedTypeNode parentType, + required DocumentNode schema, }) { if (field.arguments.isEmpty) { return {}; @@ -94,9 +98,9 @@ Map _varTypesForField({ /// Given a field from a query, fetches the field's definition from the schema FieldDefinitionNode _fieldDefinition({ - @required FieldNode field, - @required NamedTypeNode parentType, - @required DocumentNode schema, + required FieldNode field, + required NamedTypeNode parentType, + required DocumentNode schema, }) { final parentTypeDef = getTypeDefinitionNode(schema, parentType.name.value); diff --git a/codegen/gql_code_builder/lib/src/inline_fragment_classes.dart b/codegen/gql_code_builder/lib/src/inline_fragment_classes.dart index 395e41f59..21b945c27 100644 --- a/codegen/gql_code_builder/lib/src/inline_fragment_classes.dart +++ b/codegen/gql_code_builder/lib/src/inline_fragment_classes.dart @@ -1,4 +1,3 @@ -import "package:meta/meta.dart"; import "package:code_builder/code_builder.dart"; import "package:gql/ast.dart"; @@ -14,43 +13,38 @@ import "package:gql_code_builder/source.dart"; /// 3. An instantiable class for each inline fragment that includes the /// common fields and the fragment fields. List buildInlineFragmentClasses({ - @required String name, - @required List fieldGetters, - @required List selections, - @required SourceNode schemaSource, - @required String type, - @required Map typeOverrides, - @required Map fragmentMap, - @required Map superclassSelections, - @required List inlineFragments, - @required bool built, + required String name, + required List fieldGetters, + required List selections, + required SourceNode schemaSource, + required String type, + required Map typeOverrides, + required Map fragmentMap, + required Map superclassSelections, + required List inlineFragments, + required bool built, }) => [ Class( - (b) { - b = b - ..abstract = true - ..name = builtClassName(name) - ..implements.addAll( - superclassSelections.keys.map( - (superName) => refer( - builtClassName(superName), - (superclassSelections[superName].url ?? "") + "#data", - ), + (b) => b + ..abstract = true + ..name = builtClassName(name) + ..implements.addAll( + superclassSelections.keys.map( + (superName) => refer( + builtClassName(superName), + (superclassSelections[superName]?.url ?? "") + "#data", ), - ) - ..methods.addAll(fieldGetters); - if (built) { - b = b - ..methods.addAll( - _inlineFragmentRootSerializationMethods( - name: builtClassName(name), - inlineFragments: inlineFragments, - ), - ); - } - return b; - }, + ), + ) + ..methods.addAll([ + ...fieldGetters, + if (built) + ..._inlineFragmentRootSerializationMethods( + name: builtClassName(name), + inlineFragments: inlineFragments, + ), + ]), ), ...buildSelectionSetDataClasses( name: "${name}__base", @@ -70,32 +64,35 @@ List buildInlineFragmentClasses({ }, built: built, ), - ...inlineFragments.expand( - (inlineFragment) => buildSelectionSetDataClasses( - name: "${name}__as${inlineFragment.typeCondition.on.name.value}", - selections: mergeSelections( - [ - ...selections.whereType(), - ...selections.whereType(), - ...inlineFragment.selectionSet.selections, - ], - fragmentMap, + + /// TODO: Handle inline fragments without a type condition + /// https://spec.graphql.org/June2018/#sec-Inline-Fragments + ...inlineFragments.where((frag) => frag.typeCondition != null).expand( + (inlineFragment) => buildSelectionSetDataClasses( + name: "${name}__as${inlineFragment.typeCondition!.on.name.value}", + selections: mergeSelections( + [ + ...selections.whereType(), + ...selections.whereType(), + ...inlineFragment.selectionSet.selections, + ], + fragmentMap, + ), + fragmentMap: fragmentMap, + schemaSource: schemaSource, + type: inlineFragment.typeCondition!.on.name.value, + typeOverrides: typeOverrides, + superclassSelections: { + name: SourceSelections(url: null, selections: selections) + }, + built: built, + ), ), - fragmentMap: fragmentMap, - schemaSource: schemaSource, - type: inlineFragment.typeCondition.on.name.value, - typeOverrides: typeOverrides, - superclassSelections: { - name: SourceSelections(url: null, selections: selections) - }, - built: built, - ), - ), ]; List _inlineFragmentRootSerializationMethods({ - String name, - List inlineFragments, + required String name, + required List inlineFragments, }) => [ buildSerializerGetter(name).rebuild( @@ -108,11 +105,13 @@ List _inlineFragmentRootSerializationMethods({ literalString(name), refer("${name}__base"), literalList( - inlineFragments.map( - (inlineFragment) => refer( - "${name}__as${inlineFragment.typeCondition.on.name.value}", - ), - ), + /// TODO: Handle inline fragments without a type condition + /// https://spec.graphql.org/June2018/#sec-Inline-Fragments + inlineFragments.where((frag) => frag.typeCondition != null).map( + (inlineFragment) => refer( + "${name}__as${inlineFragment.typeCondition!.on.name.value}", + ), + ), ), ]).code, ), diff --git a/codegen/gql_code_builder/lib/src/operation/data.dart b/codegen/gql_code_builder/lib/src/operation/data.dart index 9e6374e3c..6b6237d2a 100644 --- a/codegen/gql_code_builder/lib/src/operation/data.dart +++ b/codegen/gql_code_builder/lib/src/operation/data.dart @@ -1,4 +1,3 @@ -import "package:meta/meta.dart"; import "package:code_builder/code_builder.dart"; import "package:gql/ast.dart"; @@ -13,9 +12,13 @@ List buildOperationDataClasses( SourceNode schemaSource, Map typeOverrides, ) { + if (op.name == null) { + throw Exception("Operations must be named"); + } + final fragmentMap = _fragmentMap(docSource); return buildSelectionSetDataClasses( - name: "${op.name.value}Data", + name: "${op.name!.value}Data", selections: mergeSelections( op.selectionSet.selections, fragmentMap, @@ -78,7 +81,7 @@ String _operationType( ) { final schemaDefs = schema.definitions.whereType(); - if (schemaDefs.isEmpty) return defaultRootTypes[op.type]; + if (schemaDefs.isEmpty) return defaultRootTypes[op.type]!; return schemaDefs.first.operationTypes .firstWhere( @@ -109,24 +112,24 @@ Map _fragmentMap(SourceNode source) => { /// class that includes the fragment (or descendent) as a spread in its /// [selections]. List buildSelectionSetDataClasses({ - @required String name, - @required List selections, - @required SourceNode schemaSource, - @required String type, - @required Map typeOverrides, - @required Map fragmentMap, - @required Map superclassSelections, + required String name, + required List selections, + required SourceNode schemaSource, + required String type, + required Map typeOverrides, + required Map fragmentMap, + required Map superclassSelections, bool built = true, }) { for (final selection in selections.whereType()) { - assert( - fragmentMap.containsKey(selection.name.value), - "Couldn't find fragment definition for fragment spread '${selection.name.value}'", - ); + if (!fragmentMap.containsKey(selection.name.value)) { + throw Exception( + "Couldn't find fragment definition for fragment spread '${selection.name.value}'"); + } superclassSelections["${selection.name.value}"] = SourceSelections( - url: fragmentMap[selection.name.value].url, + url: fragmentMap[selection.name.value]!.url, selections: mergeSelections( - fragmentMap[selection.name.value].selections, + fragmentMap[selection.name.value]!.selections, fragmentMap, ).whereType().toList(), ); @@ -138,7 +141,7 @@ List buildSelectionSetDataClasses({ final typeDef = getTypeDefinitionNode( schemaSource.document, type, - ); + )!; final typeNode = _getFieldTypeNode( typeDef, node.name.value, @@ -179,7 +182,7 @@ List buildSelectionSetDataClasses({ superclassSelections.keys.map( (superName) => refer( builtClassName(superName), - (superclassSelections[superName].url ?? "") + "#data", + (superclassSelections[superName]?.url ?? "") + "#data", ), ), ) @@ -202,7 +205,7 @@ List buildSelectionSetDataClasses({ superclassSelections.keys.map( (superName) => refer( builtClassName(superName), - (superclassSelections[superName].url ?? "") + "#data", + (superclassSelections[superName]?.url ?? "") + "#data", ), ), ), @@ -216,7 +219,7 @@ List buildSelectionSetDataClasses({ .expand( (field) => buildSelectionSetDataClasses( name: "${name}_${field.alias?.value ?? field.name.value}", - selections: field.selectionSet.selections, + selections: field.selectionSet!.selections, fragmentMap: fragmentMap, schemaSource: schemaSource, type: unwrapTypeNode( @@ -224,7 +227,7 @@ List buildSelectionSetDataClasses({ getTypeDefinitionNode( schemaSource.document, type, - ), + )!, field.name.value, ), ).name.value, @@ -256,7 +259,7 @@ List mergeSelections( final existingNode = selectionMap[key]; final existingSelections = existingNode is FieldNode && existingNode.selectionSet != null - ? existingNode.selectionSet.selections + ? existingNode.selectionSet!.selections : []; selectionMap[key] = FieldNode( name: selection.name, @@ -265,7 +268,7 @@ List mergeSelections( selections: mergeSelections( [ ...existingSelections, - ...selection.selectionSet.selections + ...selection.selectionSet!.selections ], fragmentMap, ))); @@ -289,12 +292,13 @@ List _expandFragmentSpreads( if (selection is FragmentSpreadNode) { if (!fragmentMap.containsKey(selection.name.value)) { throw Exception( - "Couldn't find fragment definition for fragment spread '${selection.name.value}'"); + "Couldn't find fragment definition for fragment spread '${selection.name.value}'", + ); } return [ if (retainFragmentSpreads) selection, ..._expandFragmentSpreads( - fragmentMap[selection.name.value].selections, + fragmentMap[selection.name.value]!.selections, fragmentMap, false, ) @@ -324,7 +328,7 @@ Map _fragmentSelectionsForField( "${entry.key}_${field.alias?.value ?? field.name.value}", SourceSelections( url: entry.value.url, - selections: selection.selectionSet.selections + selections: selection.selectionSet!.selections .whereType() .toList(), ), diff --git a/codegen/gql_code_builder/lib/src/operation/req.dart b/codegen/gql_code_builder/lib/src/operation/req.dart index 2e9577743..74c18c0af 100644 --- a/codegen/gql_code_builder/lib/src/operation/req.dart +++ b/codegen/gql_code_builder/lib/src/operation/req.dart @@ -17,12 +17,12 @@ Class _buildOperationReqClass( OperationDefinitionNode node, ) => builtClass( - name: node.name.value, + name: node.name!.value, getters: [ Method( (b) => b ..returns = refer( - "${builtClassName(node.name.value)}Vars", + "${builtClassName(node.name!.value)}Vars", "#var", ) ..type = MethodType.getter @@ -43,7 +43,7 @@ Class _buildOperationReqClass( [], { "document": refer("document", "#ast"), - "operationName": literalString(node.name.value), + "operationName": literalString(node.name!.value), }, ), }, diff --git a/codegen/gql_code_builder/lib/src/schema.dart b/codegen/gql_code_builder/lib/src/schema.dart index d5bf58bc6..40e06cd4a 100644 --- a/codegen/gql_code_builder/lib/src/schema.dart +++ b/codegen/gql_code_builder/lib/src/schema.dart @@ -7,7 +7,7 @@ import "package:gql_code_builder/src/schema/scalar.dart"; import "package:gql_code_builder/source.dart"; /// Build input types, enums and scalars from schema -Spec buildSchema( +Spec? buildSchema( SourceNode schemaSource, Map typeOverrides, EnumFallbackConfig enumFallbackConfig, @@ -20,7 +20,7 @@ Spec buildSchema( ), ); -class _SchemaBuilderVisitor extends SimpleVisitor { +class _SchemaBuilderVisitor extends SimpleVisitor { final SourceNode schemaSource; final Map typeOverrides; final EnumFallbackConfig enumFallbackConfig; @@ -31,12 +31,12 @@ class _SchemaBuilderVisitor extends SimpleVisitor { this.enumFallbackConfig, ); - Spec _acceptOne( - Node node, + Spec? _acceptOne( + Node? node, ) => node != null ? node.accept(this) : literalNull; - List _acceptMany( + List _acceptMany( List nodes, ) => nodes.map(_acceptOne).toList( @@ -49,7 +49,7 @@ class _SchemaBuilderVisitor extends SimpleVisitor { ) => Library( (b) => b.body.addAll( - _acceptMany(node.definitions).where((d) => d != null), + _acceptMany(node.definitions).whereType(), ), ); @@ -64,7 +64,7 @@ class _SchemaBuilderVisitor extends SimpleVisitor { ); @override - Spec visitScalarTypeDefinitionNode( + Spec? visitScalarTypeDefinitionNode( ScalarTypeDefinitionNode node, ) => typeOverrides.containsKey(node.name.value) diff --git a/codegen/gql_code_builder/lib/src/schema/enum.dart b/codegen/gql_code_builder/lib/src/schema/enum.dart index f4600cb24..e17831da1 100644 --- a/codegen/gql_code_builder/lib/src/schema/enum.dart +++ b/codegen/gql_code_builder/lib/src/schema/enum.dart @@ -34,8 +34,11 @@ Class buildEnumClass( .containsKey(node.name.value)) EnumValueDefinitionNode( name: NameNode( - value: _ensureNoNameClashes( - enumFallbackConfig.globalEnumFallbackName, node)), + value: _ensureNoNameClashes( + enumFallbackConfig.globalEnumFallbackName!, + node, + ), + ), fallback: true) ], builtClassName(node.name.value), diff --git a/codegen/gql_code_builder/lib/src/schema/scalar.dart b/codegen/gql_code_builder/lib/src/schema/scalar.dart index 354b1008e..ebe6d6556 100644 --- a/codegen/gql_code_builder/lib/src/schema/scalar.dart +++ b/codegen/gql_code_builder/lib/src/schema/scalar.dart @@ -40,7 +40,11 @@ ListBuilder _buildConstructors( Parameter( (b) => b ..name = "value" - ..type = refer("String"), + ..type = TypeReference( + (b) => b + ..symbol = "String" + ..isNullable = true, + ), ), ) ..body = refer("_\$${scalarName}").call([ @@ -105,7 +109,15 @@ ListBuilder _buildMethods( ), ) ..lambda = true - ..body = refer(scalarName).call([refer("serialized")]).code, + ..body = refer(scalarName).call([ + refer("serialized").asA( + TypeReference( + (b) => b + ..symbol = "String" + ..isNullable = true, + ), + ) + ]).code, ).closure ]).code, ), diff --git a/codegen/gql_code_builder/lib/src/serializers/default_scalar_serializer.dart b/codegen/gql_code_builder/lib/src/serializers/default_scalar_serializer.dart index 886077e80..a3488b424 100644 --- a/codegen/gql_code_builder/lib/src/serializers/default_scalar_serializer.dart +++ b/codegen/gql_code_builder/lib/src/serializers/default_scalar_serializer.dart @@ -13,7 +13,7 @@ class DefaultScalarSerializer implements PrimitiveSerializer { @override Object serialize(Serializers serializers, T scalar, {FullType specifiedType = FullType.unspecified}) => - (scalar as dynamic).value; + (scalar as dynamic).value as Object; @override T deserialize(Serializers serializers, Object serialized, diff --git a/codegen/gql_code_builder/lib/src/serializers/inline_fragment_serializer.dart b/codegen/gql_code_builder/lib/src/serializers/inline_fragment_serializer.dart index d1d61089f..38212b278 100644 --- a/codegen/gql_code_builder/lib/src/serializers/inline_fragment_serializer.dart +++ b/codegen/gql_code_builder/lib/src/serializers/inline_fragment_serializer.dart @@ -32,7 +32,7 @@ class InlineFragmentSerializer implements StructuredSerializer { // Get JSON representation of object final json = StandardJsonPlugin() .afterSerialize(serialized, specifiedType) as Map; - final typeName = json["__typename"] as String ?? ""; + final typeName = (json["__typename"] ?? "") as String; final type = _typeForTypename(typeName); final serializer = serializers.serializerForType(type) as StructuredSerializer; @@ -44,7 +44,7 @@ class InlineFragmentSerializer implements StructuredSerializer { } @override - Iterable serialize( + Iterable serialize( Serializers serializers, T object, { FullType specifiedType = FullType.unspecified, diff --git a/codegen/gql_code_builder/lib/src/serializers/json_serializer.dart b/codegen/gql_code_builder/lib/src/serializers/json_serializer.dart index 3c1f06721..a80bf8074 100644 --- a/codegen/gql_code_builder/lib/src/serializers/json_serializer.dart +++ b/codegen/gql_code_builder/lib/src/serializers/json_serializer.dart @@ -21,7 +21,7 @@ abstract class JsonSerializer implements StructuredSerializer { } @override - Iterable serialize( + Iterable serialize( Serializers serializers, T object, { FullType specifiedType = FullType.unspecified, diff --git a/codegen/gql_code_builder/lib/src/serializers/operation_serializer.dart b/codegen/gql_code_builder/lib/src/serializers/operation_serializer.dart index 6faf82d39..44779352c 100644 --- a/codegen/gql_code_builder/lib/src/serializers/operation_serializer.dart +++ b/codegen/gql_code_builder/lib/src/serializers/operation_serializer.dart @@ -8,7 +8,7 @@ class OperationSerializer extends JsonSerializer { @override Operation fromJson(Map json) => Operation( document: parseString(json["document"] as String), - operationName: json["operationName"] as String, + operationName: json["operationName"] as String?, ); @override diff --git a/codegen/gql_code_builder/lib/var.dart b/codegen/gql_code_builder/lib/var.dart index cde6e4637..bcead5bf8 100644 --- a/codegen/gql_code_builder/lib/var.dart +++ b/codegen/gql_code_builder/lib/var.dart @@ -16,7 +16,7 @@ Library buildVarLibrary( .whereType() .map( (op) => builtClass( - name: "${op.name.value}Vars", + name: "${op.name!.value}Vars", getters: op.variableDefinitions.map( (node) => buildGetter( nameNode: node.variable.name, diff --git a/codegen/gql_code_builder/pubspec.yaml b/codegen/gql_code_builder/pubspec.yaml index 8dc396126..add58f5f7 100644 --- a/codegen/gql_code_builder/pubspec.yaml +++ b/codegen/gql_code_builder/pubspec.yaml @@ -1,20 +1,20 @@ name: gql_code_builder -version: 0.1.4+1 +version: 0.2.0-nullsafety.1 description: Dart code builders taking *.graphql documents and SDL to build useful classes. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - analyzer: ^0.39.14 - gql: ^0.12.4 - code_builder: ^3.3.0 - meta: ^1.1.7 - built_collection: ^4.0.0 - built_value: ^7.0.9 - path: ^1.6.4 - recase: ^3.0.0 - gql_exec: ^0.2.5 + analyzer: ^1.2.0 + built_collection: ^5.0.0 + built_value: ^8.0.6 + code_builder: ^4.0.0 + collection: ^1.15.0 + gql: ^0.13.0-nullsafety.2 + gql_exec: ^0.3.0-nullsafety.2 + path: ^1.8.0 + recase: ^4.0.0-nullsafety.0 dev_dependencies: + build_runner: ^2.0.0 gql_pedantic: ^1.0.2 - build_runner: ^1.7.4 - test: ^1.0.0 + test: ^1.16.8 diff --git a/codegen/gql_code_builder/test/enum/enum_fallback_test.dart b/codegen/gql_code_builder/test/enum/enum_fallback_test.dart index b8886d3a3..b0f51e072 100644 --- a/codegen/gql_code_builder/test/enum/enum_fallback_test.dart +++ b/codegen/gql_code_builder/test/enum/enum_fallback_test.dart @@ -1,3 +1,4 @@ +// @dart=2.9 import "package:code_builder/code_builder.dart"; import "package:gql/ast.dart"; import "package:gql_code_builder/schema.dart"; @@ -6,7 +7,7 @@ import "package:test/test.dart"; void main() { final simpleEnum = - EnumTypeDefinitionNode(name: NameNode(value: "testEnum"), values: [ + EnumTypeDefinitionNode(name: NameNode(value: "testEnum"), values: const [ EnumValueDefinitionNode(name: NameNode(value: "val1")), EnumValueDefinitionNode(name: NameNode(value: "val2")) ]); @@ -132,10 +133,12 @@ void main() { test("works with escaped names", () { final clazz = buildEnumClass( - EnumTypeDefinitionNode(name: NameNode(value: "testEnum"), values: [ - EnumValueDefinitionNode(name: NameNode(value: "name")), - EnumValueDefinitionNode(name: NameNode(value: "default")) - ]), + EnumTypeDefinitionNode( + name: NameNode(value: "testEnum"), + values: const [ + EnumValueDefinitionNode(name: NameNode(value: "name")), + EnumValueDefinitionNode(name: NameNode(value: "default")) + ]), EnumFallbackConfig( generateFallbackValuesGlobally: false, fallbackValueMap: {"testEnum": "default"})); @@ -161,7 +164,8 @@ void main() { InvokeExpression getBuiltValueEnumConstAnnotation(Field field) => field.annotations.whereType().singleWhere( - (annotation) => - (annotation.target is Reference) && - (annotation.target as Reference).symbol == "BuiltValueEnumConst", - orElse: () => null); + (annotation) => + (annotation.target is Reference) && + (annotation.target as Reference).symbol == "BuiltValueEnumConst", + orElse: () => null, + ); diff --git a/docs/gql.svg b/docs/gql.svg index 0adbb9246..7a8310382 100644 --- a/docs/gql.svg +++ b/docs/gql.svg @@ -1,590 +1,590 @@ - - - + + packages - + cluster - + cluster links - -links + +links cluster codegen - -codegen + +codegen cluster examples - -examples + +examples gql_pedantic - -gql_pedantic + +gql_pedantic cats - -cats + +cats gql - -gql + +gql gql->gql_pedantic - - + + gql->cats - - + + gql_exec - -gql_exec + +gql_exec gql_exec->gql_pedantic - - + + gql_exec->gql - - + + gql_link - -gql_link + +gql_link gql_link->gql_pedantic - - + + gql_link->gql - - + + gql_link->gql_exec - - + + gql_websocket_link - -gql_websocket_link + +gql_websocket_link gql_websocket_link->gql_pedantic - - + + gql_websocket_link->gql - - + + gql_websocket_link->gql_exec - - + + gql_websocket_link->gql_link - - + + gql_transform_link - -gql_transform_link + +gql_transform_link gql_transform_link->gql_pedantic - - + + gql_transform_link->gql - - + + gql_transform_link->gql_exec - - + + gql_transform_link->gql_link - - + + gql_http_link - -gql_http_link + +gql_http_link gql_http_link->gql_pedantic - - + + gql_http_link->gql - - + + gql_http_link->gql_exec - - + + gql_http_link->gql_link - - + + gql_error_link - -gql_error_link + +gql_error_link gql_error_link->gql_pedantic - - + + gql_error_link->gql - - + + gql_error_link->gql_exec - - + + gql_error_link->gql_link - - + + gql_code_builder - -gql_code_builder + +gql_code_builder gql_code_builder->gql_pedantic - - + + gql_code_builder->gql - - + + gql_code_builder->gql_exec - - + + gql_build - -gql_build + +gql_build gql_build->gql_pedantic - - + + gql_build->gql - - + + gql_build->gql_code_builder - - + + gql_example_http_auth_link - -gql_example_http_auth_link + +gql_example_http_auth_link gql_example_http_auth_link->gql_pedantic - - + + gql_example_http_auth_link->gql - - + + gql_example_http_auth_link->gql_exec - - + + gql_example_http_auth_link->gql_link - - + + gql_example_http_auth_link->gql_transform_link - - + + gql_example_http_auth_link->gql_http_link - - + + gql_example_http_auth_link->gql_error_link - - + + gql_example_http_auth_link->gql_build - - + + gql_example_flutter - -gql_example_flutter + +gql_example_flutter gql_example_flutter->gql_pedantic - - + + gql_example_flutter->gql - - + + gql_example_flutter->gql_exec - - + + gql_example_flutter->gql_link - - + + gql_example_flutter->gql_http_link - - + + gql_example_flutter->gql_build - - + + gql_dio_link - -gql_dio_link + +gql_dio_link gql_dio_link->gql_pedantic - - + + gql_dio_link->gql - - + + - + gql_dio_link->gql_exec - - + + - + gql_dio_link->gql_link - - + + gql_example_dio_link - -gql_example_dio_link + +gql_example_dio_link gql_example_dio_link->gql - - + + gql_example_dio_link->gql_exec - - + + gql_example_dio_link->gql_link - - + + gql_example_dio_link->gql_dio_link - - + + gql_example_cli_github - -gql_example_cli_github + +gql_example_cli_github gql_example_cli_github->gql_pedantic - - + + gql_example_cli_github->gql - - + + gql_example_cli_github->gql_exec - - + + gql_example_cli_github->gql_link - - + + gql_example_cli_github->gql_transform_link - - + + gql_example_cli_github->gql_http_link - - + + gql_example_cli_github->gql_build - - + + gql_example_cli - -gql_example_cli + +gql_example_cli gql_example_cli->gql_pedantic - - + + gql_example_cli->gql - - + + gql_example_cli->gql_exec - - + + gql_example_cli->gql_link - - + + gql_example_cli->gql_http_link - - + + gql_example_cli->gql_build - - + + gql_example_build - -gql_example_build + +gql_example_build gql_example_build->gql_pedantic - - + + gql_example_build->gql_build - - + + gql_dedupe_link - -gql_dedupe_link + +gql_dedupe_link gql_dedupe_link->gql_pedantic - - + + gql_dedupe_link->gql - - + + gql_dedupe_link->gql_exec - - + + gql_dedupe_link->gql_link - - + + end_to_end_test - -end_to_end_test + +end_to_end_test end_to_end_test->gql_exec - - + + end_to_end_test->gql_code_builder - - + + end_to_end_test->gql_build - - + + diff --git a/examples/gql_example_build/lib/fragments/shape.data.gql.dart b/examples/gql_example_build/lib/fragments/shape.data.gql.dart index 2ecc8b7df..a16104d54 100644 --- a/examples/gql_example_build/lib/fragments/shape.data.gql.dart +++ b/examples/gql_example_build/lib/fragments/shape.data.gql.dart @@ -17,28 +17,28 @@ abstract class GShapeData implements Built { b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GShapeData_shape get shape; + GShapeData_shape? get shape; static Serializer get serializer => _$gShapeDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GShapeData.serializer, this); - static GShapeData fromJson(Map json) => + (_i1.serializers.serializeWith(GShapeData.serializer, this) + as Map); + static GShapeData? fromJson(Map json) => _i1.serializers.deserializeWith(GShapeData.serializer, json); } abstract class GShapeData_shape { @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - double get area; + double? get area; static Serializer get serializer => _i2.InlineFragmentSerializer( 'GShapeData_shape', GShapeData_shape__base, [GShapeData_shape__asSquare, GShapeData_shape__asRectangle]); Map toJson() => - _i1.serializers.serializeWith(GShapeData_shape.serializer, this); - static GShapeData_shape fromJson(Map json) => + (_i1.serializers.serializeWith(GShapeData_shape.serializer, this) + as Map); + static GShapeData_shape? fromJson(Map json) => _i1.serializers.deserializeWith(GShapeData_shape.serializer, json); } @@ -56,13 +56,13 @@ abstract class GShapeData_shape__base b..G__typename = 'Shape'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - double get area; + double? get area; static Serializer get serializer => _$gShapeDataShapeBaseSerializer; Map toJson() => - _i1.serializers.serializeWith(GShapeData_shape__base.serializer, this); - static GShapeData_shape__base fromJson(Map json) => + (_i1.serializers.serializeWith(GShapeData_shape__base.serializer, this) + as Map); + static GShapeData_shape__base? fromJson(Map json) => _i1.serializers.deserializeWith(GShapeData_shape__base.serializer, json); } @@ -80,15 +80,13 @@ abstract class GShapeData_shape__asSquare b..G__typename = 'Square'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - double get area; - @nullable - double get sideLength; + double? get area; + double? get sideLength; static Serializer get serializer => _$gShapeDataShapeAsSquareSerializer; - Map toJson() => _i1.serializers - .serializeWith(GShapeData_shape__asSquare.serializer, this); - static GShapeData_shape__asSquare fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GShapeData_shape__asSquare.serializer, this) as Map); + static GShapeData_shape__asSquare? fromJson(Map json) => _i1.serializers .deserializeWith(GShapeData_shape__asSquare.serializer, json); } @@ -108,17 +106,14 @@ abstract class GShapeData_shape__asRectangle b..G__typename = 'Rectangle'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - double get area; - @nullable - double get sideLengthA; - @nullable - double get sideLengthB; + double? get area; + double? get sideLengthA; + double? get sideLengthB; static Serializer get serializer => _$gShapeDataShapeAsRectangleSerializer; - Map toJson() => _i1.serializers - .serializeWith(GShapeData_shape__asRectangle.serializer, this); - static GShapeData_shape__asRectangle fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GShapeData_shape__asRectangle.serializer, this) as Map); + static GShapeData_shape__asRectangle? fromJson(Map json) => _i1.serializers .deserializeWith(GShapeData_shape__asRectangle.serializer, json); } diff --git a/examples/gql_example_build/lib/fragments/shape.data.gql.g.dart b/examples/gql_example_build/lib/fragments/shape.data.gql.g.dart index 5d92a1e16..32c1f0748 100644 --- a/examples/gql_example_build/lib/fragments/shape.data.gql.g.dart +++ b/examples/gql_example_build/lib/fragments/shape.data.gql.g.dart @@ -22,24 +22,26 @@ class _$GShapeDataSerializer implements StructuredSerializer { final String wireName = 'GShapeData'; @override - Iterable serialize(Serializers serializers, GShapeData object, + Iterable serialize(Serializers serializers, GShapeData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.shape != null) { + Object? value; + value = object.shape; + if (value != null) { result ..add('shape') - ..add(serializers.serialize(object.shape, + ..add(serializers.serialize(value, specifiedType: const FullType(GShapeData_shape))); } return result; } @override - GShapeData deserialize(Serializers serializers, Iterable serialized, + GShapeData deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GShapeDataBuilder(); @@ -47,7 +49,7 @@ class _$GShapeDataSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -76,18 +78,20 @@ class _$GShapeData_shape__baseSerializer final String wireName = 'GShapeData_shape__base'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GShapeData_shape__base object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.area != null) { + Object? value; + value = object.area; + if (value != null) { result ..add('area') - ..add(serializers.serialize(object.area, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } return result; @@ -95,7 +99,7 @@ class _$GShapeData_shape__baseSerializer @override GShapeData_shape__base deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GShapeData_shape__baseBuilder(); @@ -103,7 +107,7 @@ class _$GShapeData_shape__baseSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -131,24 +135,27 @@ class _$GShapeData_shape__asSquareSerializer final String wireName = 'GShapeData_shape__asSquare'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GShapeData_shape__asSquare object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.area != null) { + Object? value; + value = object.area; + if (value != null) { result ..add('area') - ..add(serializers.serialize(object.area, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } - if (object.sideLength != null) { + value = object.sideLength; + if (value != null) { result ..add('sideLength') - ..add(serializers.serialize(object.sideLength, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } return result; @@ -156,7 +163,7 @@ class _$GShapeData_shape__asSquareSerializer @override GShapeData_shape__asSquare deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GShapeData_shape__asSquareBuilder(); @@ -164,7 +171,7 @@ class _$GShapeData_shape__asSquareSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -196,30 +203,34 @@ class _$GShapeData_shape__asRectangleSerializer final String wireName = 'GShapeData_shape__asRectangle'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GShapeData_shape__asRectangle object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.area != null) { + Object? value; + value = object.area; + if (value != null) { result ..add('area') - ..add(serializers.serialize(object.area, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } - if (object.sideLengthA != null) { + value = object.sideLengthA; + if (value != null) { result ..add('sideLengthA') - ..add(serializers.serialize(object.sideLengthA, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } - if (object.sideLengthB != null) { + value = object.sideLengthB; + if (value != null) { result ..add('sideLengthB') - ..add(serializers.serialize(object.sideLengthB, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } return result; @@ -227,7 +238,7 @@ class _$GShapeData_shape__asRectangleSerializer @override GShapeData_shape__asRectangle deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GShapeData_shape__asRectangleBuilder(); @@ -235,7 +246,7 @@ class _$GShapeData_shape__asRectangleSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -264,15 +275,14 @@ class _$GShapeData extends GShapeData { @override final String G__typename; @override - final GShapeData_shape shape; + final GShapeData_shape? shape; - factory _$GShapeData([void Function(GShapeDataBuilder) updates]) => + factory _$GShapeData([void Function(GShapeDataBuilder)? updates]) => (new GShapeDataBuilder()..update(updates)).build(); - _$GShapeData._({this.G__typename, this.shape}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GShapeData', 'G__typename'); - } + _$GShapeData._({required this.G__typename, this.shape}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData', 'G__typename'); } @override @@ -305,24 +315,25 @@ class _$GShapeData extends GShapeData { } class GShapeDataBuilder implements Builder { - _$GShapeData _$v; + _$GShapeData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GShapeData_shape _shape; - GShapeData_shape get shape => _$this._shape; - set shape(GShapeData_shape shape) => _$this._shape = shape; + GShapeData_shape? _shape; + GShapeData_shape? get shape => _$this._shape; + set shape(GShapeData_shape? shape) => _$this._shape = shape; GShapeDataBuilder() { GShapeData._initializeBuilder(this); } GShapeDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _shape = _$v.shape; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _shape = $v.shape; _$v = null; } return this; @@ -330,21 +341,22 @@ class GShapeDataBuilder implements Builder { @override void replace(GShapeData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GShapeData; } @override - void update(void Function(GShapeDataBuilder) updates) { + void update(void Function(GShapeDataBuilder)? updates) { if (updates != null) updates(this); } @override _$GShapeData build() { - final _$result = - _$v ?? new _$GShapeData._(G__typename: G__typename, shape: shape); + final _$result = _$v ?? + new _$GShapeData._( + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData', 'G__typename'), + shape: shape); replace(_$result); return _$result; } @@ -354,17 +366,16 @@ class _$GShapeData_shape__base extends GShapeData_shape__base { @override final String G__typename; @override - final double area; + final double? area; factory _$GShapeData_shape__base( - [void Function(GShapeData_shape__baseBuilder) updates]) => + [void Function(GShapeData_shape__baseBuilder)? updates]) => (new GShapeData_shape__baseBuilder()..update(updates)).build(); - _$GShapeData_shape__base._({this.G__typename, this.area}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GShapeData_shape__base', 'G__typename'); - } + _$GShapeData_shape__base._({required this.G__typename, this.area}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData_shape__base', 'G__typename'); } @override @@ -400,24 +411,25 @@ class _$GShapeData_shape__base extends GShapeData_shape__base { class GShapeData_shape__baseBuilder implements Builder { - _$GShapeData_shape__base _$v; + _$GShapeData_shape__base? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - double _area; - double get area => _$this._area; - set area(double area) => _$this._area = area; + double? _area; + double? get area => _$this._area; + set area(double? area) => _$this._area = area; GShapeData_shape__baseBuilder() { GShapeData_shape__base._initializeBuilder(this); } GShapeData_shape__baseBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _area = _$v.area; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _area = $v.area; _$v = null; } return this; @@ -425,21 +437,22 @@ class GShapeData_shape__baseBuilder @override void replace(GShapeData_shape__base other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GShapeData_shape__base; } @override - void update(void Function(GShapeData_shape__baseBuilder) updates) { + void update(void Function(GShapeData_shape__baseBuilder)? updates) { if (updates != null) updates(this); } @override _$GShapeData_shape__base build() { final _$result = _$v ?? - new _$GShapeData_shape__base._(G__typename: G__typename, area: area); + new _$GShapeData_shape__base._( + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData_shape__base', 'G__typename'), + area: area); replace(_$result); return _$result; } @@ -449,20 +462,19 @@ class _$GShapeData_shape__asSquare extends GShapeData_shape__asSquare { @override final String G__typename; @override - final double area; + final double? area; @override - final double sideLength; + final double? sideLength; factory _$GShapeData_shape__asSquare( - [void Function(GShapeData_shape__asSquareBuilder) updates]) => + [void Function(GShapeData_shape__asSquareBuilder)? updates]) => (new GShapeData_shape__asSquareBuilder()..update(updates)).build(); - _$GShapeData_shape__asSquare._({this.G__typename, this.area, this.sideLength}) + _$GShapeData_shape__asSquare._( + {required this.G__typename, this.area, this.sideLength}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GShapeData_shape__asSquare', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData_shape__asSquare', 'G__typename'); } @override @@ -502,29 +514,30 @@ class _$GShapeData_shape__asSquare extends GShapeData_shape__asSquare { class GShapeData_shape__asSquareBuilder implements Builder { - _$GShapeData_shape__asSquare _$v; + _$GShapeData_shape__asSquare? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - double _area; - double get area => _$this._area; - set area(double area) => _$this._area = area; + double? _area; + double? get area => _$this._area; + set area(double? area) => _$this._area = area; - double _sideLength; - double get sideLength => _$this._sideLength; - set sideLength(double sideLength) => _$this._sideLength = sideLength; + double? _sideLength; + double? get sideLength => _$this._sideLength; + set sideLength(double? sideLength) => _$this._sideLength = sideLength; GShapeData_shape__asSquareBuilder() { GShapeData_shape__asSquare._initializeBuilder(this); } GShapeData_shape__asSquareBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _area = _$v.area; - _sideLength = _$v.sideLength; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _area = $v.area; + _sideLength = $v.sideLength; _$v = null; } return this; @@ -532,14 +545,12 @@ class GShapeData_shape__asSquareBuilder @override void replace(GShapeData_shape__asSquare other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GShapeData_shape__asSquare; } @override - void update(void Function(GShapeData_shape__asSquareBuilder) updates) { + void update(void Function(GShapeData_shape__asSquareBuilder)? updates) { if (updates != null) updates(this); } @@ -547,7 +558,10 @@ class GShapeData_shape__asSquareBuilder _$GShapeData_shape__asSquare build() { final _$result = _$v ?? new _$GShapeData_shape__asSquare._( - G__typename: G__typename, area: area, sideLength: sideLength); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData_shape__asSquare', 'G__typename'), + area: area, + sideLength: sideLength); replace(_$result); return _$result; } @@ -557,23 +571,24 @@ class _$GShapeData_shape__asRectangle extends GShapeData_shape__asRectangle { @override final String G__typename; @override - final double area; + final double? area; @override - final double sideLengthA; + final double? sideLengthA; @override - final double sideLengthB; + final double? sideLengthB; factory _$GShapeData_shape__asRectangle( - [void Function(GShapeData_shape__asRectangleBuilder) updates]) => + [void Function(GShapeData_shape__asRectangleBuilder)? updates]) => (new GShapeData_shape__asRectangleBuilder()..update(updates)).build(); _$GShapeData_shape__asRectangle._( - {this.G__typename, this.area, this.sideLengthA, this.sideLengthB}) + {required this.G__typename, + this.area, + this.sideLengthA, + this.sideLengthB}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GShapeData_shape__asRectangle', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData_shape__asRectangle', 'G__typename'); } @override @@ -618,34 +633,35 @@ class GShapeData_shape__asRectangleBuilder implements Builder { - _$GShapeData_shape__asRectangle _$v; + _$GShapeData_shape__asRectangle? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - double _area; - double get area => _$this._area; - set area(double area) => _$this._area = area; + double? _area; + double? get area => _$this._area; + set area(double? area) => _$this._area = area; - double _sideLengthA; - double get sideLengthA => _$this._sideLengthA; - set sideLengthA(double sideLengthA) => _$this._sideLengthA = sideLengthA; + double? _sideLengthA; + double? get sideLengthA => _$this._sideLengthA; + set sideLengthA(double? sideLengthA) => _$this._sideLengthA = sideLengthA; - double _sideLengthB; - double get sideLengthB => _$this._sideLengthB; - set sideLengthB(double sideLengthB) => _$this._sideLengthB = sideLengthB; + double? _sideLengthB; + double? get sideLengthB => _$this._sideLengthB; + set sideLengthB(double? sideLengthB) => _$this._sideLengthB = sideLengthB; GShapeData_shape__asRectangleBuilder() { GShapeData_shape__asRectangle._initializeBuilder(this); } GShapeData_shape__asRectangleBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _area = _$v.area; - _sideLengthA = _$v.sideLengthA; - _sideLengthB = _$v.sideLengthB; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _area = $v.area; + _sideLengthA = $v.sideLengthA; + _sideLengthB = $v.sideLengthB; _$v = null; } return this; @@ -653,14 +669,12 @@ class GShapeData_shape__asRectangleBuilder @override void replace(GShapeData_shape__asRectangle other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GShapeData_shape__asRectangle; } @override - void update(void Function(GShapeData_shape__asRectangleBuilder) updates) { + void update(void Function(GShapeData_shape__asRectangleBuilder)? updates) { if (updates != null) updates(this); } @@ -668,7 +682,8 @@ class GShapeData_shape__asRectangleBuilder _$GShapeData_shape__asRectangle build() { final _$result = _$v ?? new _$GShapeData_shape__asRectangle._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GShapeData_shape__asRectangle', 'G__typename'), area: area, sideLengthA: sideLengthA, sideLengthB: sideLengthB); diff --git a/examples/gql_example_build/lib/fragments/shape.req.gql.dart b/examples/gql_example_build/lib/fragments/shape.req.gql.dart index c9b4710cb..84781f860 100644 --- a/examples/gql_example_build/lib/fragments/shape.req.gql.dart +++ b/examples/gql_example_build/lib/fragments/shape.req.gql.dart @@ -20,7 +20,8 @@ abstract class GShape implements Built { _i1.Operation get operation; static Serializer get serializer => _$gShapeSerializer; Map toJson() => - _i4.serializers.serializeWith(GShape.serializer, this); - static GShape fromJson(Map json) => + (_i4.serializers.serializeWith(GShape.serializer, this) + as Map); + static GShape? fromJson(Map json) => _i4.serializers.deserializeWith(GShape.serializer, json); } diff --git a/examples/gql_example_build/lib/fragments/shape.req.gql.g.dart b/examples/gql_example_build/lib/fragments/shape.req.gql.g.dart index 1e13ca889..2cafaca5e 100644 --- a/examples/gql_example_build/lib/fragments/shape.req.gql.g.dart +++ b/examples/gql_example_build/lib/fragments/shape.req.gql.g.dart @@ -15,9 +15,9 @@ class _$GShapeSerializer implements StructuredSerializer { final String wireName = 'GShape'; @override - Iterable serialize(Serializers serializers, GShape object, + Iterable serialize(Serializers serializers, GShape object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GShapeVars)), @@ -30,7 +30,7 @@ class _$GShapeSerializer implements StructuredSerializer { } @override - GShape deserialize(Serializers serializers, Iterable serialized, + GShape deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GShapeBuilder(); @@ -38,11 +38,12 @@ class _$GShapeSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GShapeVars)) as _i3.GShapeVars); + specifiedType: const FullType(_i3.GShapeVars))! + as _i3.GShapeVars); break; case 'operation': result.operation = serializers.deserialize(value, @@ -61,16 +62,12 @@ class _$GShape extends GShape { @override final _i1.Operation operation; - factory _$GShape([void Function(GShapeBuilder) updates]) => + factory _$GShape([void Function(GShapeBuilder)? updates]) => (new GShapeBuilder()..update(updates)).build(); - _$GShape._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GShape', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GShape', 'operation'); - } + _$GShape._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GShape', 'vars'); + BuiltValueNullFieldError.checkNotNull(operation, 'GShape', 'operation'); } @override @@ -103,25 +100,26 @@ class _$GShape extends GShape { } class GShapeBuilder implements Builder { - _$GShape _$v; + _$GShape? _$v; - _i3.GShapeVarsBuilder _vars; + _i3.GShapeVarsBuilder? _vars; _i3.GShapeVarsBuilder get vars => _$this._vars ??= new _i3.GShapeVarsBuilder(); - set vars(_i3.GShapeVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GShapeVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GShapeBuilder() { GShape._initializeBuilder(this); } GShapeBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -129,14 +127,12 @@ class GShapeBuilder implements Builder { @override void replace(GShape other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GShape; } @override - void update(void Function(GShapeBuilder) updates) { + void update(void Function(GShapeBuilder)? updates) { if (updates != null) updates(this); } @@ -144,10 +140,13 @@ class GShapeBuilder implements Builder { _$GShape build() { _$GShape _$result; try { - _$result = - _$v ?? new _$GShape._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GShape._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GShape', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_build/lib/fragments/shape.var.gql.dart b/examples/gql_example_build/lib/fragments/shape.var.gql.dart index 18e4cb625..62d9c8c47 100644 --- a/examples/gql_example_build/lib/fragments/shape.var.gql.dart +++ b/examples/gql_example_build/lib/fragments/shape.var.gql.dart @@ -13,7 +13,8 @@ abstract class GShapeVars implements Built { static Serializer get serializer => _$gShapeVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GShapeVars.serializer, this); - static GShapeVars fromJson(Map json) => + (_i1.serializers.serializeWith(GShapeVars.serializer, this) + as Map); + static GShapeVars? fromJson(Map json) => _i1.serializers.deserializeWith(GShapeVars.serializer, json); } diff --git a/examples/gql_example_build/lib/fragments/shape.var.gql.g.dart b/examples/gql_example_build/lib/fragments/shape.var.gql.g.dart index e1b63196b..c46ba877b 100644 --- a/examples/gql_example_build/lib/fragments/shape.var.gql.g.dart +++ b/examples/gql_example_build/lib/fragments/shape.var.gql.g.dart @@ -15,20 +15,20 @@ class _$GShapeVarsSerializer implements StructuredSerializer { final String wireName = 'GShapeVars'; @override - Iterable serialize(Serializers serializers, GShapeVars object, + Iterable serialize(Serializers serializers, GShapeVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override - GShapeVars deserialize(Serializers serializers, Iterable serialized, + GShapeVars deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GShapeVarsBuilder().build(); } } class _$GShapeVars extends GShapeVars { - factory _$GShapeVars([void Function(GShapeVarsBuilder) updates]) => + factory _$GShapeVars([void Function(GShapeVarsBuilder)? updates]) => (new GShapeVarsBuilder()..update(updates)).build(); _$GShapeVars._() : super._(); @@ -58,20 +58,18 @@ class _$GShapeVars extends GShapeVars { } class GShapeVarsBuilder implements Builder { - _$GShapeVars _$v; + _$GShapeVars? _$v; GShapeVarsBuilder(); @override void replace(GShapeVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GShapeVars; } @override - void update(void Function(GShapeVarsBuilder) updates) { + void update(void Function(GShapeVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/examples/gql_example_build/lib/kitchen_sink/query.data.gql.dart b/examples/gql_example_build/lib/kitchen_sink/query.data.gql.dart index 45fbe4358..c95484c1d 100644 --- a/examples/gql_example_build/lib/kitchen_sink/query.data.gql.dart +++ b/examples/gql_example_build/lib/kitchen_sink/query.data.gql.dart @@ -18,13 +18,13 @@ abstract class GQueryOperationData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GQueryOperationData_field get field; + GQueryOperationData_field? get field; static Serializer get serializer => _$gQueryOperationDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GQueryOperationData.serializer, this); - static GQueryOperationData fromJson(Map json) => + (_i1.serializers.serializeWith(GQueryOperationData.serializer, this) + as Map); + static GQueryOperationData? fromJson(Map json) => _i1.serializers.deserializeWith(GQueryOperationData.serializer, json); } @@ -41,25 +41,17 @@ abstract class GQueryOperationData_field b..G__typename = 'Field'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get id; - @nullable + String? get id; @BuiltValueField(wireName: 'bool') - bool get Gbool; - @nullable + bool? get Gbool; @BuiltValueField(wireName: 'int') - int get Gint; - @nullable - double get float; - @nullable - String get string; - @nullable - _i2.GScalar get scalar; - @nullable + int? get Gint; + double? get float; + String? get string; + _i2.GScalar? get scalar; @BuiltValueField(wireName: 'enum') - _i2.GEnum get Genum; - @nullable - GQueryOperationData_field_field get field; + _i2.GEnum? get Genum; + GQueryOperationData_field_field? get field; String get idRequired; bool get boolRequired; int get intRequired; @@ -71,8 +63,9 @@ abstract class GQueryOperationData_field static Serializer get serializer => _$gQueryOperationDataFieldSerializer; Map toJson() => - _i1.serializers.serializeWith(GQueryOperationData_field.serializer, this); - static GQueryOperationData_field fromJson(Map json) => + (_i1.serializers.serializeWith(GQueryOperationData_field.serializer, this) + as Map); + static GQueryOperationData_field? fromJson(Map json) => _i1.serializers .deserializeWith(GQueryOperationData_field.serializer, json); } @@ -91,13 +84,13 @@ abstract class GQueryOperationData_field_field b..G__typename = 'Field'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get id; + String? get id; static Serializer get serializer => _$gQueryOperationDataFieldFieldSerializer; - Map toJson() => _i1.serializers - .serializeWith(GQueryOperationData_field_field.serializer, this); - static GQueryOperationData_field_field fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GQueryOperationData_field_field.serializer, this) + as Map); + static GQueryOperationData_field_field? fromJson(Map json) => _i1.serializers .deserializeWith(GQueryOperationData_field_field.serializer, json); } @@ -117,13 +110,13 @@ abstract class GQueryOperationData_field_fieldRequired b..G__typename = 'Field'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get id; + String? get id; static Serializer get serializer => _$gQueryOperationDataFieldFieldRequiredSerializer; - Map toJson() => _i1.serializers - .serializeWith(GQueryOperationData_field_fieldRequired.serializer, this); - static GQueryOperationData_field_fieldRequired fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GQueryOperationData_field_fieldRequired.serializer, this) + as Map); + static GQueryOperationData_field_fieldRequired? fromJson( Map json) => _i1.serializers.deserializeWith( GQueryOperationData_field_fieldRequired.serializer, json); diff --git a/examples/gql_example_build/lib/kitchen_sink/query.data.gql.g.dart b/examples/gql_example_build/lib/kitchen_sink/query.data.gql.g.dart index 408ed71ee..d7104dd56 100644 --- a/examples/gql_example_build/lib/kitchen_sink/query.data.gql.g.dart +++ b/examples/gql_example_build/lib/kitchen_sink/query.data.gql.g.dart @@ -28,18 +28,20 @@ class _$GQueryOperationDataSerializer final String wireName = 'GQueryOperationData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GQueryOperationData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.field != null) { + Object? value; + value = object.field; + if (value != null) { result ..add('field') - ..add(serializers.serialize(object.field, + ..add(serializers.serialize(value, specifiedType: const FullType(GQueryOperationData_field))); } return result; @@ -47,7 +49,7 @@ class _$GQueryOperationDataSerializer @override GQueryOperationData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GQueryOperationDataBuilder(); @@ -55,7 +57,7 @@ class _$GQueryOperationDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -63,7 +65,7 @@ class _$GQueryOperationDataSerializer break; case 'field': result.field.replace(serializers.deserialize(value, - specifiedType: const FullType(GQueryOperationData_field)) + specifiedType: const FullType(GQueryOperationData_field))! as GQueryOperationData_field); break; } @@ -84,10 +86,10 @@ class _$GQueryOperationData_fieldSerializer final String wireName = 'GQueryOperationData_field'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GQueryOperationData_field object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -117,52 +119,60 @@ class _$GQueryOperationData_fieldSerializer specifiedType: const FullType(GQueryOperationData_field_fieldRequired)), ]; - if (object.id != null) { + Object? value; + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.Gbool != null) { + value = object.Gbool; + if (value != null) { result ..add('bool') - ..add(serializers.serialize(object.Gbool, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.Gint != null) { + value = object.Gint; + if (value != null) { result ..add('int') - ..add(serializers.serialize(object.Gint, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.float != null) { + value = object.float; + if (value != null) { result ..add('float') - ..add(serializers.serialize(object.float, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } - if (object.string != null) { + value = object.string; + if (value != null) { result ..add('string') - ..add(serializers.serialize(object.string, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.scalar != null) { + value = object.scalar; + if (value != null) { result ..add('scalar') - ..add(serializers.serialize(object.scalar, + ..add(serializers.serialize(value, specifiedType: const FullType(_i2.GScalar))); } - if (object.Genum != null) { + value = object.Genum; + if (value != null) { result ..add('enum') - ..add(serializers.serialize(object.Genum, + ..add(serializers.serialize(value, specifiedType: const FullType(_i2.GEnum))); } - if (object.field != null) { + value = object.field; + if (value != null) { result ..add('field') - ..add(serializers.serialize(object.field, + ..add(serializers.serialize(value, specifiedType: const FullType(GQueryOperationData_field_field))); } return result; @@ -170,7 +180,7 @@ class _$GQueryOperationData_fieldSerializer @override GQueryOperationData_field deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GQueryOperationData_fieldBuilder(); @@ -178,7 +188,7 @@ class _$GQueryOperationData_fieldSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -206,7 +216,7 @@ class _$GQueryOperationData_fieldSerializer break; case 'scalar': result.scalar.replace(serializers.deserialize(value, - specifiedType: const FullType(_i2.GScalar)) as _i2.GScalar); + specifiedType: const FullType(_i2.GScalar))! as _i2.GScalar); break; case 'enum': result.Genum = serializers.deserialize(value, @@ -215,7 +225,7 @@ class _$GQueryOperationData_fieldSerializer case 'field': result.field.replace(serializers.deserialize(value, specifiedType: - const FullType(GQueryOperationData_field_field)) + const FullType(GQueryOperationData_field_field))! as GQueryOperationData_field_field); break; case 'idRequired': @@ -240,7 +250,7 @@ class _$GQueryOperationData_fieldSerializer break; case 'scalarRequired': result.scalarRequired.replace(serializers.deserialize(value, - specifiedType: const FullType(_i2.GScalar)) as _i2.GScalar); + specifiedType: const FullType(_i2.GScalar))! as _i2.GScalar); break; case 'enumRequired': result.enumRequired = serializers.deserialize(value, @@ -249,7 +259,7 @@ class _$GQueryOperationData_fieldSerializer case 'fieldRequired': result.fieldRequired.replace(serializers.deserialize(value, specifiedType: - const FullType(GQueryOperationData_field_fieldRequired)) + const FullType(GQueryOperationData_field_fieldRequired))! as GQueryOperationData_field_fieldRequired); break; } @@ -270,18 +280,20 @@ class _$GQueryOperationData_field_fieldSerializer final String wireName = 'GQueryOperationData_field_field'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GQueryOperationData_field_field object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.id != null) { + Object? value; + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -289,7 +301,7 @@ class _$GQueryOperationData_field_fieldSerializer @override GQueryOperationData_field_field deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GQueryOperationData_field_fieldBuilder(); @@ -297,7 +309,7 @@ class _$GQueryOperationData_field_fieldSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -325,18 +337,20 @@ class _$GQueryOperationData_field_fieldRequiredSerializer final String wireName = 'GQueryOperationData_field_fieldRequired'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GQueryOperationData_field_fieldRequired object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.id != null) { + Object? value; + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -344,7 +358,7 @@ class _$GQueryOperationData_field_fieldRequiredSerializer @override GQueryOperationData_field_fieldRequired deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GQueryOperationData_field_fieldRequiredBuilder(); @@ -352,7 +366,7 @@ class _$GQueryOperationData_field_fieldRequiredSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -373,16 +387,15 @@ class _$GQueryOperationData extends GQueryOperationData { @override final String G__typename; @override - final GQueryOperationData_field field; + final GQueryOperationData_field? field; factory _$GQueryOperationData( - [void Function(GQueryOperationDataBuilder) updates]) => + [void Function(GQueryOperationDataBuilder)? updates]) => (new GQueryOperationDataBuilder()..update(updates)).build(); - _$GQueryOperationData._({this.G__typename, this.field}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GQueryOperationData', 'G__typename'); - } + _$GQueryOperationData._({required this.G__typename, this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData', 'G__typename'); } @override @@ -418,25 +431,26 @@ class _$GQueryOperationData extends GQueryOperationData { class GQueryOperationDataBuilder implements Builder { - _$GQueryOperationData _$v; + _$GQueryOperationData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GQueryOperationData_fieldBuilder _field; + GQueryOperationData_fieldBuilder? _field; GQueryOperationData_fieldBuilder get field => _$this._field ??= new GQueryOperationData_fieldBuilder(); - set field(GQueryOperationData_fieldBuilder field) => _$this._field = field; + set field(GQueryOperationData_fieldBuilder? field) => _$this._field = field; GQueryOperationDataBuilder() { GQueryOperationData._initializeBuilder(this); } GQueryOperationDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _field = _$v.field?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _field = $v.field?.toBuilder(); _$v = null; } return this; @@ -444,14 +458,12 @@ class GQueryOperationDataBuilder @override void replace(GQueryOperationData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GQueryOperationData; } @override - void update(void Function(GQueryOperationDataBuilder) updates) { + void update(void Function(GQueryOperationDataBuilder)? updates) { if (updates != null) updates(this); } @@ -461,9 +473,11 @@ class GQueryOperationDataBuilder try { _$result = _$v ?? new _$GQueryOperationData._( - G__typename: G__typename, field: _field?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData', 'G__typename'), + field: _field?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'field'; _field?.build(); @@ -482,21 +496,21 @@ class _$GQueryOperationData_field extends GQueryOperationData_field { @override final String G__typename; @override - final String id; + final String? id; @override - final bool Gbool; + final bool? Gbool; @override - final int Gint; + final int? Gint; @override - final double float; + final double? float; @override - final String string; + final String? string; @override - final _i2.GScalar scalar; + final _i2.GScalar? scalar; @override - final _i2.GEnum Genum; + final _i2.GEnum? Genum; @override - final GQueryOperationData_field_field field; + final GQueryOperationData_field_field? field; @override final String idRequired; @override @@ -515,11 +529,11 @@ class _$GQueryOperationData_field extends GQueryOperationData_field { final GQueryOperationData_field_fieldRequired fieldRequired; factory _$GQueryOperationData_field( - [void Function(GQueryOperationData_fieldBuilder) updates]) => + [void Function(GQueryOperationData_fieldBuilder)? updates]) => (new GQueryOperationData_fieldBuilder()..update(updates)).build(); _$GQueryOperationData_field._( - {this.G__typename, + {required this.G__typename, this.id, this.Gbool, this.Gint, @@ -528,51 +542,33 @@ class _$GQueryOperationData_field extends GQueryOperationData_field { this.scalar, this.Genum, this.field, - this.idRequired, - this.boolRequired, - this.intRequired, - this.floatRequired, - this.stringRequired, - this.scalarRequired, - this.enumRequired, - this.fieldRequired}) + required this.idRequired, + required this.boolRequired, + required this.intRequired, + required this.floatRequired, + required this.stringRequired, + required this.scalarRequired, + required this.enumRequired, + required this.fieldRequired}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'G__typename'); - } - if (idRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'idRequired'); - } - if (boolRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'boolRequired'); - } - if (intRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'intRequired'); - } - if (floatRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'floatRequired'); - } - if (stringRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'stringRequired'); - } - if (scalarRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'scalarRequired'); - } - if (enumRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'enumRequired'); - } - if (fieldRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field', 'fieldRequired'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData_field', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + idRequired, 'GQueryOperationData_field', 'idRequired'); + BuiltValueNullFieldError.checkNotNull( + boolRequired, 'GQueryOperationData_field', 'boolRequired'); + BuiltValueNullFieldError.checkNotNull( + intRequired, 'GQueryOperationData_field', 'intRequired'); + BuiltValueNullFieldError.checkNotNull( + floatRequired, 'GQueryOperationData_field', 'floatRequired'); + BuiltValueNullFieldError.checkNotNull( + stringRequired, 'GQueryOperationData_field', 'stringRequired'); + BuiltValueNullFieldError.checkNotNull( + scalarRequired, 'GQueryOperationData_field', 'scalarRequired'); + BuiltValueNullFieldError.checkNotNull( + enumRequired, 'GQueryOperationData_field', 'enumRequired'); + BuiltValueNullFieldError.checkNotNull( + fieldRequired, 'GQueryOperationData_field', 'fieldRequired'); } @override @@ -674,85 +670,85 @@ class _$GQueryOperationData_field extends GQueryOperationData_field { class GQueryOperationData_fieldBuilder implements Builder { - _$GQueryOperationData_field _$v; + _$GQueryOperationData_field? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - bool _Gbool; - bool get Gbool => _$this._Gbool; - set Gbool(bool Gbool) => _$this._Gbool = Gbool; + bool? _Gbool; + bool? get Gbool => _$this._Gbool; + set Gbool(bool? Gbool) => _$this._Gbool = Gbool; - int _Gint; - int get Gint => _$this._Gint; - set Gint(int Gint) => _$this._Gint = Gint; + int? _Gint; + int? get Gint => _$this._Gint; + set Gint(int? Gint) => _$this._Gint = Gint; - double _float; - double get float => _$this._float; - set float(double float) => _$this._float = float; + double? _float; + double? get float => _$this._float; + set float(double? float) => _$this._float = float; - String _string; - String get string => _$this._string; - set string(String string) => _$this._string = string; + String? _string; + String? get string => _$this._string; + set string(String? string) => _$this._string = string; - _i2.GScalarBuilder _scalar; + _i2.GScalarBuilder? _scalar; _i2.GScalarBuilder get scalar => _$this._scalar ??= new _i2.GScalarBuilder(); - set scalar(_i2.GScalarBuilder scalar) => _$this._scalar = scalar; + set scalar(_i2.GScalarBuilder? scalar) => _$this._scalar = scalar; - _i2.GEnum _Genum; - _i2.GEnum get Genum => _$this._Genum; - set Genum(_i2.GEnum Genum) => _$this._Genum = Genum; + _i2.GEnum? _Genum; + _i2.GEnum? get Genum => _$this._Genum; + set Genum(_i2.GEnum? Genum) => _$this._Genum = Genum; - GQueryOperationData_field_fieldBuilder _field; + GQueryOperationData_field_fieldBuilder? _field; GQueryOperationData_field_fieldBuilder get field => _$this._field ??= new GQueryOperationData_field_fieldBuilder(); - set field(GQueryOperationData_field_fieldBuilder field) => + set field(GQueryOperationData_field_fieldBuilder? field) => _$this._field = field; - String _idRequired; - String get idRequired => _$this._idRequired; - set idRequired(String idRequired) => _$this._idRequired = idRequired; + String? _idRequired; + String? get idRequired => _$this._idRequired; + set idRequired(String? idRequired) => _$this._idRequired = idRequired; - bool _boolRequired; - bool get boolRequired => _$this._boolRequired; - set boolRequired(bool boolRequired) => _$this._boolRequired = boolRequired; + bool? _boolRequired; + bool? get boolRequired => _$this._boolRequired; + set boolRequired(bool? boolRequired) => _$this._boolRequired = boolRequired; - int _intRequired; - int get intRequired => _$this._intRequired; - set intRequired(int intRequired) => _$this._intRequired = intRequired; + int? _intRequired; + int? get intRequired => _$this._intRequired; + set intRequired(int? intRequired) => _$this._intRequired = intRequired; - double _floatRequired; - double get floatRequired => _$this._floatRequired; - set floatRequired(double floatRequired) => + double? _floatRequired; + double? get floatRequired => _$this._floatRequired; + set floatRequired(double? floatRequired) => _$this._floatRequired = floatRequired; - String _stringRequired; - String get stringRequired => _$this._stringRequired; - set stringRequired(String stringRequired) => + String? _stringRequired; + String? get stringRequired => _$this._stringRequired; + set stringRequired(String? stringRequired) => _$this._stringRequired = stringRequired; - _i2.GScalarBuilder _scalarRequired; + _i2.GScalarBuilder? _scalarRequired; _i2.GScalarBuilder get scalarRequired => _$this._scalarRequired ??= new _i2.GScalarBuilder(); - set scalarRequired(_i2.GScalarBuilder scalarRequired) => + set scalarRequired(_i2.GScalarBuilder? scalarRequired) => _$this._scalarRequired = scalarRequired; - _i2.GEnum _enumRequired; - _i2.GEnum get enumRequired => _$this._enumRequired; - set enumRequired(_i2.GEnum enumRequired) => + _i2.GEnum? _enumRequired; + _i2.GEnum? get enumRequired => _$this._enumRequired; + set enumRequired(_i2.GEnum? enumRequired) => _$this._enumRequired = enumRequired; - GQueryOperationData_field_fieldRequiredBuilder _fieldRequired; + GQueryOperationData_field_fieldRequiredBuilder? _fieldRequired; GQueryOperationData_field_fieldRequiredBuilder get fieldRequired => _$this._fieldRequired ??= new GQueryOperationData_field_fieldRequiredBuilder(); set fieldRequired( - GQueryOperationData_field_fieldRequiredBuilder fieldRequired) => + GQueryOperationData_field_fieldRequiredBuilder? fieldRequired) => _$this._fieldRequired = fieldRequired; GQueryOperationData_fieldBuilder() { @@ -760,24 +756,25 @@ class GQueryOperationData_fieldBuilder } GQueryOperationData_fieldBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _Gbool = _$v.Gbool; - _Gint = _$v.Gint; - _float = _$v.float; - _string = _$v.string; - _scalar = _$v.scalar?.toBuilder(); - _Genum = _$v.Genum; - _field = _$v.field?.toBuilder(); - _idRequired = _$v.idRequired; - _boolRequired = _$v.boolRequired; - _intRequired = _$v.intRequired; - _floatRequired = _$v.floatRequired; - _stringRequired = _$v.stringRequired; - _scalarRequired = _$v.scalarRequired?.toBuilder(); - _enumRequired = _$v.enumRequired; - _fieldRequired = _$v.fieldRequired?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _Gbool = $v.Gbool; + _Gint = $v.Gint; + _float = $v.float; + _string = $v.string; + _scalar = $v.scalar?.toBuilder(); + _Genum = $v.Genum; + _field = $v.field?.toBuilder(); + _idRequired = $v.idRequired; + _boolRequired = $v.boolRequired; + _intRequired = $v.intRequired; + _floatRequired = $v.floatRequired; + _stringRequired = $v.stringRequired; + _scalarRequired = $v.scalarRequired.toBuilder(); + _enumRequired = $v.enumRequired; + _fieldRequired = $v.fieldRequired.toBuilder(); _$v = null; } return this; @@ -785,14 +782,12 @@ class GQueryOperationData_fieldBuilder @override void replace(GQueryOperationData_field other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GQueryOperationData_field; } @override - void update(void Function(GQueryOperationData_fieldBuilder) updates) { + void update(void Function(GQueryOperationData_fieldBuilder)? updates) { if (updates != null) updates(this); } @@ -802,7 +797,8 @@ class GQueryOperationData_fieldBuilder try { _$result = _$v ?? new _$GQueryOperationData_field._( - G__typename: G__typename, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData_field', 'G__typename'), id: id, Gbool: Gbool, Gint: Gint, @@ -811,16 +807,24 @@ class GQueryOperationData_fieldBuilder scalar: _scalar?.build(), Genum: Genum, field: _field?.build(), - idRequired: idRequired, - boolRequired: boolRequired, - intRequired: intRequired, - floatRequired: floatRequired, - stringRequired: stringRequired, + idRequired: BuiltValueNullFieldError.checkNotNull( + idRequired, 'GQueryOperationData_field', 'idRequired'), + boolRequired: BuiltValueNullFieldError.checkNotNull( + boolRequired, 'GQueryOperationData_field', 'boolRequired'), + intRequired: BuiltValueNullFieldError.checkNotNull( + intRequired, 'GQueryOperationData_field', 'intRequired'), + floatRequired: BuiltValueNullFieldError.checkNotNull( + floatRequired, 'GQueryOperationData_field', 'floatRequired'), + stringRequired: BuiltValueNullFieldError.checkNotNull( + stringRequired, + 'GQueryOperationData_field', + 'stringRequired'), scalarRequired: scalarRequired.build(), - enumRequired: enumRequired, + enumRequired: BuiltValueNullFieldError.checkNotNull( + enumRequired, 'GQueryOperationData_field', 'enumRequired'), fieldRequired: fieldRequired.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'scalar'; _scalar?.build(); @@ -849,17 +853,16 @@ class _$GQueryOperationData_field_field @override final String G__typename; @override - final String id; + final String? id; factory _$GQueryOperationData_field_field( - [void Function(GQueryOperationData_field_fieldBuilder) updates]) => + [void Function(GQueryOperationData_field_fieldBuilder)? updates]) => (new GQueryOperationData_field_fieldBuilder()..update(updates)).build(); - _$GQueryOperationData_field_field._({this.G__typename, this.id}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field_field', 'G__typename'); - } + _$GQueryOperationData_field_field._({required this.G__typename, this.id}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData_field_field', 'G__typename'); } @override @@ -897,24 +900,25 @@ class GQueryOperationData_field_fieldBuilder implements Builder { - _$GQueryOperationData_field_field _$v; + _$GQueryOperationData_field_field? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GQueryOperationData_field_fieldBuilder() { GQueryOperationData_field_field._initializeBuilder(this); } GQueryOperationData_field_fieldBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; _$v = null; } return this; @@ -922,14 +926,12 @@ class GQueryOperationData_field_fieldBuilder @override void replace(GQueryOperationData_field_field other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GQueryOperationData_field_field; } @override - void update(void Function(GQueryOperationData_field_fieldBuilder) updates) { + void update(void Function(GQueryOperationData_field_fieldBuilder)? updates) { if (updates != null) updates(this); } @@ -937,7 +939,9 @@ class GQueryOperationData_field_fieldBuilder _$GQueryOperationData_field_field build() { final _$result = _$v ?? new _$GQueryOperationData_field_field._( - G__typename: G__typename, id: id); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData_field_field', 'G__typename'), + id: id); replace(_$result); return _$result; } @@ -948,20 +952,19 @@ class _$GQueryOperationData_field_fieldRequired @override final String G__typename; @override - final String id; + final String? id; factory _$GQueryOperationData_field_fieldRequired( - [void Function(GQueryOperationData_field_fieldRequiredBuilder) + [void Function(GQueryOperationData_field_fieldRequiredBuilder)? updates]) => (new GQueryOperationData_field_fieldRequiredBuilder()..update(updates)) .build(); - _$GQueryOperationData_field_fieldRequired._({this.G__typename, this.id}) + _$GQueryOperationData_field_fieldRequired._( + {required this.G__typename, this.id}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationData_field_fieldRequired', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GQueryOperationData_field_fieldRequired', 'G__typename'); } @override @@ -1001,24 +1004,25 @@ class GQueryOperationData_field_fieldRequiredBuilder implements Builder { - _$GQueryOperationData_field_fieldRequired _$v; + _$GQueryOperationData_field_fieldRequired? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GQueryOperationData_field_fieldRequiredBuilder() { GQueryOperationData_field_fieldRequired._initializeBuilder(this); } GQueryOperationData_field_fieldRequiredBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; _$v = null; } return this; @@ -1026,15 +1030,13 @@ class GQueryOperationData_field_fieldRequiredBuilder @override void replace(GQueryOperationData_field_fieldRequired other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GQueryOperationData_field_fieldRequired; } @override void update( - void Function(GQueryOperationData_field_fieldRequiredBuilder) updates) { + void Function(GQueryOperationData_field_fieldRequiredBuilder)? updates) { if (updates != null) updates(this); } @@ -1042,7 +1044,9 @@ class GQueryOperationData_field_fieldRequiredBuilder _$GQueryOperationData_field_fieldRequired build() { final _$result = _$v ?? new _$GQueryOperationData_field_fieldRequired._( - G__typename: G__typename, id: id); + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GQueryOperationData_field_fieldRequired', 'G__typename'), + id: id); replace(_$result); return _$result; } diff --git a/examples/gql_example_build/lib/kitchen_sink/query.req.gql.dart b/examples/gql_example_build/lib/kitchen_sink/query.req.gql.dart index 74de956a5..b47e2a7b0 100644 --- a/examples/gql_example_build/lib/kitchen_sink/query.req.gql.dart +++ b/examples/gql_example_build/lib/kitchen_sink/query.req.gql.dart @@ -24,7 +24,8 @@ abstract class GQueryOperation static Serializer get serializer => _$gQueryOperationSerializer; Map toJson() => - _i4.serializers.serializeWith(GQueryOperation.serializer, this); - static GQueryOperation fromJson(Map json) => + (_i4.serializers.serializeWith(GQueryOperation.serializer, this) + as Map); + static GQueryOperation? fromJson(Map json) => _i4.serializers.deserializeWith(GQueryOperation.serializer, json); } diff --git a/examples/gql_example_build/lib/kitchen_sink/query.req.gql.g.dart b/examples/gql_example_build/lib/kitchen_sink/query.req.gql.g.dart index 8be568bdf..d76fa27d6 100644 --- a/examples/gql_example_build/lib/kitchen_sink/query.req.gql.g.dart +++ b/examples/gql_example_build/lib/kitchen_sink/query.req.gql.g.dart @@ -17,9 +17,9 @@ class _$GQueryOperationSerializer final String wireName = 'GQueryOperation'; @override - Iterable serialize(Serializers serializers, GQueryOperation object, + Iterable serialize(Serializers serializers, GQueryOperation object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GQueryOperationVars)), @@ -33,7 +33,7 @@ class _$GQueryOperationSerializer @override GQueryOperation deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GQueryOperationBuilder(); @@ -41,11 +41,11 @@ class _$GQueryOperationSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GQueryOperationVars)) + specifiedType: const FullType(_i3.GQueryOperationVars))! as _i3.GQueryOperationVars); break; case 'operation': @@ -65,16 +65,14 @@ class _$GQueryOperation extends GQueryOperation { @override final _i1.Operation operation; - factory _$GQueryOperation([void Function(GQueryOperationBuilder) updates]) => + factory _$GQueryOperation([void Function(GQueryOperationBuilder)? updates]) => (new GQueryOperationBuilder()..update(updates)).build(); - _$GQueryOperation._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GQueryOperation', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GQueryOperation', 'operation'); - } + _$GQueryOperation._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GQueryOperation', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GQueryOperation', 'operation'); } @override @@ -109,25 +107,26 @@ class _$GQueryOperation extends GQueryOperation { class GQueryOperationBuilder implements Builder { - _$GQueryOperation _$v; + _$GQueryOperation? _$v; - _i3.GQueryOperationVarsBuilder _vars; + _i3.GQueryOperationVarsBuilder? _vars; _i3.GQueryOperationVarsBuilder get vars => _$this._vars ??= new _i3.GQueryOperationVarsBuilder(); - set vars(_i3.GQueryOperationVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GQueryOperationVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GQueryOperationBuilder() { GQueryOperation._initializeBuilder(this); } GQueryOperationBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -135,14 +134,12 @@ class GQueryOperationBuilder @override void replace(GQueryOperation other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GQueryOperation; } @override - void update(void Function(GQueryOperationBuilder) updates) { + void update(void Function(GQueryOperationBuilder)? updates) { if (updates != null) updates(this); } @@ -151,9 +148,12 @@ class GQueryOperationBuilder _$GQueryOperation _$result; try { _$result = _$v ?? - new _$GQueryOperation._(vars: vars.build(), operation: operation); + new _$GQueryOperation._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GQueryOperation', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_build/lib/kitchen_sink/query.var.gql.dart b/examples/gql_example_build/lib/kitchen_sink/query.var.gql.dart index 990e6d101..dfd747ec9 100644 --- a/examples/gql_example_build/lib/kitchen_sink/query.var.gql.dart +++ b/examples/gql_example_build/lib/kitchen_sink/query.var.gql.dart @@ -14,25 +14,17 @@ abstract class GQueryOperationVars factory GQueryOperationVars( [Function(GQueryOperationVarsBuilder b) updates]) = _$GQueryOperationVars; - @nullable - String get id; - @nullable + String? get id; @BuiltValueField(wireName: 'bool') - bool get Gbool; - @nullable + bool? get Gbool; @BuiltValueField(wireName: 'int') - int get Gint; - @nullable - double get float; - @nullable - String get string; - @nullable - _i1.GScalar get scalar; - @nullable + int? get Gint; + double? get float; + String? get string; + _i1.GScalar? get scalar; @BuiltValueField(wireName: 'enum') - _i1.GEnum get Genum; - @nullable - _i1.GInput get input; + _i1.GEnum? get Genum; + _i1.GInput? get input; String get idRequired; bool get boolRequired; int get intRequired; @@ -44,7 +36,8 @@ abstract class GQueryOperationVars static Serializer get serializer => _$gQueryOperationVarsSerializer; Map toJson() => - _i2.serializers.serializeWith(GQueryOperationVars.serializer, this); - static GQueryOperationVars fromJson(Map json) => + (_i2.serializers.serializeWith(GQueryOperationVars.serializer, this) + as Map); + static GQueryOperationVars? fromJson(Map json) => _i2.serializers.deserializeWith(GQueryOperationVars.serializer, json); } diff --git a/examples/gql_example_build/lib/kitchen_sink/query.var.gql.g.dart b/examples/gql_example_build/lib/kitchen_sink/query.var.gql.g.dart index b9581efa7..cfd292d82 100644 --- a/examples/gql_example_build/lib/kitchen_sink/query.var.gql.g.dart +++ b/examples/gql_example_build/lib/kitchen_sink/query.var.gql.g.dart @@ -20,10 +20,10 @@ class _$GQueryOperationVarsSerializer final String wireName = 'GQueryOperationVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GQueryOperationVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'idRequired', serializers.serialize(object.idRequired, specifiedType: const FullType(String)), @@ -49,52 +49,60 @@ class _$GQueryOperationVarsSerializer serializers.serialize(object.inputRequired, specifiedType: const FullType(_i1.GInput)), ]; - if (object.id != null) { + Object? value; + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.Gbool != null) { + value = object.Gbool; + if (value != null) { result ..add('bool') - ..add(serializers.serialize(object.Gbool, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.Gint != null) { + value = object.Gint; + if (value != null) { result ..add('int') - ..add(serializers.serialize(object.Gint, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.float != null) { + value = object.float; + if (value != null) { result ..add('float') - ..add(serializers.serialize(object.float, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } - if (object.string != null) { + value = object.string; + if (value != null) { result ..add('string') - ..add(serializers.serialize(object.string, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.scalar != null) { + value = object.scalar; + if (value != null) { result ..add('scalar') - ..add(serializers.serialize(object.scalar, + ..add(serializers.serialize(value, specifiedType: const FullType(_i1.GScalar))); } - if (object.Genum != null) { + value = object.Genum; + if (value != null) { result ..add('enum') - ..add(serializers.serialize(object.Genum, + ..add(serializers.serialize(value, specifiedType: const FullType(_i1.GEnum))); } - if (object.input != null) { + value = object.input; + if (value != null) { result ..add('input') - ..add(serializers.serialize(object.input, + ..add(serializers.serialize(value, specifiedType: const FullType(_i1.GInput))); } return result; @@ -102,7 +110,7 @@ class _$GQueryOperationVarsSerializer @override GQueryOperationVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GQueryOperationVarsBuilder(); @@ -110,7 +118,7 @@ class _$GQueryOperationVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -134,7 +142,7 @@ class _$GQueryOperationVarsSerializer break; case 'scalar': result.scalar.replace(serializers.deserialize(value, - specifiedType: const FullType(_i1.GScalar)) as _i1.GScalar); + specifiedType: const FullType(_i1.GScalar))! as _i1.GScalar); break; case 'enum': result.Genum = serializers.deserialize(value, @@ -142,7 +150,7 @@ class _$GQueryOperationVarsSerializer break; case 'input': result.input.replace(serializers.deserialize(value, - specifiedType: const FullType(_i1.GInput)) as _i1.GInput); + specifiedType: const FullType(_i1.GInput))! as _i1.GInput); break; case 'idRequired': result.idRequired = serializers.deserialize(value, @@ -166,7 +174,7 @@ class _$GQueryOperationVarsSerializer break; case 'scalarRequired': result.scalarRequired.replace(serializers.deserialize(value, - specifiedType: const FullType(_i1.GScalar)) as _i1.GScalar); + specifiedType: const FullType(_i1.GScalar))! as _i1.GScalar); break; case 'enumRequired': result.enumRequired = serializers.deserialize(value, @@ -174,7 +182,7 @@ class _$GQueryOperationVarsSerializer break; case 'inputRequired': result.inputRequired.replace(serializers.deserialize(value, - specifiedType: const FullType(_i1.GInput)) as _i1.GInput); + specifiedType: const FullType(_i1.GInput))! as _i1.GInput); break; } } @@ -185,21 +193,21 @@ class _$GQueryOperationVarsSerializer class _$GQueryOperationVars extends GQueryOperationVars { @override - final String id; + final String? id; @override - final bool Gbool; + final bool? Gbool; @override - final int Gint; + final int? Gint; @override - final double float; + final double? float; @override - final String string; + final String? string; @override - final _i1.GScalar scalar; + final _i1.GScalar? scalar; @override - final _i1.GEnum Genum; + final _i1.GEnum? Genum; @override - final _i1.GInput input; + final _i1.GInput? input; @override final String idRequired; @override @@ -218,7 +226,7 @@ class _$GQueryOperationVars extends GQueryOperationVars { final _i1.GInput inputRequired; factory _$GQueryOperationVars( - [void Function(GQueryOperationVarsBuilder) updates]) => + [void Function(GQueryOperationVarsBuilder)? updates]) => (new GQueryOperationVarsBuilder()..update(updates)).build(); _$GQueryOperationVars._( @@ -230,43 +238,31 @@ class _$GQueryOperationVars extends GQueryOperationVars { this.scalar, this.Genum, this.input, - this.idRequired, - this.boolRequired, - this.intRequired, - this.floatRequired, - this.stringRequired, - this.scalarRequired, - this.enumRequired, - this.inputRequired}) + required this.idRequired, + required this.boolRequired, + required this.intRequired, + required this.floatRequired, + required this.stringRequired, + required this.scalarRequired, + required this.enumRequired, + required this.inputRequired}) : super._() { - if (idRequired == null) { - throw new BuiltValueNullFieldError('GQueryOperationVars', 'idRequired'); - } - if (boolRequired == null) { - throw new BuiltValueNullFieldError('GQueryOperationVars', 'boolRequired'); - } - if (intRequired == null) { - throw new BuiltValueNullFieldError('GQueryOperationVars', 'intRequired'); - } - if (floatRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationVars', 'floatRequired'); - } - if (stringRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationVars', 'stringRequired'); - } - if (scalarRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationVars', 'scalarRequired'); - } - if (enumRequired == null) { - throw new BuiltValueNullFieldError('GQueryOperationVars', 'enumRequired'); - } - if (inputRequired == null) { - throw new BuiltValueNullFieldError( - 'GQueryOperationVars', 'inputRequired'); - } + BuiltValueNullFieldError.checkNotNull( + idRequired, 'GQueryOperationVars', 'idRequired'); + BuiltValueNullFieldError.checkNotNull( + boolRequired, 'GQueryOperationVars', 'boolRequired'); + BuiltValueNullFieldError.checkNotNull( + intRequired, 'GQueryOperationVars', 'intRequired'); + BuiltValueNullFieldError.checkNotNull( + floatRequired, 'GQueryOperationVars', 'floatRequired'); + BuiltValueNullFieldError.checkNotNull( + stringRequired, 'GQueryOperationVars', 'stringRequired'); + BuiltValueNullFieldError.checkNotNull( + scalarRequired, 'GQueryOperationVars', 'scalarRequired'); + BuiltValueNullFieldError.checkNotNull( + enumRequired, 'GQueryOperationVars', 'enumRequired'); + BuiltValueNullFieldError.checkNotNull( + inputRequired, 'GQueryOperationVars', 'inputRequired'); } @override @@ -361,99 +357,100 @@ class _$GQueryOperationVars extends GQueryOperationVars { class GQueryOperationVarsBuilder implements Builder { - _$GQueryOperationVars _$v; + _$GQueryOperationVars? _$v; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - bool _Gbool; - bool get Gbool => _$this._Gbool; - set Gbool(bool Gbool) => _$this._Gbool = Gbool; + bool? _Gbool; + bool? get Gbool => _$this._Gbool; + set Gbool(bool? Gbool) => _$this._Gbool = Gbool; - int _Gint; - int get Gint => _$this._Gint; - set Gint(int Gint) => _$this._Gint = Gint; + int? _Gint; + int? get Gint => _$this._Gint; + set Gint(int? Gint) => _$this._Gint = Gint; - double _float; - double get float => _$this._float; - set float(double float) => _$this._float = float; + double? _float; + double? get float => _$this._float; + set float(double? float) => _$this._float = float; - String _string; - String get string => _$this._string; - set string(String string) => _$this._string = string; + String? _string; + String? get string => _$this._string; + set string(String? string) => _$this._string = string; - _i1.GScalarBuilder _scalar; + _i1.GScalarBuilder? _scalar; _i1.GScalarBuilder get scalar => _$this._scalar ??= new _i1.GScalarBuilder(); - set scalar(_i1.GScalarBuilder scalar) => _$this._scalar = scalar; + set scalar(_i1.GScalarBuilder? scalar) => _$this._scalar = scalar; - _i1.GEnum _Genum; - _i1.GEnum get Genum => _$this._Genum; - set Genum(_i1.GEnum Genum) => _$this._Genum = Genum; + _i1.GEnum? _Genum; + _i1.GEnum? get Genum => _$this._Genum; + set Genum(_i1.GEnum? Genum) => _$this._Genum = Genum; - _i1.GInputBuilder _input; + _i1.GInputBuilder? _input; _i1.GInputBuilder get input => _$this._input ??= new _i1.GInputBuilder(); - set input(_i1.GInputBuilder input) => _$this._input = input; + set input(_i1.GInputBuilder? input) => _$this._input = input; - String _idRequired; - String get idRequired => _$this._idRequired; - set idRequired(String idRequired) => _$this._idRequired = idRequired; + String? _idRequired; + String? get idRequired => _$this._idRequired; + set idRequired(String? idRequired) => _$this._idRequired = idRequired; - bool _boolRequired; - bool get boolRequired => _$this._boolRequired; - set boolRequired(bool boolRequired) => _$this._boolRequired = boolRequired; + bool? _boolRequired; + bool? get boolRequired => _$this._boolRequired; + set boolRequired(bool? boolRequired) => _$this._boolRequired = boolRequired; - int _intRequired; - int get intRequired => _$this._intRequired; - set intRequired(int intRequired) => _$this._intRequired = intRequired; + int? _intRequired; + int? get intRequired => _$this._intRequired; + set intRequired(int? intRequired) => _$this._intRequired = intRequired; - double _floatRequired; - double get floatRequired => _$this._floatRequired; - set floatRequired(double floatRequired) => + double? _floatRequired; + double? get floatRequired => _$this._floatRequired; + set floatRequired(double? floatRequired) => _$this._floatRequired = floatRequired; - String _stringRequired; - String get stringRequired => _$this._stringRequired; - set stringRequired(String stringRequired) => + String? _stringRequired; + String? get stringRequired => _$this._stringRequired; + set stringRequired(String? stringRequired) => _$this._stringRequired = stringRequired; - _i1.GScalarBuilder _scalarRequired; + _i1.GScalarBuilder? _scalarRequired; _i1.GScalarBuilder get scalarRequired => _$this._scalarRequired ??= new _i1.GScalarBuilder(); - set scalarRequired(_i1.GScalarBuilder scalarRequired) => + set scalarRequired(_i1.GScalarBuilder? scalarRequired) => _$this._scalarRequired = scalarRequired; - _i1.GEnum _enumRequired; - _i1.GEnum get enumRequired => _$this._enumRequired; - set enumRequired(_i1.GEnum enumRequired) => + _i1.GEnum? _enumRequired; + _i1.GEnum? get enumRequired => _$this._enumRequired; + set enumRequired(_i1.GEnum? enumRequired) => _$this._enumRequired = enumRequired; - _i1.GInputBuilder _inputRequired; + _i1.GInputBuilder? _inputRequired; _i1.GInputBuilder get inputRequired => _$this._inputRequired ??= new _i1.GInputBuilder(); - set inputRequired(_i1.GInputBuilder inputRequired) => + set inputRequired(_i1.GInputBuilder? inputRequired) => _$this._inputRequired = inputRequired; GQueryOperationVarsBuilder(); GQueryOperationVarsBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _Gbool = _$v.Gbool; - _Gint = _$v.Gint; - _float = _$v.float; - _string = _$v.string; - _scalar = _$v.scalar?.toBuilder(); - _Genum = _$v.Genum; - _input = _$v.input?.toBuilder(); - _idRequired = _$v.idRequired; - _boolRequired = _$v.boolRequired; - _intRequired = _$v.intRequired; - _floatRequired = _$v.floatRequired; - _stringRequired = _$v.stringRequired; - _scalarRequired = _$v.scalarRequired?.toBuilder(); - _enumRequired = _$v.enumRequired; - _inputRequired = _$v.inputRequired?.toBuilder(); + final $v = _$v; + if ($v != null) { + _id = $v.id; + _Gbool = $v.Gbool; + _Gint = $v.Gint; + _float = $v.float; + _string = $v.string; + _scalar = $v.scalar?.toBuilder(); + _Genum = $v.Genum; + _input = $v.input?.toBuilder(); + _idRequired = $v.idRequired; + _boolRequired = $v.boolRequired; + _intRequired = $v.intRequired; + _floatRequired = $v.floatRequired; + _stringRequired = $v.stringRequired; + _scalarRequired = $v.scalarRequired.toBuilder(); + _enumRequired = $v.enumRequired; + _inputRequired = $v.inputRequired.toBuilder(); _$v = null; } return this; @@ -461,14 +458,12 @@ class GQueryOperationVarsBuilder @override void replace(GQueryOperationVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GQueryOperationVars; } @override - void update(void Function(GQueryOperationVarsBuilder) updates) { + void update(void Function(GQueryOperationVarsBuilder)? updates) { if (updates != null) updates(this); } @@ -486,16 +481,22 @@ class GQueryOperationVarsBuilder scalar: _scalar?.build(), Genum: Genum, input: _input?.build(), - idRequired: idRequired, - boolRequired: boolRequired, - intRequired: intRequired, - floatRequired: floatRequired, - stringRequired: stringRequired, + idRequired: BuiltValueNullFieldError.checkNotNull( + idRequired, 'GQueryOperationVars', 'idRequired'), + boolRequired: BuiltValueNullFieldError.checkNotNull( + boolRequired, 'GQueryOperationVars', 'boolRequired'), + intRequired: BuiltValueNullFieldError.checkNotNull( + intRequired, 'GQueryOperationVars', 'intRequired'), + floatRequired: BuiltValueNullFieldError.checkNotNull( + floatRequired, 'GQueryOperationVars', 'floatRequired'), + stringRequired: BuiltValueNullFieldError.checkNotNull( + stringRequired, 'GQueryOperationVars', 'stringRequired'), scalarRequired: scalarRequired.build(), - enumRequired: enumRequired, + enumRequired: BuiltValueNullFieldError.checkNotNull( + enumRequired, 'GQueryOperationVars', 'enumRequired'), inputRequired: inputRequired.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'scalar'; _scalar?.build(); diff --git a/examples/gql_example_build/lib/schema.schema.gql.dart b/examples/gql_example_build/lib/schema.schema.gql.dart index a4d8ab38b..f53bf4375 100644 --- a/examples/gql_example_build/lib/schema.schema.gql.dart +++ b/examples/gql_example_build/lib/schema.schema.gql.dart @@ -12,14 +12,14 @@ part 'schema.schema.gql.g.dart'; abstract class GScalar implements Built { GScalar._(); - factory GScalar([String value]) => + factory GScalar([String? value]) => _$GScalar((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i1.DefaultScalarSerializer( - (Object serialized) => GScalar(serialized)); + (Object serialized) => GScalar((serialized as String?))); } class GEnum extends EnumClass { @@ -39,25 +39,17 @@ abstract class GInput implements Built { factory GInput([Function(GInputBuilder b) updates]) = _$GInput; - @nullable - String get id; - @nullable + String? get id; @BuiltValueField(wireName: 'bool') - bool get Gbool; - @nullable + bool? get Gbool; @BuiltValueField(wireName: 'int') - int get Gint; - @nullable - double get float; - @nullable - String get string; - @nullable - GScalar get scalar; - @nullable + int? get Gint; + double? get float; + String? get string; + GScalar? get scalar; @BuiltValueField(wireName: 'enum') - GEnum get Genum; - @nullable - GInput get input; + GEnum? get Genum; + GInput? get input; String get idRequired; bool get boolRequired; int get intRequired; @@ -68,7 +60,8 @@ abstract class GInput implements Built { GInput get inputRequired; static Serializer get serializer => _$gInputSerializer; Map toJson() => - _i2.serializers.serializeWith(GInput.serializer, this); - static GInput fromJson(Map json) => + (_i2.serializers.serializeWith(GInput.serializer, this) + as Map); + static GInput? fromJson(Map json) => _i2.serializers.deserializeWith(GInput.serializer, json); } diff --git a/examples/gql_example_build/lib/schema.schema.gql.g.dart b/examples/gql_example_build/lib/schema.schema.gql.g.dart index 80434634c..11e6c43ce 100644 --- a/examples/gql_example_build/lib/schema.schema.gql.g.dart +++ b/examples/gql_example_build/lib/schema.schema.gql.g.dart @@ -52,9 +52,9 @@ class _$GInputSerializer implements StructuredSerializer { final String wireName = 'GInput'; @override - Iterable serialize(Serializers serializers, GInput object, + Iterable serialize(Serializers serializers, GInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'idRequired', serializers.serialize(object.idRequired, specifiedType: const FullType(String)), @@ -80,59 +80,67 @@ class _$GInputSerializer implements StructuredSerializer { serializers.serialize(object.inputRequired, specifiedType: const FullType(GInput)), ]; - if (object.id != null) { + Object? value; + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.Gbool != null) { + value = object.Gbool; + if (value != null) { result ..add('bool') - ..add(serializers.serialize(object.Gbool, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.Gint != null) { + value = object.Gint; + if (value != null) { result ..add('int') - ..add(serializers.serialize(object.Gint, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.float != null) { + value = object.float; + if (value != null) { result ..add('float') - ..add(serializers.serialize(object.float, + ..add(serializers.serialize(value, specifiedType: const FullType(double))); } - if (object.string != null) { + value = object.string; + if (value != null) { result ..add('string') - ..add(serializers.serialize(object.string, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.scalar != null) { + value = object.scalar; + if (value != null) { result ..add('scalar') - ..add(serializers.serialize(object.scalar, + ..add(serializers.serialize(value, specifiedType: const FullType(GScalar))); } - if (object.Genum != null) { + value = object.Genum; + if (value != null) { result ..add('enum') - ..add(serializers.serialize(object.Genum, - specifiedType: const FullType(GEnum))); + ..add( + serializers.serialize(value, specifiedType: const FullType(GEnum))); } - if (object.input != null) { + value = object.input; + if (value != null) { result ..add('input') - ..add(serializers.serialize(object.input, + ..add(serializers.serialize(value, specifiedType: const FullType(GInput))); } return result; } @override - GInput deserialize(Serializers serializers, Iterable serialized, + GInput deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GInputBuilder(); @@ -140,7 +148,7 @@ class _$GInputSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -164,7 +172,7 @@ class _$GInputSerializer implements StructuredSerializer { break; case 'scalar': result.scalar.replace(serializers.deserialize(value, - specifiedType: const FullType(GScalar)) as GScalar); + specifiedType: const FullType(GScalar))! as GScalar); break; case 'enum': result.Genum = serializers.deserialize(value, @@ -172,7 +180,7 @@ class _$GInputSerializer implements StructuredSerializer { break; case 'input': result.input.replace(serializers.deserialize(value, - specifiedType: const FullType(GInput)) as GInput); + specifiedType: const FullType(GInput))! as GInput); break; case 'idRequired': result.idRequired = serializers.deserialize(value, @@ -196,7 +204,7 @@ class _$GInputSerializer implements StructuredSerializer { break; case 'scalarRequired': result.scalarRequired.replace(serializers.deserialize(value, - specifiedType: const FullType(GScalar)) as GScalar); + specifiedType: const FullType(GScalar))! as GScalar); break; case 'enumRequired': result.enumRequired = serializers.deserialize(value, @@ -204,7 +212,7 @@ class _$GInputSerializer implements StructuredSerializer { break; case 'inputRequired': result.inputRequired.replace(serializers.deserialize(value, - specifiedType: const FullType(GInput)) as GInput); + specifiedType: const FullType(GInput))! as GInput); break; } } @@ -217,13 +225,11 @@ class _$GScalar extends GScalar { @override final String value; - factory _$GScalar([void Function(GScalarBuilder) updates]) => + factory _$GScalar([void Function(GScalarBuilder)? updates]) => (new GScalarBuilder()..update(updates)).build(); - _$GScalar._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GScalar', 'value'); - } + _$GScalar._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GScalar', 'value'); } @override @@ -252,17 +258,18 @@ class _$GScalar extends GScalar { } class GScalarBuilder implements Builder { - _$GScalar _$v; + _$GScalar? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GScalarBuilder(); GScalarBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -270,20 +277,21 @@ class GScalarBuilder implements Builder { @override void replace(GScalar other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GScalar; } @override - void update(void Function(GScalarBuilder) updates) { + void update(void Function(GScalarBuilder)? updates) { if (updates != null) updates(this); } @override _$GScalar build() { - final _$result = _$v ?? new _$GScalar._(value: value); + final _$result = _$v ?? + new _$GScalar._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GScalar', 'value')); replace(_$result); return _$result; } @@ -291,21 +299,21 @@ class GScalarBuilder implements Builder { class _$GInput extends GInput { @override - final String id; + final String? id; @override - final bool Gbool; + final bool? Gbool; @override - final int Gint; + final int? Gint; @override - final double float; + final double? float; @override - final String string; + final String? string; @override - final GScalar scalar; + final GScalar? scalar; @override - final GEnum Genum; + final GEnum? Genum; @override - final GInput input; + final GInput? input; @override final String idRequired; @override @@ -323,7 +331,7 @@ class _$GInput extends GInput { @override final GInput inputRequired; - factory _$GInput([void Function(GInputBuilder) updates]) => + factory _$GInput([void Function(GInputBuilder)? updates]) => (new GInputBuilder()..update(updates)).build(); _$GInput._( @@ -335,39 +343,29 @@ class _$GInput extends GInput { this.scalar, this.Genum, this.input, - this.idRequired, - this.boolRequired, - this.intRequired, - this.floatRequired, - this.stringRequired, - this.scalarRequired, - this.enumRequired, - this.inputRequired}) + required this.idRequired, + required this.boolRequired, + required this.intRequired, + required this.floatRequired, + required this.stringRequired, + required this.scalarRequired, + required this.enumRequired, + required this.inputRequired}) : super._() { - if (idRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'idRequired'); - } - if (boolRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'boolRequired'); - } - if (intRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'intRequired'); - } - if (floatRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'floatRequired'); - } - if (stringRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'stringRequired'); - } - if (scalarRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'scalarRequired'); - } - if (enumRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'enumRequired'); - } - if (inputRequired == null) { - throw new BuiltValueNullFieldError('GInput', 'inputRequired'); - } + BuiltValueNullFieldError.checkNotNull(idRequired, 'GInput', 'idRequired'); + BuiltValueNullFieldError.checkNotNull( + boolRequired, 'GInput', 'boolRequired'); + BuiltValueNullFieldError.checkNotNull(intRequired, 'GInput', 'intRequired'); + BuiltValueNullFieldError.checkNotNull( + floatRequired, 'GInput', 'floatRequired'); + BuiltValueNullFieldError.checkNotNull( + stringRequired, 'GInput', 'stringRequired'); + BuiltValueNullFieldError.checkNotNull( + scalarRequired, 'GInput', 'scalarRequired'); + BuiltValueNullFieldError.checkNotNull( + enumRequired, 'GInput', 'enumRequired'); + BuiltValueNullFieldError.checkNotNull( + inputRequired, 'GInput', 'inputRequired'); } @override @@ -459,98 +457,99 @@ class _$GInput extends GInput { } class GInputBuilder implements Builder { - _$GInput _$v; + _$GInput? _$v; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - bool _Gbool; - bool get Gbool => _$this._Gbool; - set Gbool(bool Gbool) => _$this._Gbool = Gbool; + bool? _Gbool; + bool? get Gbool => _$this._Gbool; + set Gbool(bool? Gbool) => _$this._Gbool = Gbool; - int _Gint; - int get Gint => _$this._Gint; - set Gint(int Gint) => _$this._Gint = Gint; + int? _Gint; + int? get Gint => _$this._Gint; + set Gint(int? Gint) => _$this._Gint = Gint; - double _float; - double get float => _$this._float; - set float(double float) => _$this._float = float; + double? _float; + double? get float => _$this._float; + set float(double? float) => _$this._float = float; - String _string; - String get string => _$this._string; - set string(String string) => _$this._string = string; + String? _string; + String? get string => _$this._string; + set string(String? string) => _$this._string = string; - GScalarBuilder _scalar; + GScalarBuilder? _scalar; GScalarBuilder get scalar => _$this._scalar ??= new GScalarBuilder(); - set scalar(GScalarBuilder scalar) => _$this._scalar = scalar; + set scalar(GScalarBuilder? scalar) => _$this._scalar = scalar; - GEnum _Genum; - GEnum get Genum => _$this._Genum; - set Genum(GEnum Genum) => _$this._Genum = Genum; + GEnum? _Genum; + GEnum? get Genum => _$this._Genum; + set Genum(GEnum? Genum) => _$this._Genum = Genum; - GInputBuilder _input; + GInputBuilder? _input; GInputBuilder get input => _$this._input ??= new GInputBuilder(); - set input(GInputBuilder input) => _$this._input = input; + set input(GInputBuilder? input) => _$this._input = input; - String _idRequired; - String get idRequired => _$this._idRequired; - set idRequired(String idRequired) => _$this._idRequired = idRequired; + String? _idRequired; + String? get idRequired => _$this._idRequired; + set idRequired(String? idRequired) => _$this._idRequired = idRequired; - bool _boolRequired; - bool get boolRequired => _$this._boolRequired; - set boolRequired(bool boolRequired) => _$this._boolRequired = boolRequired; + bool? _boolRequired; + bool? get boolRequired => _$this._boolRequired; + set boolRequired(bool? boolRequired) => _$this._boolRequired = boolRequired; - int _intRequired; - int get intRequired => _$this._intRequired; - set intRequired(int intRequired) => _$this._intRequired = intRequired; + int? _intRequired; + int? get intRequired => _$this._intRequired; + set intRequired(int? intRequired) => _$this._intRequired = intRequired; - double _floatRequired; - double get floatRequired => _$this._floatRequired; - set floatRequired(double floatRequired) => + double? _floatRequired; + double? get floatRequired => _$this._floatRequired; + set floatRequired(double? floatRequired) => _$this._floatRequired = floatRequired; - String _stringRequired; - String get stringRequired => _$this._stringRequired; - set stringRequired(String stringRequired) => + String? _stringRequired; + String? get stringRequired => _$this._stringRequired; + set stringRequired(String? stringRequired) => _$this._stringRequired = stringRequired; - GScalarBuilder _scalarRequired; + GScalarBuilder? _scalarRequired; GScalarBuilder get scalarRequired => _$this._scalarRequired ??= new GScalarBuilder(); - set scalarRequired(GScalarBuilder scalarRequired) => + set scalarRequired(GScalarBuilder? scalarRequired) => _$this._scalarRequired = scalarRequired; - GEnum _enumRequired; - GEnum get enumRequired => _$this._enumRequired; - set enumRequired(GEnum enumRequired) => _$this._enumRequired = enumRequired; + GEnum? _enumRequired; + GEnum? get enumRequired => _$this._enumRequired; + set enumRequired(GEnum? enumRequired) => _$this._enumRequired = enumRequired; - GInputBuilder _inputRequired; + GInputBuilder? _inputRequired; GInputBuilder get inputRequired => _$this._inputRequired ??= new GInputBuilder(); - set inputRequired(GInputBuilder inputRequired) => + set inputRequired(GInputBuilder? inputRequired) => _$this._inputRequired = inputRequired; GInputBuilder(); GInputBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _Gbool = _$v.Gbool; - _Gint = _$v.Gint; - _float = _$v.float; - _string = _$v.string; - _scalar = _$v.scalar?.toBuilder(); - _Genum = _$v.Genum; - _input = _$v.input?.toBuilder(); - _idRequired = _$v.idRequired; - _boolRequired = _$v.boolRequired; - _intRequired = _$v.intRequired; - _floatRequired = _$v.floatRequired; - _stringRequired = _$v.stringRequired; - _scalarRequired = _$v.scalarRequired?.toBuilder(); - _enumRequired = _$v.enumRequired; - _inputRequired = _$v.inputRequired?.toBuilder(); + final $v = _$v; + if ($v != null) { + _id = $v.id; + _Gbool = $v.Gbool; + _Gint = $v.Gint; + _float = $v.float; + _string = $v.string; + _scalar = $v.scalar?.toBuilder(); + _Genum = $v.Genum; + _input = $v.input?.toBuilder(); + _idRequired = $v.idRequired; + _boolRequired = $v.boolRequired; + _intRequired = $v.intRequired; + _floatRequired = $v.floatRequired; + _stringRequired = $v.stringRequired; + _scalarRequired = $v.scalarRequired.toBuilder(); + _enumRequired = $v.enumRequired; + _inputRequired = $v.inputRequired.toBuilder(); _$v = null; } return this; @@ -558,14 +557,12 @@ class GInputBuilder implements Builder { @override void replace(GInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GInput; } @override - void update(void Function(GInputBuilder) updates) { + void update(void Function(GInputBuilder)? updates) { if (updates != null) updates(this); } @@ -583,16 +580,22 @@ class GInputBuilder implements Builder { scalar: _scalar?.build(), Genum: Genum, input: _input?.build(), - idRequired: idRequired, - boolRequired: boolRequired, - intRequired: intRequired, - floatRequired: floatRequired, - stringRequired: stringRequired, + idRequired: BuiltValueNullFieldError.checkNotNull( + idRequired, 'GInput', 'idRequired'), + boolRequired: BuiltValueNullFieldError.checkNotNull( + boolRequired, 'GInput', 'boolRequired'), + intRequired: BuiltValueNullFieldError.checkNotNull( + intRequired, 'GInput', 'intRequired'), + floatRequired: BuiltValueNullFieldError.checkNotNull( + floatRequired, 'GInput', 'floatRequired'), + stringRequired: BuiltValueNullFieldError.checkNotNull( + stringRequired, 'GInput', 'stringRequired'), scalarRequired: scalarRequired.build(), - enumRequired: enumRequired, + enumRequired: BuiltValueNullFieldError.checkNotNull( + enumRequired, 'GInput', 'enumRequired'), inputRequired: inputRequired.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'scalar'; _scalar?.build(); diff --git a/examples/gql_example_build/pubspec.yaml b/examples/gql_example_build/pubspec.yaml index 8b114f591..b36e82226 100644 --- a/examples/gql_example_build/pubspec.yaml +++ b/examples/gql_example_build/pubspec.yaml @@ -1,8 +1,8 @@ name: gql_example_build environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dev_dependencies: - build_runner: ^1.10.1 + build_runner: ^2.0.0 + gql_build: ^0.2.0-nullsafety.0 gql_pedantic: ^1.0.2 - gql_build: ^0.1.3 test: ^1.0.0 diff --git a/examples/gql_example_build/test/fragments/shape_test.dart b/examples/gql_example_build/test/fragments/shape_test.dart index 691993b21..35185d902 100644 --- a/examples/gql_example_build/test/fragments/shape_test.dart +++ b/examples/gql_example_build/test/fragments/shape_test.dart @@ -1,10 +1,10 @@ import "package:gql_example_build/fragments/shape.data.gql.dart"; import "package:test/test.dart"; -String getShapeInfo(GShapeData data) { +String? getShapeInfo(GShapeData data) { final shape = data.shape; - final type = shape.G__typename; - final area = shape.area; + final type = shape?.G__typename; + final area = shape?.area; if (shape is GShapeData_shape__asSquare) { return "$type(area: $area, sideLength: ${shape.sideLength})"; @@ -27,7 +27,7 @@ void main() { }; expect( - getShapeInfo(GShapeData.fromJson(shapeData)), + getShapeInfo(GShapeData.fromJson(shapeData)!), "Square(area: 4.0, sideLength: 2.0)", ); }); @@ -43,7 +43,7 @@ void main() { }; expect( - getShapeInfo(GShapeData.fromJson(shapeData)), + getShapeInfo(GShapeData.fromJson(shapeData)!), "Rectangle(area: 3.0, sideLengthA: 3.0, sideLengthB: 1.0)", ); }); diff --git a/examples/gql_example_cli/bin/main.dart b/examples/gql_example_cli/bin/main.dart index 4bdbe9885..77028ef73 100644 --- a/examples/gql_example_cli/bin/main.dart +++ b/examples/gql_example_cli/bin/main.dart @@ -14,10 +14,10 @@ Future main(List arguments) async { final argResults = parser.parse(arguments); final link = HttpLink( - "https://graphql-pokemon.now.sh/graphql", + "https://graphql-pokemon2.vercel.app", ); - final find = argResults["find"] as String; + final find = argResults["find"] as String?; if (find != null) { print("Looking for ${find}..."); @@ -34,9 +34,15 @@ Future main(List arguments) async { ) .first; - final data = GFindPokemonData.fromJson(result.data); + if (result.data == null) { + print("Nothing was received from the server!"); - final pokemon = data.pokemon; + return; + } + + final data = GFindPokemonData.fromJson(result.data!); + + final GFindPokemonData_pokemon? pokemon = data!.pokemon; if (pokemon == null) { print("${find} was not found. Does it even exist?"); @@ -50,10 +56,10 @@ Future main(List arguments) async { print("Found ${pokemon.name}"); print("ID: ${pokemon.id}"); print( - "Weight: ${weight.minimum} – ${weight.maximum}", + "Weight: ${weight!.minimum} – ${weight.maximum}", ); print( - "Height: ${height.minimum} – ${height.maximum}", + "Height: ${height!.minimum} – ${height.maximum}", ); return; @@ -75,13 +81,19 @@ Future main(List arguments) async { ) .first; - final data = GListPokemonData.fromJson(result.data); + if (result.data == null) { + print("Nothing was received from the server!"); + + return; + } + + final data = GListPokemonData.fromJson(result.data!); - final pokemons = data.pokemons; + final pokemons = data!.pokemons; - print("Found ${pokemons.length} pokemon"); + print("Found ${pokemons?.length ?? 0} pokemon"); - pokemons.forEach( + pokemons?.forEach( (pokemon) { print("${pokemon.id} | ${pokemon.name}"); }, diff --git a/examples/gql_example_cli/lib/dimensions.data.gql.dart b/examples/gql_example_cli/lib/dimensions.data.gql.dart index 39a59b682..ad5758dbc 100644 --- a/examples/gql_example_cli/lib/dimensions.data.gql.dart +++ b/examples/gql_example_cli/lib/dimensions.data.gql.dart @@ -8,8 +8,8 @@ part 'dimensions.data.gql.g.dart'; abstract class GDimensions { String get G__typename; - String get minimum; - String get maximum; + String? get minimum; + String? get maximum; Map toJson(); } @@ -24,14 +24,13 @@ abstract class GDimensionsData b..G__typename = 'PokemonDimension'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get minimum; - @nullable - String get maximum; + String? get minimum; + String? get maximum; static Serializer get serializer => _$gDimensionsDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GDimensionsData.serializer, this); - static GDimensionsData fromJson(Map json) => + (_i1.serializers.serializeWith(GDimensionsData.serializer, this) + as Map); + static GDimensionsData? fromJson(Map json) => _i1.serializers.deserializeWith(GDimensionsData.serializer, json); } diff --git a/examples/gql_example_cli/lib/dimensions.data.gql.g.dart b/examples/gql_example_cli/lib/dimensions.data.gql.g.dart index 7bfe3c8f0..a39cc66b1 100644 --- a/examples/gql_example_cli/lib/dimensions.data.gql.g.dart +++ b/examples/gql_example_cli/lib/dimensions.data.gql.g.dart @@ -17,23 +17,26 @@ class _$GDimensionsDataSerializer final String wireName = 'GDimensionsData'; @override - Iterable serialize(Serializers serializers, GDimensionsData object, + Iterable serialize(Serializers serializers, GDimensionsData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.minimum != null) { + Object? value; + value = object.minimum; + if (value != null) { result ..add('minimum') - ..add(serializers.serialize(object.minimum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maximum != null) { + value = object.maximum; + if (value != null) { result ..add('maximum') - ..add(serializers.serialize(object.maximum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -41,7 +44,7 @@ class _$GDimensionsDataSerializer @override GDimensionsData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDimensionsDataBuilder(); @@ -49,7 +52,7 @@ class _$GDimensionsDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -74,18 +77,17 @@ class _$GDimensionsData extends GDimensionsData { @override final String G__typename; @override - final String minimum; + final String? minimum; @override - final String maximum; + final String? maximum; - factory _$GDimensionsData([void Function(GDimensionsDataBuilder) updates]) => + factory _$GDimensionsData([void Function(GDimensionsDataBuilder)? updates]) => (new GDimensionsDataBuilder()..update(updates)).build(); - _$GDimensionsData._({this.G__typename, this.minimum, this.maximum}) + _$GDimensionsData._({required this.G__typename, this.minimum, this.maximum}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GDimensionsData', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GDimensionsData', 'G__typename'); } @override @@ -123,29 +125,30 @@ class _$GDimensionsData extends GDimensionsData { class GDimensionsDataBuilder implements Builder { - _$GDimensionsData _$v; + _$GDimensionsData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _minimum; - String get minimum => _$this._minimum; - set minimum(String minimum) => _$this._minimum = minimum; + String? _minimum; + String? get minimum => _$this._minimum; + set minimum(String? minimum) => _$this._minimum = minimum; - String _maximum; - String get maximum => _$this._maximum; - set maximum(String maximum) => _$this._maximum = maximum; + String? _maximum; + String? get maximum => _$this._maximum; + set maximum(String? maximum) => _$this._maximum = maximum; GDimensionsDataBuilder() { GDimensionsData._initializeBuilder(this); } GDimensionsDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _minimum = _$v.minimum; - _maximum = _$v.maximum; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _minimum = $v.minimum; + _maximum = $v.maximum; _$v = null; } return this; @@ -153,14 +156,12 @@ class GDimensionsDataBuilder @override void replace(GDimensionsData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDimensionsData; } @override - void update(void Function(GDimensionsDataBuilder) updates) { + void update(void Function(GDimensionsDataBuilder)? updates) { if (updates != null) updates(this); } @@ -168,7 +169,10 @@ class GDimensionsDataBuilder _$GDimensionsData build() { final _$result = _$v ?? new _$GDimensionsData._( - G__typename: G__typename, minimum: minimum, maximum: maximum); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GDimensionsData', 'G__typename'), + minimum: minimum, + maximum: maximum); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli/lib/dimensions.var.gql.dart b/examples/gql_example_cli/lib/dimensions.var.gql.dart index 07acdec56..497485511 100644 --- a/examples/gql_example_cli/lib/dimensions.var.gql.dart +++ b/examples/gql_example_cli/lib/dimensions.var.gql.dart @@ -16,7 +16,8 @@ abstract class GDimensionsVars static Serializer get serializer => _$gDimensionsVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GDimensionsVars.serializer, this); - static GDimensionsVars fromJson(Map json) => + (_i1.serializers.serializeWith(GDimensionsVars.serializer, this) + as Map); + static GDimensionsVars? fromJson(Map json) => _i1.serializers.deserializeWith(GDimensionsVars.serializer, json); } diff --git a/examples/gql_example_cli/lib/dimensions.var.gql.g.dart b/examples/gql_example_cli/lib/dimensions.var.gql.g.dart index 84d20d4dc..292b4c2b4 100644 --- a/examples/gql_example_cli/lib/dimensions.var.gql.g.dart +++ b/examples/gql_example_cli/lib/dimensions.var.gql.g.dart @@ -17,21 +17,21 @@ class _$GDimensionsVarsSerializer final String wireName = 'GDimensionsVars'; @override - Iterable serialize(Serializers serializers, GDimensionsVars object, + Iterable serialize(Serializers serializers, GDimensionsVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override GDimensionsVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GDimensionsVarsBuilder().build(); } } class _$GDimensionsVars extends GDimensionsVars { - factory _$GDimensionsVars([void Function(GDimensionsVarsBuilder) updates]) => + factory _$GDimensionsVars([void Function(GDimensionsVarsBuilder)? updates]) => (new GDimensionsVarsBuilder()..update(updates)).build(); _$GDimensionsVars._() : super._(); @@ -63,20 +63,18 @@ class _$GDimensionsVars extends GDimensionsVars { class GDimensionsVarsBuilder implements Builder { - _$GDimensionsVars _$v; + _$GDimensionsVars? _$v; GDimensionsVarsBuilder(); @override void replace(GDimensionsVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDimensionsVars; } @override - void update(void Function(GDimensionsVarsBuilder) updates) { + void update(void Function(GDimensionsVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/examples/gql_example_cli/lib/find_pokemon.data.gql.dart b/examples/gql_example_cli/lib/find_pokemon.data.gql.dart index 6bd4df878..385f62918 100644 --- a/examples/gql_example_cli/lib/find_pokemon.data.gql.dart +++ b/examples/gql_example_cli/lib/find_pokemon.data.gql.dart @@ -18,13 +18,13 @@ abstract class GFindPokemonData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GFindPokemonData_pokemon get pokemon; + GFindPokemonData_pokemon? get pokemon; static Serializer get serializer => _$gFindPokemonDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GFindPokemonData.serializer, this); - static GFindPokemonData fromJson(Map json) => + (_i1.serializers.serializeWith(GFindPokemonData.serializer, this) + as Map); + static GFindPokemonData? fromJson(Map json) => _i1.serializers.deserializeWith(GFindPokemonData.serializer, json); } @@ -42,17 +42,15 @@ abstract class GFindPokemonData_pokemon @BuiltValueField(wireName: '__typename') String get G__typename; String get id; - @nullable - String get name; - @nullable - GFindPokemonData_pokemon_weight get weight; - @nullable - GFindPokemonData_pokemon_height get height; + String? get name; + GFindPokemonData_pokemon_weight? get weight; + GFindPokemonData_pokemon_height? get height; static Serializer get serializer => _$gFindPokemonDataPokemonSerializer; Map toJson() => - _i1.serializers.serializeWith(GFindPokemonData_pokemon.serializer, this); - static GFindPokemonData_pokemon fromJson(Map json) => + (_i1.serializers.serializeWith(GFindPokemonData_pokemon.serializer, this) + as Map); + static GFindPokemonData_pokemon? fromJson(Map json) => _i1.serializers .deserializeWith(GFindPokemonData_pokemon.serializer, json); } @@ -72,15 +70,14 @@ abstract class GFindPokemonData_pokemon_weight b..G__typename = 'PokemonDimension'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get minimum; - @nullable - String get maximum; + String? get minimum; + String? get maximum; static Serializer get serializer => _$gFindPokemonDataPokemonWeightSerializer; - Map toJson() => _i1.serializers - .serializeWith(GFindPokemonData_pokemon_weight.serializer, this); - static GFindPokemonData_pokemon_weight fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GFindPokemonData_pokemon_weight.serializer, this) + as Map); + static GFindPokemonData_pokemon_weight? fromJson(Map json) => _i1.serializers .deserializeWith(GFindPokemonData_pokemon_weight.serializer, json); } @@ -100,15 +97,14 @@ abstract class GFindPokemonData_pokemon_height b..G__typename = 'PokemonDimension'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get minimum; - @nullable - String get maximum; + String? get minimum; + String? get maximum; static Serializer get serializer => _$gFindPokemonDataPokemonHeightSerializer; - Map toJson() => _i1.serializers - .serializeWith(GFindPokemonData_pokemon_height.serializer, this); - static GFindPokemonData_pokemon_height fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GFindPokemonData_pokemon_height.serializer, this) + as Map); + static GFindPokemonData_pokemon_height? fromJson(Map json) => _i1.serializers .deserializeWith(GFindPokemonData_pokemon_height.serializer, json); } diff --git a/examples/gql_example_cli/lib/find_pokemon.data.gql.g.dart b/examples/gql_example_cli/lib/find_pokemon.data.gql.g.dart index 368b3d9d3..5804615e3 100644 --- a/examples/gql_example_cli/lib/find_pokemon.data.gql.g.dart +++ b/examples/gql_example_cli/lib/find_pokemon.data.gql.g.dart @@ -25,17 +25,19 @@ class _$GFindPokemonDataSerializer final String wireName = 'GFindPokemonData'; @override - Iterable serialize(Serializers serializers, GFindPokemonData object, + Iterable serialize(Serializers serializers, GFindPokemonData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.pokemon != null) { + Object? value; + value = object.pokemon; + if (value != null) { result ..add('pokemon') - ..add(serializers.serialize(object.pokemon, + ..add(serializers.serialize(value, specifiedType: const FullType(GFindPokemonData_pokemon))); } return result; @@ -43,7 +45,7 @@ class _$GFindPokemonDataSerializer @override GFindPokemonData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFindPokemonDataBuilder(); @@ -51,7 +53,7 @@ class _$GFindPokemonDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -59,7 +61,7 @@ class _$GFindPokemonDataSerializer break; case 'pokemon': result.pokemon.replace(serializers.deserialize(value, - specifiedType: const FullType(GFindPokemonData_pokemon)) + specifiedType: const FullType(GFindPokemonData_pokemon))! as GFindPokemonData_pokemon); break; } @@ -80,32 +82,36 @@ class _$GFindPokemonData_pokemonSerializer final String wireName = 'GFindPokemonData_pokemon'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GFindPokemonData_pokemon object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.name != null) { + Object? value; + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.weight != null) { + value = object.weight; + if (value != null) { result ..add('weight') - ..add(serializers.serialize(object.weight, + ..add(serializers.serialize(value, specifiedType: const FullType(GFindPokemonData_pokemon_weight))); } - if (object.height != null) { + value = object.height; + if (value != null) { result ..add('height') - ..add(serializers.serialize(object.height, + ..add(serializers.serialize(value, specifiedType: const FullType(GFindPokemonData_pokemon_height))); } return result; @@ -113,7 +119,7 @@ class _$GFindPokemonData_pokemonSerializer @override GFindPokemonData_pokemon deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFindPokemonData_pokemonBuilder(); @@ -121,7 +127,7 @@ class _$GFindPokemonData_pokemonSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -138,13 +144,13 @@ class _$GFindPokemonData_pokemonSerializer case 'weight': result.weight.replace(serializers.deserialize(value, specifiedType: - const FullType(GFindPokemonData_pokemon_weight)) + const FullType(GFindPokemonData_pokemon_weight))! as GFindPokemonData_pokemon_weight); break; case 'height': result.height.replace(serializers.deserialize(value, specifiedType: - const FullType(GFindPokemonData_pokemon_height)) + const FullType(GFindPokemonData_pokemon_height))! as GFindPokemonData_pokemon_height); break; } @@ -165,24 +171,27 @@ class _$GFindPokemonData_pokemon_weightSerializer final String wireName = 'GFindPokemonData_pokemon_weight'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GFindPokemonData_pokemon_weight object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.minimum != null) { + Object? value; + value = object.minimum; + if (value != null) { result ..add('minimum') - ..add(serializers.serialize(object.minimum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maximum != null) { + value = object.maximum; + if (value != null) { result ..add('maximum') - ..add(serializers.serialize(object.maximum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -190,7 +199,7 @@ class _$GFindPokemonData_pokemon_weightSerializer @override GFindPokemonData_pokemon_weight deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFindPokemonData_pokemon_weightBuilder(); @@ -198,7 +207,7 @@ class _$GFindPokemonData_pokemon_weightSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -230,24 +239,27 @@ class _$GFindPokemonData_pokemon_heightSerializer final String wireName = 'GFindPokemonData_pokemon_height'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GFindPokemonData_pokemon_height object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.minimum != null) { + Object? value; + value = object.minimum; + if (value != null) { result ..add('minimum') - ..add(serializers.serialize(object.minimum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maximum != null) { + value = object.maximum; + if (value != null) { result ..add('maximum') - ..add(serializers.serialize(object.maximum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -255,7 +267,7 @@ class _$GFindPokemonData_pokemon_heightSerializer @override GFindPokemonData_pokemon_height deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFindPokemonData_pokemon_heightBuilder(); @@ -263,7 +275,7 @@ class _$GFindPokemonData_pokemon_heightSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -288,16 +300,15 @@ class _$GFindPokemonData extends GFindPokemonData { @override final String G__typename; @override - final GFindPokemonData_pokemon pokemon; + final GFindPokemonData_pokemon? pokemon; factory _$GFindPokemonData( - [void Function(GFindPokemonDataBuilder) updates]) => + [void Function(GFindPokemonDataBuilder)? updates]) => (new GFindPokemonDataBuilder()..update(updates)).build(); - _$GFindPokemonData._({this.G__typename, this.pokemon}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GFindPokemonData', 'G__typename'); - } + _$GFindPokemonData._({required this.G__typename, this.pokemon}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData', 'G__typename'); } @override @@ -332,16 +343,16 @@ class _$GFindPokemonData extends GFindPokemonData { class GFindPokemonDataBuilder implements Builder { - _$GFindPokemonData _$v; + _$GFindPokemonData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GFindPokemonData_pokemonBuilder _pokemon; + GFindPokemonData_pokemonBuilder? _pokemon; GFindPokemonData_pokemonBuilder get pokemon => _$this._pokemon ??= new GFindPokemonData_pokemonBuilder(); - set pokemon(GFindPokemonData_pokemonBuilder pokemon) => + set pokemon(GFindPokemonData_pokemonBuilder? pokemon) => _$this._pokemon = pokemon; GFindPokemonDataBuilder() { @@ -349,9 +360,10 @@ class GFindPokemonDataBuilder } GFindPokemonDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _pokemon = _$v.pokemon?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _pokemon = $v.pokemon?.toBuilder(); _$v = null; } return this; @@ -359,14 +371,12 @@ class GFindPokemonDataBuilder @override void replace(GFindPokemonData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFindPokemonData; } @override - void update(void Function(GFindPokemonDataBuilder) updates) { + void update(void Function(GFindPokemonDataBuilder)? updates) { if (updates != null) updates(this); } @@ -376,9 +386,11 @@ class GFindPokemonDataBuilder try { _$result = _$v ?? new _$GFindPokemonData._( - G__typename: G__typename, pokemon: _pokemon?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData', 'G__typename'), + pokemon: _pokemon?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'pokemon'; _pokemon?.build(); @@ -399,26 +411,26 @@ class _$GFindPokemonData_pokemon extends GFindPokemonData_pokemon { @override final String id; @override - final String name; + final String? name; @override - final GFindPokemonData_pokemon_weight weight; + final GFindPokemonData_pokemon_weight? weight; @override - final GFindPokemonData_pokemon_height height; + final GFindPokemonData_pokemon_height? height; factory _$GFindPokemonData_pokemon( - [void Function(GFindPokemonData_pokemonBuilder) updates]) => + [void Function(GFindPokemonData_pokemonBuilder)? updates]) => (new GFindPokemonData_pokemonBuilder()..update(updates)).build(); _$GFindPokemonData_pokemon._( - {this.G__typename, this.id, this.name, this.weight, this.height}) + {required this.G__typename, + required this.id, + this.name, + this.weight, + this.height}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GFindPokemonData_pokemon', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GFindPokemonData_pokemon', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData_pokemon', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, 'GFindPokemonData_pokemon', 'id'); } @override @@ -464,30 +476,30 @@ class _$GFindPokemonData_pokemon extends GFindPokemonData_pokemon { class GFindPokemonData_pokemonBuilder implements Builder { - _$GFindPokemonData_pokemon _$v; + _$GFindPokemonData_pokemon? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - GFindPokemonData_pokemon_weightBuilder _weight; + GFindPokemonData_pokemon_weightBuilder? _weight; GFindPokemonData_pokemon_weightBuilder get weight => _$this._weight ??= new GFindPokemonData_pokemon_weightBuilder(); - set weight(GFindPokemonData_pokemon_weightBuilder weight) => + set weight(GFindPokemonData_pokemon_weightBuilder? weight) => _$this._weight = weight; - GFindPokemonData_pokemon_heightBuilder _height; + GFindPokemonData_pokemon_heightBuilder? _height; GFindPokemonData_pokemon_heightBuilder get height => _$this._height ??= new GFindPokemonData_pokemon_heightBuilder(); - set height(GFindPokemonData_pokemon_heightBuilder height) => + set height(GFindPokemonData_pokemon_heightBuilder? height) => _$this._height = height; GFindPokemonData_pokemonBuilder() { @@ -495,12 +507,13 @@ class GFindPokemonData_pokemonBuilder } GFindPokemonData_pokemonBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _weight = _$v.weight?.toBuilder(); - _height = _$v.height?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _weight = $v.weight?.toBuilder(); + _height = $v.height?.toBuilder(); _$v = null; } return this; @@ -508,14 +521,12 @@ class GFindPokemonData_pokemonBuilder @override void replace(GFindPokemonData_pokemon other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFindPokemonData_pokemon; } @override - void update(void Function(GFindPokemonData_pokemonBuilder) updates) { + void update(void Function(GFindPokemonData_pokemonBuilder)? updates) { if (updates != null) updates(this); } @@ -525,13 +536,15 @@ class GFindPokemonData_pokemonBuilder try { _$result = _$v ?? new _$GFindPokemonData_pokemon._( - G__typename: G__typename, - id: id, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData_pokemon', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GFindPokemonData_pokemon', 'id'), name: name, weight: _weight?.build(), height: _height?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'weight'; _weight?.build(); @@ -553,21 +566,19 @@ class _$GFindPokemonData_pokemon_weight @override final String G__typename; @override - final String minimum; + final String? minimum; @override - final String maximum; + final String? maximum; factory _$GFindPokemonData_pokemon_weight( - [void Function(GFindPokemonData_pokemon_weightBuilder) updates]) => + [void Function(GFindPokemonData_pokemon_weightBuilder)? updates]) => (new GFindPokemonData_pokemon_weightBuilder()..update(updates)).build(); _$GFindPokemonData_pokemon_weight._( - {this.G__typename, this.minimum, this.maximum}) + {required this.G__typename, this.minimum, this.maximum}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GFindPokemonData_pokemon_weight', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData_pokemon_weight', 'G__typename'); } @override @@ -608,29 +619,30 @@ class GFindPokemonData_pokemon_weightBuilder implements Builder { - _$GFindPokemonData_pokemon_weight _$v; + _$GFindPokemonData_pokemon_weight? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _minimum; - String get minimum => _$this._minimum; - set minimum(String minimum) => _$this._minimum = minimum; + String? _minimum; + String? get minimum => _$this._minimum; + set minimum(String? minimum) => _$this._minimum = minimum; - String _maximum; - String get maximum => _$this._maximum; - set maximum(String maximum) => _$this._maximum = maximum; + String? _maximum; + String? get maximum => _$this._maximum; + set maximum(String? maximum) => _$this._maximum = maximum; GFindPokemonData_pokemon_weightBuilder() { GFindPokemonData_pokemon_weight._initializeBuilder(this); } GFindPokemonData_pokemon_weightBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _minimum = _$v.minimum; - _maximum = _$v.maximum; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _minimum = $v.minimum; + _maximum = $v.maximum; _$v = null; } return this; @@ -638,14 +650,12 @@ class GFindPokemonData_pokemon_weightBuilder @override void replace(GFindPokemonData_pokemon_weight other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFindPokemonData_pokemon_weight; } @override - void update(void Function(GFindPokemonData_pokemon_weightBuilder) updates) { + void update(void Function(GFindPokemonData_pokemon_weightBuilder)? updates) { if (updates != null) updates(this); } @@ -653,7 +663,10 @@ class GFindPokemonData_pokemon_weightBuilder _$GFindPokemonData_pokemon_weight build() { final _$result = _$v ?? new _$GFindPokemonData_pokemon_weight._( - G__typename: G__typename, minimum: minimum, maximum: maximum); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData_pokemon_weight', 'G__typename'), + minimum: minimum, + maximum: maximum); replace(_$result); return _$result; } @@ -664,21 +677,19 @@ class _$GFindPokemonData_pokemon_height @override final String G__typename; @override - final String minimum; + final String? minimum; @override - final String maximum; + final String? maximum; factory _$GFindPokemonData_pokemon_height( - [void Function(GFindPokemonData_pokemon_heightBuilder) updates]) => + [void Function(GFindPokemonData_pokemon_heightBuilder)? updates]) => (new GFindPokemonData_pokemon_heightBuilder()..update(updates)).build(); _$GFindPokemonData_pokemon_height._( - {this.G__typename, this.minimum, this.maximum}) + {required this.G__typename, this.minimum, this.maximum}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GFindPokemonData_pokemon_height', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData_pokemon_height', 'G__typename'); } @override @@ -719,29 +730,30 @@ class GFindPokemonData_pokemon_heightBuilder implements Builder { - _$GFindPokemonData_pokemon_height _$v; + _$GFindPokemonData_pokemon_height? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _minimum; - String get minimum => _$this._minimum; - set minimum(String minimum) => _$this._minimum = minimum; + String? _minimum; + String? get minimum => _$this._minimum; + set minimum(String? minimum) => _$this._minimum = minimum; - String _maximum; - String get maximum => _$this._maximum; - set maximum(String maximum) => _$this._maximum = maximum; + String? _maximum; + String? get maximum => _$this._maximum; + set maximum(String? maximum) => _$this._maximum = maximum; GFindPokemonData_pokemon_heightBuilder() { GFindPokemonData_pokemon_height._initializeBuilder(this); } GFindPokemonData_pokemon_heightBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _minimum = _$v.minimum; - _maximum = _$v.maximum; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _minimum = $v.minimum; + _maximum = $v.maximum; _$v = null; } return this; @@ -749,14 +761,12 @@ class GFindPokemonData_pokemon_heightBuilder @override void replace(GFindPokemonData_pokemon_height other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFindPokemonData_pokemon_height; } @override - void update(void Function(GFindPokemonData_pokemon_heightBuilder) updates) { + void update(void Function(GFindPokemonData_pokemon_heightBuilder)? updates) { if (updates != null) updates(this); } @@ -764,7 +774,10 @@ class GFindPokemonData_pokemon_heightBuilder _$GFindPokemonData_pokemon_height build() { final _$result = _$v ?? new _$GFindPokemonData_pokemon_height._( - G__typename: G__typename, minimum: minimum, maximum: maximum); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GFindPokemonData_pokemon_height', 'G__typename'), + minimum: minimum, + maximum: maximum); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli/lib/find_pokemon.req.gql.dart b/examples/gql_example_cli/lib/find_pokemon.req.gql.dart index 639172b0b..7fae4f5cf 100644 --- a/examples/gql_example_cli/lib/find_pokemon.req.gql.dart +++ b/examples/gql_example_cli/lib/find_pokemon.req.gql.dart @@ -23,7 +23,8 @@ abstract class GFindPokemon _i1.Operation get operation; static Serializer get serializer => _$gFindPokemonSerializer; Map toJson() => - _i4.serializers.serializeWith(GFindPokemon.serializer, this); - static GFindPokemon fromJson(Map json) => + (_i4.serializers.serializeWith(GFindPokemon.serializer, this) + as Map); + static GFindPokemon? fromJson(Map json) => _i4.serializers.deserializeWith(GFindPokemon.serializer, json); } diff --git a/examples/gql_example_cli/lib/find_pokemon.req.gql.g.dart b/examples/gql_example_cli/lib/find_pokemon.req.gql.g.dart index 297f6d2b6..bda72d897 100644 --- a/examples/gql_example_cli/lib/find_pokemon.req.gql.g.dart +++ b/examples/gql_example_cli/lib/find_pokemon.req.gql.g.dart @@ -16,9 +16,9 @@ class _$GFindPokemonSerializer implements StructuredSerializer { final String wireName = 'GFindPokemon'; @override - Iterable serialize(Serializers serializers, GFindPokemon object, + Iterable serialize(Serializers serializers, GFindPokemon object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GFindPokemonVars)), @@ -31,7 +31,8 @@ class _$GFindPokemonSerializer implements StructuredSerializer { } @override - GFindPokemon deserialize(Serializers serializers, Iterable serialized, + GFindPokemon deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFindPokemonBuilder(); @@ -39,11 +40,11 @@ class _$GFindPokemonSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GFindPokemonVars)) + specifiedType: const FullType(_i3.GFindPokemonVars))! as _i3.GFindPokemonVars); break; case 'operation': @@ -63,16 +64,13 @@ class _$GFindPokemon extends GFindPokemon { @override final _i1.Operation operation; - factory _$GFindPokemon([void Function(GFindPokemonBuilder) updates]) => + factory _$GFindPokemon([void Function(GFindPokemonBuilder)? updates]) => (new GFindPokemonBuilder()..update(updates)).build(); - _$GFindPokemon._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GFindPokemon', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GFindPokemon', 'operation'); - } + _$GFindPokemon._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GFindPokemon', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GFindPokemon', 'operation'); } @override @@ -106,25 +104,26 @@ class _$GFindPokemon extends GFindPokemon { class GFindPokemonBuilder implements Builder { - _$GFindPokemon _$v; + _$GFindPokemon? _$v; - _i3.GFindPokemonVarsBuilder _vars; + _i3.GFindPokemonVarsBuilder? _vars; _i3.GFindPokemonVarsBuilder get vars => _$this._vars ??= new _i3.GFindPokemonVarsBuilder(); - set vars(_i3.GFindPokemonVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GFindPokemonVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GFindPokemonBuilder() { GFindPokemon._initializeBuilder(this); } GFindPokemonBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -132,14 +131,12 @@ class GFindPokemonBuilder @override void replace(GFindPokemon other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFindPokemon; } @override - void update(void Function(GFindPokemonBuilder) updates) { + void update(void Function(GFindPokemonBuilder)? updates) { if (updates != null) updates(this); } @@ -147,10 +144,13 @@ class GFindPokemonBuilder _$GFindPokemon build() { _$GFindPokemon _$result; try { - _$result = - _$v ?? new _$GFindPokemon._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GFindPokemon._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GFindPokemon', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_cli/lib/find_pokemon.var.gql.dart b/examples/gql_example_cli/lib/find_pokemon.var.gql.dart index c7d368a19..8b6ed50e9 100644 --- a/examples/gql_example_cli/lib/find_pokemon.var.gql.dart +++ b/examples/gql_example_cli/lib/find_pokemon.var.gql.dart @@ -17,7 +17,8 @@ abstract class GFindPokemonVars static Serializer get serializer => _$gFindPokemonVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GFindPokemonVars.serializer, this); - static GFindPokemonVars fromJson(Map json) => + (_i1.serializers.serializeWith(GFindPokemonVars.serializer, this) + as Map); + static GFindPokemonVars? fromJson(Map json) => _i1.serializers.deserializeWith(GFindPokemonVars.serializer, json); } diff --git a/examples/gql_example_cli/lib/find_pokemon.var.gql.g.dart b/examples/gql_example_cli/lib/find_pokemon.var.gql.g.dart index 0e3251aa6..548edef35 100644 --- a/examples/gql_example_cli/lib/find_pokemon.var.gql.g.dart +++ b/examples/gql_example_cli/lib/find_pokemon.var.gql.g.dart @@ -17,9 +17,9 @@ class _$GFindPokemonVarsSerializer final String wireName = 'GFindPokemonVars'; @override - Iterable serialize(Serializers serializers, GFindPokemonVars object, + Iterable serialize(Serializers serializers, GFindPokemonVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), ]; @@ -29,7 +29,7 @@ class _$GFindPokemonVarsSerializer @override GFindPokemonVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFindPokemonVarsBuilder(); @@ -37,7 +37,7 @@ class _$GFindPokemonVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'name': result.name = serializers.deserialize(value, @@ -55,13 +55,11 @@ class _$GFindPokemonVars extends GFindPokemonVars { final String name; factory _$GFindPokemonVars( - [void Function(GFindPokemonVarsBuilder) updates]) => + [void Function(GFindPokemonVarsBuilder)? updates]) => (new GFindPokemonVarsBuilder()..update(updates)).build(); - _$GFindPokemonVars._({this.name}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GFindPokemonVars', 'name'); - } + _$GFindPokemonVars._({required this.name}) : super._() { + BuiltValueNullFieldError.checkNotNull(name, 'GFindPokemonVars', 'name'); } @override @@ -92,17 +90,18 @@ class _$GFindPokemonVars extends GFindPokemonVars { class GFindPokemonVarsBuilder implements Builder { - _$GFindPokemonVars _$v; + _$GFindPokemonVars? _$v; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GFindPokemonVarsBuilder(); GFindPokemonVarsBuilder get _$this { - if (_$v != null) { - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _name = $v.name; _$v = null; } return this; @@ -110,20 +109,21 @@ class GFindPokemonVarsBuilder @override void replace(GFindPokemonVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFindPokemonVars; } @override - void update(void Function(GFindPokemonVarsBuilder) updates) { + void update(void Function(GFindPokemonVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GFindPokemonVars build() { - final _$result = _$v ?? new _$GFindPokemonVars._(name: name); + final _$result = _$v ?? + new _$GFindPokemonVars._( + name: BuiltValueNullFieldError.checkNotNull( + name, 'GFindPokemonVars', 'name')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli/lib/list_pokemon.data.gql.dart b/examples/gql_example_cli/lib/list_pokemon.data.gql.dart index 48d35d398..5b1b2344e 100644 --- a/examples/gql_example_cli/lib/list_pokemon.data.gql.dart +++ b/examples/gql_example_cli/lib/list_pokemon.data.gql.dart @@ -18,13 +18,13 @@ abstract class GListPokemonData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - BuiltList get pokemons; + BuiltList? get pokemons; static Serializer get serializer => _$gListPokemonDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GListPokemonData.serializer, this); - static GListPokemonData fromJson(Map json) => + (_i1.serializers.serializeWith(GListPokemonData.serializer, this) + as Map); + static GListPokemonData? fromJson(Map json) => _i1.serializers.deserializeWith(GListPokemonData.serializer, json); } @@ -42,13 +42,13 @@ abstract class GListPokemonData_pokemons @BuiltValueField(wireName: '__typename') String get G__typename; String get id; - @nullable - String get name; + String? get name; static Serializer get serializer => _$gListPokemonDataPokemonsSerializer; Map toJson() => - _i1.serializers.serializeWith(GListPokemonData_pokemons.serializer, this); - static GListPokemonData_pokemons fromJson(Map json) => + (_i1.serializers.serializeWith(GListPokemonData_pokemons.serializer, this) + as Map); + static GListPokemonData_pokemons? fromJson(Map json) => _i1.serializers .deserializeWith(GListPokemonData_pokemons.serializer, json); } diff --git a/examples/gql_example_cli/lib/list_pokemon.data.gql.g.dart b/examples/gql_example_cli/lib/list_pokemon.data.gql.g.dart index 4e24c18b9..ac50a1e3c 100644 --- a/examples/gql_example_cli/lib/list_pokemon.data.gql.g.dart +++ b/examples/gql_example_cli/lib/list_pokemon.data.gql.g.dart @@ -19,17 +19,19 @@ class _$GListPokemonDataSerializer final String wireName = 'GListPokemonData'; @override - Iterable serialize(Serializers serializers, GListPokemonData object, + Iterable serialize(Serializers serializers, GListPokemonData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.pokemons != null) { + Object? value; + value = object.pokemons; + if (value != null) { result ..add('pokemons') - ..add(serializers.serialize(object.pokemons, + ..add(serializers.serialize(value, specifiedType: const FullType( BuiltList, const [const FullType(GListPokemonData_pokemons)]))); } @@ -38,7 +40,7 @@ class _$GListPokemonDataSerializer @override GListPokemonData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GListPokemonDataBuilder(); @@ -46,7 +48,7 @@ class _$GListPokemonDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -56,7 +58,7 @@ class _$GListPokemonDataSerializer result.pokemons.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GListPokemonData_pokemons) - ])) as BuiltList); + ]))! as BuiltList); break; } } @@ -76,20 +78,22 @@ class _$GListPokemonData_pokemonsSerializer final String wireName = 'GListPokemonData_pokemons'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GListPokemonData_pokemons object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.name != null) { + Object? value; + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -97,7 +101,7 @@ class _$GListPokemonData_pokemonsSerializer @override GListPokemonData_pokemons deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GListPokemonData_pokemonsBuilder(); @@ -105,7 +109,7 @@ class _$GListPokemonData_pokemonsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -130,16 +134,15 @@ class _$GListPokemonData extends GListPokemonData { @override final String G__typename; @override - final BuiltList pokemons; + final BuiltList? pokemons; factory _$GListPokemonData( - [void Function(GListPokemonDataBuilder) updates]) => + [void Function(GListPokemonDataBuilder)? updates]) => (new GListPokemonDataBuilder()..update(updates)).build(); - _$GListPokemonData._({this.G__typename, this.pokemons}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GListPokemonData', 'G__typename'); - } + _$GListPokemonData._({required this.G__typename, this.pokemons}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GListPokemonData', 'G__typename'); } @override @@ -174,16 +177,16 @@ class _$GListPokemonData extends GListPokemonData { class GListPokemonDataBuilder implements Builder { - _$GListPokemonData _$v; + _$GListPokemonData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - ListBuilder _pokemons; + ListBuilder? _pokemons; ListBuilder get pokemons => _$this._pokemons ??= new ListBuilder(); - set pokemons(ListBuilder pokemons) => + set pokemons(ListBuilder? pokemons) => _$this._pokemons = pokemons; GListPokemonDataBuilder() { @@ -191,9 +194,10 @@ class GListPokemonDataBuilder } GListPokemonDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _pokemons = _$v.pokemons?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _pokemons = $v.pokemons?.toBuilder(); _$v = null; } return this; @@ -201,14 +205,12 @@ class GListPokemonDataBuilder @override void replace(GListPokemonData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GListPokemonData; } @override - void update(void Function(GListPokemonDataBuilder) updates) { + void update(void Function(GListPokemonDataBuilder)? updates) { if (updates != null) updates(this); } @@ -218,9 +220,11 @@ class GListPokemonDataBuilder try { _$result = _$v ?? new _$GListPokemonData._( - G__typename: G__typename, pokemons: _pokemons?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GListPokemonData', 'G__typename'), + pokemons: _pokemons?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'pokemons'; _pokemons?.build(); @@ -241,21 +245,19 @@ class _$GListPokemonData_pokemons extends GListPokemonData_pokemons { @override final String id; @override - final String name; + final String? name; factory _$GListPokemonData_pokemons( - [void Function(GListPokemonData_pokemonsBuilder) updates]) => + [void Function(GListPokemonData_pokemonsBuilder)? updates]) => (new GListPokemonData_pokemonsBuilder()..update(updates)).build(); - _$GListPokemonData_pokemons._({this.G__typename, this.id, this.name}) + _$GListPokemonData_pokemons._( + {required this.G__typename, required this.id, this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GListPokemonData_pokemons', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GListPokemonData_pokemons', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GListPokemonData_pokemons', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, 'GListPokemonData_pokemons', 'id'); } @override @@ -295,29 +297,30 @@ class _$GListPokemonData_pokemons extends GListPokemonData_pokemons { class GListPokemonData_pokemonsBuilder implements Builder { - _$GListPokemonData_pokemons _$v; + _$GListPokemonData_pokemons? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GListPokemonData_pokemonsBuilder() { GListPokemonData_pokemons._initializeBuilder(this); } GListPokemonData_pokemonsBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; _$v = null; } return this; @@ -325,14 +328,12 @@ class GListPokemonData_pokemonsBuilder @override void replace(GListPokemonData_pokemons other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GListPokemonData_pokemons; } @override - void update(void Function(GListPokemonData_pokemonsBuilder) updates) { + void update(void Function(GListPokemonData_pokemonsBuilder)? updates) { if (updates != null) updates(this); } @@ -340,7 +341,11 @@ class GListPokemonData_pokemonsBuilder _$GListPokemonData_pokemons build() { final _$result = _$v ?? new _$GListPokemonData_pokemons._( - G__typename: G__typename, id: id, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GListPokemonData_pokemons', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GListPokemonData_pokemons', 'id'), + name: name); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli/lib/list_pokemon.req.gql.dart b/examples/gql_example_cli/lib/list_pokemon.req.gql.dart index 9fcd3383a..a152718bc 100644 --- a/examples/gql_example_cli/lib/list_pokemon.req.gql.dart +++ b/examples/gql_example_cli/lib/list_pokemon.req.gql.dart @@ -23,7 +23,8 @@ abstract class GListPokemon _i1.Operation get operation; static Serializer get serializer => _$gListPokemonSerializer; Map toJson() => - _i4.serializers.serializeWith(GListPokemon.serializer, this); - static GListPokemon fromJson(Map json) => + (_i4.serializers.serializeWith(GListPokemon.serializer, this) + as Map); + static GListPokemon? fromJson(Map json) => _i4.serializers.deserializeWith(GListPokemon.serializer, json); } diff --git a/examples/gql_example_cli/lib/list_pokemon.req.gql.g.dart b/examples/gql_example_cli/lib/list_pokemon.req.gql.g.dart index da9e00f49..d749b08cf 100644 --- a/examples/gql_example_cli/lib/list_pokemon.req.gql.g.dart +++ b/examples/gql_example_cli/lib/list_pokemon.req.gql.g.dart @@ -16,9 +16,9 @@ class _$GListPokemonSerializer implements StructuredSerializer { final String wireName = 'GListPokemon'; @override - Iterable serialize(Serializers serializers, GListPokemon object, + Iterable serialize(Serializers serializers, GListPokemon object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GListPokemonVars)), @@ -31,7 +31,8 @@ class _$GListPokemonSerializer implements StructuredSerializer { } @override - GListPokemon deserialize(Serializers serializers, Iterable serialized, + GListPokemon deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GListPokemonBuilder(); @@ -39,11 +40,11 @@ class _$GListPokemonSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GListPokemonVars)) + specifiedType: const FullType(_i3.GListPokemonVars))! as _i3.GListPokemonVars); break; case 'operation': @@ -63,16 +64,13 @@ class _$GListPokemon extends GListPokemon { @override final _i1.Operation operation; - factory _$GListPokemon([void Function(GListPokemonBuilder) updates]) => + factory _$GListPokemon([void Function(GListPokemonBuilder)? updates]) => (new GListPokemonBuilder()..update(updates)).build(); - _$GListPokemon._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GListPokemon', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GListPokemon', 'operation'); - } + _$GListPokemon._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GListPokemon', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GListPokemon', 'operation'); } @override @@ -106,25 +104,26 @@ class _$GListPokemon extends GListPokemon { class GListPokemonBuilder implements Builder { - _$GListPokemon _$v; + _$GListPokemon? _$v; - _i3.GListPokemonVarsBuilder _vars; + _i3.GListPokemonVarsBuilder? _vars; _i3.GListPokemonVarsBuilder get vars => _$this._vars ??= new _i3.GListPokemonVarsBuilder(); - set vars(_i3.GListPokemonVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GListPokemonVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GListPokemonBuilder() { GListPokemon._initializeBuilder(this); } GListPokemonBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -132,14 +131,12 @@ class GListPokemonBuilder @override void replace(GListPokemon other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GListPokemon; } @override - void update(void Function(GListPokemonBuilder) updates) { + void update(void Function(GListPokemonBuilder)? updates) { if (updates != null) updates(this); } @@ -147,10 +144,13 @@ class GListPokemonBuilder _$GListPokemon build() { _$GListPokemon _$result; try { - _$result = - _$v ?? new _$GListPokemon._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GListPokemon._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GListPokemon', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_cli/lib/list_pokemon.var.gql.dart b/examples/gql_example_cli/lib/list_pokemon.var.gql.dart index 778d2400e..b422bb257 100644 --- a/examples/gql_example_cli/lib/list_pokemon.var.gql.dart +++ b/examples/gql_example_cli/lib/list_pokemon.var.gql.dart @@ -17,7 +17,8 @@ abstract class GListPokemonVars static Serializer get serializer => _$gListPokemonVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GListPokemonVars.serializer, this); - static GListPokemonVars fromJson(Map json) => + (_i1.serializers.serializeWith(GListPokemonVars.serializer, this) + as Map); + static GListPokemonVars? fromJson(Map json) => _i1.serializers.deserializeWith(GListPokemonVars.serializer, json); } diff --git a/examples/gql_example_cli/lib/list_pokemon.var.gql.g.dart b/examples/gql_example_cli/lib/list_pokemon.var.gql.g.dart index 5dd89d559..0df425f95 100644 --- a/examples/gql_example_cli/lib/list_pokemon.var.gql.g.dart +++ b/examples/gql_example_cli/lib/list_pokemon.var.gql.g.dart @@ -17,9 +17,9 @@ class _$GListPokemonVarsSerializer final String wireName = 'GListPokemonVars'; @override - Iterable serialize(Serializers serializers, GListPokemonVars object, + Iterable serialize(Serializers serializers, GListPokemonVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'count', serializers.serialize(object.count, specifiedType: const FullType(int)), ]; @@ -29,7 +29,7 @@ class _$GListPokemonVarsSerializer @override GListPokemonVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GListPokemonVarsBuilder(); @@ -37,7 +37,7 @@ class _$GListPokemonVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'count': result.count = serializers.deserialize(value, @@ -55,13 +55,11 @@ class _$GListPokemonVars extends GListPokemonVars { final int count; factory _$GListPokemonVars( - [void Function(GListPokemonVarsBuilder) updates]) => + [void Function(GListPokemonVarsBuilder)? updates]) => (new GListPokemonVarsBuilder()..update(updates)).build(); - _$GListPokemonVars._({this.count}) : super._() { - if (count == null) { - throw new BuiltValueNullFieldError('GListPokemonVars', 'count'); - } + _$GListPokemonVars._({required this.count}) : super._() { + BuiltValueNullFieldError.checkNotNull(count, 'GListPokemonVars', 'count'); } @override @@ -93,17 +91,18 @@ class _$GListPokemonVars extends GListPokemonVars { class GListPokemonVarsBuilder implements Builder { - _$GListPokemonVars _$v; + _$GListPokemonVars? _$v; - int _count; - int get count => _$this._count; - set count(int count) => _$this._count = count; + int? _count; + int? get count => _$this._count; + set count(int? count) => _$this._count = count; GListPokemonVarsBuilder(); GListPokemonVarsBuilder get _$this { - if (_$v != null) { - _count = _$v.count; + final $v = _$v; + if ($v != null) { + _count = $v.count; _$v = null; } return this; @@ -111,20 +110,21 @@ class GListPokemonVarsBuilder @override void replace(GListPokemonVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GListPokemonVars; } @override - void update(void Function(GListPokemonVarsBuilder) updates) { + void update(void Function(GListPokemonVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GListPokemonVars build() { - final _$result = _$v ?? new _$GListPokemonVars._(count: count); + final _$result = _$v ?? + new _$GListPokemonVars._( + count: BuiltValueNullFieldError.checkNotNull( + count, 'GListPokemonVars', 'count')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli/pubspec.yaml b/examples/gql_example_cli/pubspec.yaml index 6df791d7d..ae1150601 100644 --- a/examples/gql_example_cli/pubspec.yaml +++ b/examples/gql_example_cli/pubspec.yaml @@ -1,13 +1,13 @@ name: gql_example_cli environment: - sdk: '>=2.7.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - args: any - gql: ^0.12.3 - gql_link: ^0.3.1 - gql_exec: ^0.2.5 - gql_http_link: ^0.3.2 + args: ^2.0.0 + gql: ^0.13.0-nullsafety.2 + gql_exec: ^0.3.0-nullsafety.2 + gql_http_link: ^0.4.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.3 dev_dependencies: - build_runner: ^1.10.1 + build_runner: ^2.0.0 + gql_build: ^0.2.0-nullsafety.0 gql_pedantic: ^1.0.2 - gql_build: ^0.1.3 diff --git a/examples/gql_example_cli_github/bin/main.dart b/examples/gql_example_cli_github/bin/main.dart index e6739967e..c4b7cf462 100644 --- a/examples/gql_example_cli_github/bin/main.dart +++ b/examples/gql_example_cli_github/bin/main.dart @@ -39,14 +39,14 @@ void query( ) .first; - if (result.errors != null && result.errors.isNotEmpty) { + if (result.errors != null && result.errors!.isNotEmpty) { stderr.writeln(result.errors); exit(2); } - final data = GReadRepositoriesData.fromJson(result.data); + final data = GReadRepositoriesData.fromJson(result.data!); - final repositories = data.viewer.repositories.nodes; + final repositories = data!.viewer.repositories.nodes!; repositories.forEach( (repo) { @@ -81,14 +81,14 @@ void starRepository( ) .first; - if (result.errors != null && result.errors.isNotEmpty) { + if (result.errors != null && result.errors!.isNotEmpty) { stderr.writeln(result.errors); exit(2); } - final data = GAddStarData.fromJson(result.data); + final data = GAddStarData.fromJson(result.data!)!; - final isStarred = data.action.starrable.viewerHasStarred; + final isStarred = data.action!.starrable!.viewerHasStarred; if (isStarred) { stdout.writeln("Thanks for your star!"); @@ -119,14 +119,14 @@ void removeStarFromRepository( ) .first; - if (result.errors != null && result.errors.isNotEmpty) { + if (result.errors != null && result.errors!.isNotEmpty) { stderr.writeln(result.errors); exit(2); } - final data = GRemoveStarData.fromJson(result.data); + final data = GRemoveStarData.fromJson(result.data!); - final isStarred = data.action.starrable.viewerHasStarred; + final isStarred = data!.action!.starrable!.viewerHasStarred; if (!isStarred) { stdout.writeln("Sorry you changed your mind!"); diff --git a/examples/gql_example_cli_github/lib/add_star.data.gql.dart b/examples/gql_example_cli_github/lib/add_star.data.gql.dart index 8a4d37dc1..eb246cc68 100644 --- a/examples/gql_example_cli_github/lib/add_star.data.gql.dart +++ b/examples/gql_example_cli_github/lib/add_star.data.gql.dart @@ -17,12 +17,12 @@ abstract class GAddStarData b..G__typename = 'Mutation'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GAddStarData_action get action; + GAddStarData_action? get action; static Serializer get serializer => _$gAddStarDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddStarData.serializer, this); - static GAddStarData fromJson(Map json) => + (_i1.serializers.serializeWith(GAddStarData.serializer, this) + as Map); + static GAddStarData? fromJson(Map json) => _i1.serializers.deserializeWith(GAddStarData.serializer, json); } @@ -37,13 +37,13 @@ abstract class GAddStarData_action b..G__typename = 'AddStarPayload'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GAddStarData_action_starrable get starrable; + GAddStarData_action_starrable? get starrable; static Serializer get serializer => _$gAddStarDataActionSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddStarData_action.serializer, this); - static GAddStarData_action fromJson(Map json) => + (_i1.serializers.serializeWith(GAddStarData_action.serializer, this) + as Map); + static GAddStarData_action? fromJson(Map json) => _i1.serializers.deserializeWith(GAddStarData_action.serializer, json); } @@ -64,9 +64,9 @@ abstract class GAddStarData_action_starrable bool get viewerHasStarred; static Serializer get serializer => _$gAddStarDataActionStarrableSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAddStarData_action_starrable.serializer, this); - static GAddStarData_action_starrable fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GAddStarData_action_starrable.serializer, this) as Map); + static GAddStarData_action_starrable? fromJson(Map json) => _i1.serializers .deserializeWith(GAddStarData_action_starrable.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/add_star.data.gql.g.dart b/examples/gql_example_cli_github/lib/add_star.data.gql.g.dart index 437446b00..f96457ad3 100644 --- a/examples/gql_example_cli_github/lib/add_star.data.gql.g.dart +++ b/examples/gql_example_cli_github/lib/add_star.data.gql.g.dart @@ -21,24 +21,27 @@ class _$GAddStarDataSerializer implements StructuredSerializer { final String wireName = 'GAddStarData'; @override - Iterable serialize(Serializers serializers, GAddStarData object, + Iterable serialize(Serializers serializers, GAddStarData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.action != null) { + Object? value; + value = object.action; + if (value != null) { result ..add('action') - ..add(serializers.serialize(object.action, + ..add(serializers.serialize(value, specifiedType: const FullType(GAddStarData_action))); } return result; } @override - GAddStarData deserialize(Serializers serializers, Iterable serialized, + GAddStarData deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddStarDataBuilder(); @@ -46,7 +49,7 @@ class _$GAddStarDataSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -54,7 +57,7 @@ class _$GAddStarDataSerializer implements StructuredSerializer { break; case 'action': result.action.replace(serializers.deserialize(value, - specifiedType: const FullType(GAddStarData_action)) + specifiedType: const FullType(GAddStarData_action))! as GAddStarData_action); break; } @@ -75,18 +78,20 @@ class _$GAddStarData_actionSerializer final String wireName = 'GAddStarData_action'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddStarData_action object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.starrable != null) { + Object? value; + value = object.starrable; + if (value != null) { result ..add('starrable') - ..add(serializers.serialize(object.starrable, + ..add(serializers.serialize(value, specifiedType: const FullType(GAddStarData_action_starrable))); } return result; @@ -94,7 +99,7 @@ class _$GAddStarData_actionSerializer @override GAddStarData_action deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddStarData_actionBuilder(); @@ -102,7 +107,7 @@ class _$GAddStarData_actionSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -110,7 +115,7 @@ class _$GAddStarData_actionSerializer break; case 'starrable': result.starrable.replace(serializers.deserialize(value, - specifiedType: const FullType(GAddStarData_action_starrable)) + specifiedType: const FullType(GAddStarData_action_starrable))! as GAddStarData_action_starrable); break; } @@ -131,10 +136,10 @@ class _$GAddStarData_action_starrableSerializer final String wireName = 'GAddStarData_action_starrable'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddStarData_action_starrable object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -148,7 +153,7 @@ class _$GAddStarData_action_starrableSerializer @override GAddStarData_action_starrable deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddStarData_action_starrableBuilder(); @@ -156,7 +161,7 @@ class _$GAddStarData_action_starrableSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -177,15 +182,14 @@ class _$GAddStarData extends GAddStarData { @override final String G__typename; @override - final GAddStarData_action action; + final GAddStarData_action? action; - factory _$GAddStarData([void Function(GAddStarDataBuilder) updates]) => + factory _$GAddStarData([void Function(GAddStarDataBuilder)? updates]) => (new GAddStarDataBuilder()..update(updates)).build(); - _$GAddStarData._({this.G__typename, this.action}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GAddStarData', 'G__typename'); - } + _$GAddStarData._({required this.G__typename, this.action}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAddStarData', 'G__typename'); } @override @@ -219,25 +223,26 @@ class _$GAddStarData extends GAddStarData { class GAddStarDataBuilder implements Builder { - _$GAddStarData _$v; + _$GAddStarData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GAddStarData_actionBuilder _action; + GAddStarData_actionBuilder? _action; GAddStarData_actionBuilder get action => _$this._action ??= new GAddStarData_actionBuilder(); - set action(GAddStarData_actionBuilder action) => _$this._action = action; + set action(GAddStarData_actionBuilder? action) => _$this._action = action; GAddStarDataBuilder() { GAddStarData._initializeBuilder(this); } GAddStarDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _action = _$v.action?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _action = $v.action?.toBuilder(); _$v = null; } return this; @@ -245,14 +250,12 @@ class GAddStarDataBuilder @override void replace(GAddStarData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddStarData; } @override - void update(void Function(GAddStarDataBuilder) updates) { + void update(void Function(GAddStarDataBuilder)? updates) { if (updates != null) updates(this); } @@ -262,9 +265,11 @@ class GAddStarDataBuilder try { _$result = _$v ?? new _$GAddStarData._( - G__typename: G__typename, action: _action?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAddStarData', 'G__typename'), + action: _action?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'action'; _action?.build(); @@ -283,16 +288,16 @@ class _$GAddStarData_action extends GAddStarData_action { @override final String G__typename; @override - final GAddStarData_action_starrable starrable; + final GAddStarData_action_starrable? starrable; factory _$GAddStarData_action( - [void Function(GAddStarData_actionBuilder) updates]) => + [void Function(GAddStarData_actionBuilder)? updates]) => (new GAddStarData_actionBuilder()..update(updates)).build(); - _$GAddStarData_action._({this.G__typename, this.starrable}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GAddStarData_action', 'G__typename'); - } + _$GAddStarData_action._({required this.G__typename, this.starrable}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAddStarData_action', 'G__typename'); } @override @@ -328,16 +333,16 @@ class _$GAddStarData_action extends GAddStarData_action { class GAddStarData_actionBuilder implements Builder { - _$GAddStarData_action _$v; + _$GAddStarData_action? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GAddStarData_action_starrableBuilder _starrable; + GAddStarData_action_starrableBuilder? _starrable; GAddStarData_action_starrableBuilder get starrable => _$this._starrable ??= new GAddStarData_action_starrableBuilder(); - set starrable(GAddStarData_action_starrableBuilder starrable) => + set starrable(GAddStarData_action_starrableBuilder? starrable) => _$this._starrable = starrable; GAddStarData_actionBuilder() { @@ -345,9 +350,10 @@ class GAddStarData_actionBuilder } GAddStarData_actionBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _starrable = _$v.starrable?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _starrable = $v.starrable?.toBuilder(); _$v = null; } return this; @@ -355,14 +361,12 @@ class GAddStarData_actionBuilder @override void replace(GAddStarData_action other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddStarData_action; } @override - void update(void Function(GAddStarData_actionBuilder) updates) { + void update(void Function(GAddStarData_actionBuilder)? updates) { if (updates != null) updates(this); } @@ -372,9 +376,11 @@ class GAddStarData_actionBuilder try { _$result = _$v ?? new _$GAddStarData_action._( - G__typename: G__typename, starrable: _starrable?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAddStarData_action', 'G__typename'), + starrable: _starrable?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'starrable'; _starrable?.build(); @@ -396,19 +402,16 @@ class _$GAddStarData_action_starrable extends GAddStarData_action_starrable { final bool viewerHasStarred; factory _$GAddStarData_action_starrable( - [void Function(GAddStarData_action_starrableBuilder) updates]) => + [void Function(GAddStarData_action_starrableBuilder)? updates]) => (new GAddStarData_action_starrableBuilder()..update(updates)).build(); - _$GAddStarData_action_starrable._({this.G__typename, this.viewerHasStarred}) + _$GAddStarData_action_starrable._( + {required this.G__typename, required this.viewerHasStarred}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GAddStarData_action_starrable', 'G__typename'); - } - if (viewerHasStarred == null) { - throw new BuiltValueNullFieldError( - 'GAddStarData_action_starrable', 'viewerHasStarred'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAddStarData_action_starrable', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + viewerHasStarred, 'GAddStarData_action_starrable', 'viewerHasStarred'); } @override @@ -446,15 +449,15 @@ class GAddStarData_action_starrableBuilder implements Builder { - _$GAddStarData_action_starrable _$v; + _$GAddStarData_action_starrable? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - bool _viewerHasStarred; - bool get viewerHasStarred => _$this._viewerHasStarred; - set viewerHasStarred(bool viewerHasStarred) => + bool? _viewerHasStarred; + bool? get viewerHasStarred => _$this._viewerHasStarred; + set viewerHasStarred(bool? viewerHasStarred) => _$this._viewerHasStarred = viewerHasStarred; GAddStarData_action_starrableBuilder() { @@ -462,9 +465,10 @@ class GAddStarData_action_starrableBuilder } GAddStarData_action_starrableBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _viewerHasStarred = _$v.viewerHasStarred; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _viewerHasStarred = $v.viewerHasStarred; _$v = null; } return this; @@ -472,14 +476,12 @@ class GAddStarData_action_starrableBuilder @override void replace(GAddStarData_action_starrable other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddStarData_action_starrable; } @override - void update(void Function(GAddStarData_action_starrableBuilder) updates) { + void update(void Function(GAddStarData_action_starrableBuilder)? updates) { if (updates != null) updates(this); } @@ -487,7 +489,12 @@ class GAddStarData_action_starrableBuilder _$GAddStarData_action_starrable build() { final _$result = _$v ?? new _$GAddStarData_action_starrable._( - G__typename: G__typename, viewerHasStarred: viewerHasStarred); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAddStarData_action_starrable', 'G__typename'), + viewerHasStarred: BuiltValueNullFieldError.checkNotNull( + viewerHasStarred, + 'GAddStarData_action_starrable', + 'viewerHasStarred')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli_github/lib/add_star.req.gql.dart b/examples/gql_example_cli_github/lib/add_star.req.gql.dart index f65d7a6d1..43ebe5e80 100644 --- a/examples/gql_example_cli_github/lib/add_star.req.gql.dart +++ b/examples/gql_example_cli_github/lib/add_star.req.gql.dart @@ -21,7 +21,8 @@ abstract class GAddStar implements Built { _i1.Operation get operation; static Serializer get serializer => _$gAddStarSerializer; Map toJson() => - _i4.serializers.serializeWith(GAddStar.serializer, this); - static GAddStar fromJson(Map json) => + (_i4.serializers.serializeWith(GAddStar.serializer, this) + as Map); + static GAddStar? fromJson(Map json) => _i4.serializers.deserializeWith(GAddStar.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/add_star.req.gql.g.dart b/examples/gql_example_cli_github/lib/add_star.req.gql.g.dart index a902d0712..65408ef69 100644 --- a/examples/gql_example_cli_github/lib/add_star.req.gql.g.dart +++ b/examples/gql_example_cli_github/lib/add_star.req.gql.g.dart @@ -15,9 +15,9 @@ class _$GAddStarSerializer implements StructuredSerializer { final String wireName = 'GAddStar'; @override - Iterable serialize(Serializers serializers, GAddStar object, + Iterable serialize(Serializers serializers, GAddStar object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GAddStarVars)), @@ -30,7 +30,7 @@ class _$GAddStarSerializer implements StructuredSerializer { } @override - GAddStar deserialize(Serializers serializers, Iterable serialized, + GAddStar deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddStarBuilder(); @@ -38,11 +38,11 @@ class _$GAddStarSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GAddStarVars)) + specifiedType: const FullType(_i3.GAddStarVars))! as _i3.GAddStarVars); break; case 'operation': @@ -62,16 +62,12 @@ class _$GAddStar extends GAddStar { @override final _i1.Operation operation; - factory _$GAddStar([void Function(GAddStarBuilder) updates]) => + factory _$GAddStar([void Function(GAddStarBuilder)? updates]) => (new GAddStarBuilder()..update(updates)).build(); - _$GAddStar._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GAddStar', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GAddStar', 'operation'); - } + _$GAddStar._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GAddStar', 'vars'); + BuiltValueNullFieldError.checkNotNull(operation, 'GAddStar', 'operation'); } @override @@ -104,25 +100,26 @@ class _$GAddStar extends GAddStar { } class GAddStarBuilder implements Builder { - _$GAddStar _$v; + _$GAddStar? _$v; - _i3.GAddStarVarsBuilder _vars; + _i3.GAddStarVarsBuilder? _vars; _i3.GAddStarVarsBuilder get vars => _$this._vars ??= new _i3.GAddStarVarsBuilder(); - set vars(_i3.GAddStarVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GAddStarVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GAddStarBuilder() { GAddStar._initializeBuilder(this); } GAddStarBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -130,14 +127,12 @@ class GAddStarBuilder implements Builder { @override void replace(GAddStar other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddStar; } @override - void update(void Function(GAddStarBuilder) updates) { + void update(void Function(GAddStarBuilder)? updates) { if (updates != null) updates(this); } @@ -145,10 +140,13 @@ class GAddStarBuilder implements Builder { _$GAddStar build() { _$GAddStar _$result; try { - _$result = - _$v ?? new _$GAddStar._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GAddStar._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GAddStar', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_cli_github/lib/add_star.var.gql.dart b/examples/gql_example_cli_github/lib/add_star.var.gql.dart index ac590e97b..c8636aad6 100644 --- a/examples/gql_example_cli_github/lib/add_star.var.gql.dart +++ b/examples/gql_example_cli_github/lib/add_star.var.gql.dart @@ -16,7 +16,8 @@ abstract class GAddStarVars String get starrableId; static Serializer get serializer => _$gAddStarVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddStarVars.serializer, this); - static GAddStarVars fromJson(Map json) => + (_i1.serializers.serializeWith(GAddStarVars.serializer, this) + as Map); + static GAddStarVars? fromJson(Map json) => _i1.serializers.deserializeWith(GAddStarVars.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/add_star.var.gql.g.dart b/examples/gql_example_cli_github/lib/add_star.var.gql.g.dart index 28e926716..52e997307 100644 --- a/examples/gql_example_cli_github/lib/add_star.var.gql.g.dart +++ b/examples/gql_example_cli_github/lib/add_star.var.gql.g.dart @@ -16,9 +16,9 @@ class _$GAddStarVarsSerializer implements StructuredSerializer { final String wireName = 'GAddStarVars'; @override - Iterable serialize(Serializers serializers, GAddStarVars object, + Iterable serialize(Serializers serializers, GAddStarVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'starrableId', serializers.serialize(object.starrableId, specifiedType: const FullType(String)), @@ -28,7 +28,8 @@ class _$GAddStarVarsSerializer implements StructuredSerializer { } @override - GAddStarVars deserialize(Serializers serializers, Iterable serialized, + GAddStarVars deserialize( + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddStarVarsBuilder(); @@ -36,7 +37,7 @@ class _$GAddStarVarsSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'starrableId': result.starrableId = serializers.deserialize(value, @@ -53,13 +54,12 @@ class _$GAddStarVars extends GAddStarVars { @override final String starrableId; - factory _$GAddStarVars([void Function(GAddStarVarsBuilder) updates]) => + factory _$GAddStarVars([void Function(GAddStarVarsBuilder)? updates]) => (new GAddStarVarsBuilder()..update(updates)).build(); - _$GAddStarVars._({this.starrableId}) : super._() { - if (starrableId == null) { - throw new BuiltValueNullFieldError('GAddStarVars', 'starrableId'); - } + _$GAddStarVars._({required this.starrableId}) : super._() { + BuiltValueNullFieldError.checkNotNull( + starrableId, 'GAddStarVars', 'starrableId'); } @override @@ -90,17 +90,18 @@ class _$GAddStarVars extends GAddStarVars { class GAddStarVarsBuilder implements Builder { - _$GAddStarVars _$v; + _$GAddStarVars? _$v; - String _starrableId; - String get starrableId => _$this._starrableId; - set starrableId(String starrableId) => _$this._starrableId = starrableId; + String? _starrableId; + String? get starrableId => _$this._starrableId; + set starrableId(String? starrableId) => _$this._starrableId = starrableId; GAddStarVarsBuilder(); GAddStarVarsBuilder get _$this { - if (_$v != null) { - _starrableId = _$v.starrableId; + final $v = _$v; + if ($v != null) { + _starrableId = $v.starrableId; _$v = null; } return this; @@ -108,20 +109,21 @@ class GAddStarVarsBuilder @override void replace(GAddStarVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddStarVars; } @override - void update(void Function(GAddStarVarsBuilder) updates) { + void update(void Function(GAddStarVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GAddStarVars build() { - final _$result = _$v ?? new _$GAddStarVars._(starrableId: starrableId); + final _$result = _$v ?? + new _$GAddStarVars._( + starrableId: BuiltValueNullFieldError.checkNotNull( + starrableId, 'GAddStarVars', 'starrableId')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli_github/lib/read_repos.data.gql.dart b/examples/gql_example_cli_github/lib/read_repos.data.gql.dart index 427ee5a20..fb662cb9d 100644 --- a/examples/gql_example_cli_github/lib/read_repos.data.gql.dart +++ b/examples/gql_example_cli_github/lib/read_repos.data.gql.dart @@ -24,8 +24,9 @@ abstract class GReadRepositoriesData static Serializer get serializer => _$gReadRepositoriesDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GReadRepositoriesData.serializer, this); - static GReadRepositoriesData fromJson(Map json) => + (_i1.serializers.serializeWith(GReadRepositoriesData.serializer, this) + as Map); + static GReadRepositoriesData? fromJson(Map json) => _i1.serializers.deserializeWith(GReadRepositoriesData.serializer, json); } @@ -46,9 +47,9 @@ abstract class GReadRepositoriesData_viewer GReadRepositoriesData_viewer_repositories get repositories; static Serializer get serializer => _$gReadRepositoriesDataViewerSerializer; - Map toJson() => _i1.serializers - .serializeWith(GReadRepositoriesData_viewer.serializer, this); - static GReadRepositoriesData_viewer fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GReadRepositoriesData_viewer.serializer, this) as Map); + static GReadRepositoriesData_viewer? fromJson(Map json) => _i1.serializers .deserializeWith(GReadRepositoriesData_viewer.serializer, json); } @@ -68,13 +69,13 @@ abstract class GReadRepositoriesData_viewer_repositories b..G__typename = 'RepositoryConnection'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - BuiltList get nodes; + BuiltList? get nodes; static Serializer get serializer => _$gReadRepositoriesDataViewerRepositoriesSerializer; - Map toJson() => _i1.serializers.serializeWith( - GReadRepositoriesData_viewer_repositories.serializer, this); - static GReadRepositoriesData_viewer_repositories fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GReadRepositoriesData_viewer_repositories.serializer, this) + as Map); + static GReadRepositoriesData_viewer_repositories? fromJson( Map json) => _i1.serializers.deserializeWith( GReadRepositoriesData_viewer_repositories.serializer, json); @@ -102,9 +103,10 @@ abstract class GReadRepositoriesData_viewer_repositories_nodes static Serializer get serializer => _$gReadRepositoriesDataViewerRepositoriesNodesSerializer; - Map toJson() => _i1.serializers.serializeWith( - GReadRepositoriesData_viewer_repositories_nodes.serializer, this); - static GReadRepositoriesData_viewer_repositories_nodes fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GReadRepositoriesData_viewer_repositories_nodes.serializer, this) + as Map); + static GReadRepositoriesData_viewer_repositories_nodes? fromJson( Map json) => _i1.serializers.deserializeWith( GReadRepositoriesData_viewer_repositories_nodes.serializer, json); diff --git a/examples/gql_example_cli_github/lib/read_repos.data.gql.g.dart b/examples/gql_example_cli_github/lib/read_repos.data.gql.g.dart index d82b4a161..e72a2a500 100644 --- a/examples/gql_example_cli_github/lib/read_repos.data.gql.g.dart +++ b/examples/gql_example_cli_github/lib/read_repos.data.gql.g.dart @@ -29,10 +29,10 @@ class _$GReadRepositoriesDataSerializer final String wireName = 'GReadRepositoriesData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReadRepositoriesData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -46,7 +46,7 @@ class _$GReadRepositoriesDataSerializer @override GReadRepositoriesData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReadRepositoriesDataBuilder(); @@ -54,7 +54,7 @@ class _$GReadRepositoriesDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -62,7 +62,7 @@ class _$GReadRepositoriesDataSerializer break; case 'viewer': result.viewer.replace(serializers.deserialize(value, - specifiedType: const FullType(GReadRepositoriesData_viewer)) + specifiedType: const FullType(GReadRepositoriesData_viewer))! as GReadRepositoriesData_viewer); break; } @@ -83,10 +83,10 @@ class _$GReadRepositoriesData_viewerSerializer final String wireName = 'GReadRepositoriesData_viewer'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReadRepositoriesData_viewer object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -101,7 +101,7 @@ class _$GReadRepositoriesData_viewerSerializer @override GReadRepositoriesData_viewer deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReadRepositoriesData_viewerBuilder(); @@ -109,7 +109,7 @@ class _$GReadRepositoriesData_viewerSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -117,8 +117,8 @@ class _$GReadRepositoriesData_viewerSerializer break; case 'repositories': result.repositories.replace(serializers.deserialize(value, - specifiedType: - const FullType(GReadRepositoriesData_viewer_repositories)) + specifiedType: const FullType( + GReadRepositoriesData_viewer_repositories))! as GReadRepositoriesData_viewer_repositories); break; } @@ -139,18 +139,20 @@ class _$GReadRepositoriesData_viewer_repositoriesSerializer final String wireName = 'GReadRepositoriesData_viewer_repositories'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReadRepositoriesData_viewer_repositories object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.nodes != null) { + Object? value; + value = object.nodes; + if (value != null) { result ..add('nodes') - ..add(serializers.serialize(object.nodes, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GReadRepositoriesData_viewer_repositories_nodes) ]))); @@ -160,7 +162,7 @@ class _$GReadRepositoriesData_viewer_repositoriesSerializer @override GReadRepositoriesData_viewer_repositories deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReadRepositoriesData_viewer_repositoriesBuilder(); @@ -168,7 +170,7 @@ class _$GReadRepositoriesData_viewer_repositoriesSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -178,7 +180,7 @@ class _$GReadRepositoriesData_viewer_repositoriesSerializer result.nodes.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GReadRepositoriesData_viewer_repositories_nodes) - ])) as BuiltList); + ]))! as BuiltList); break; } } @@ -199,10 +201,10 @@ class _$GReadRepositoriesData_viewer_repositories_nodesSerializer final String wireName = 'GReadRepositoriesData_viewer_repositories_nodes'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GReadRepositoriesData_viewer_repositories_nodes object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -223,7 +225,7 @@ class _$GReadRepositoriesData_viewer_repositories_nodesSerializer @override GReadRepositoriesData_viewer_repositories_nodes deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReadRepositoriesData_viewer_repositories_nodesBuilder(); @@ -231,7 +233,7 @@ class _$GReadRepositoriesData_viewer_repositories_nodesSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -251,7 +253,7 @@ class _$GReadRepositoriesData_viewer_repositories_nodesSerializer break; case 'createdAt': result.createdAt.replace(serializers.deserialize(value, - specifiedType: const FullType(_i2.GDateTime)) as _i2.GDateTime); + specifiedType: const FullType(_i2.GDateTime))! as _i2.GDateTime); break; } } @@ -267,17 +269,15 @@ class _$GReadRepositoriesData extends GReadRepositoriesData { final GReadRepositoriesData_viewer viewer; factory _$GReadRepositoriesData( - [void Function(GReadRepositoriesDataBuilder) updates]) => + [void Function(GReadRepositoriesDataBuilder)? updates]) => (new GReadRepositoriesDataBuilder()..update(updates)).build(); - _$GReadRepositoriesData._({this.G__typename, this.viewer}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData', 'G__typename'); - } - if (viewer == null) { - throw new BuiltValueNullFieldError('GReadRepositoriesData', 'viewer'); - } + _$GReadRepositoriesData._({required this.G__typename, required this.viewer}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReadRepositoriesData', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + viewer, 'GReadRepositoriesData', 'viewer'); } @override @@ -313,16 +313,16 @@ class _$GReadRepositoriesData extends GReadRepositoriesData { class GReadRepositoriesDataBuilder implements Builder { - _$GReadRepositoriesData _$v; + _$GReadRepositoriesData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GReadRepositoriesData_viewerBuilder _viewer; + GReadRepositoriesData_viewerBuilder? _viewer; GReadRepositoriesData_viewerBuilder get viewer => _$this._viewer ??= new GReadRepositoriesData_viewerBuilder(); - set viewer(GReadRepositoriesData_viewerBuilder viewer) => + set viewer(GReadRepositoriesData_viewerBuilder? viewer) => _$this._viewer = viewer; GReadRepositoriesDataBuilder() { @@ -330,9 +330,10 @@ class GReadRepositoriesDataBuilder } GReadRepositoriesDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _viewer = _$v.viewer?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _viewer = $v.viewer.toBuilder(); _$v = null; } return this; @@ -340,14 +341,12 @@ class GReadRepositoriesDataBuilder @override void replace(GReadRepositoriesData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReadRepositoriesData; } @override - void update(void Function(GReadRepositoriesDataBuilder) updates) { + void update(void Function(GReadRepositoriesDataBuilder)? updates) { if (updates != null) updates(this); } @@ -357,9 +356,11 @@ class GReadRepositoriesDataBuilder try { _$result = _$v ?? new _$GReadRepositoriesData._( - G__typename: G__typename, viewer: viewer.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReadRepositoriesData', 'G__typename'), + viewer: viewer.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'viewer'; viewer.build(); @@ -381,19 +382,16 @@ class _$GReadRepositoriesData_viewer extends GReadRepositoriesData_viewer { final GReadRepositoriesData_viewer_repositories repositories; factory _$GReadRepositoriesData_viewer( - [void Function(GReadRepositoriesData_viewerBuilder) updates]) => + [void Function(GReadRepositoriesData_viewerBuilder)? updates]) => (new GReadRepositoriesData_viewerBuilder()..update(updates)).build(); - _$GReadRepositoriesData_viewer._({this.G__typename, this.repositories}) + _$GReadRepositoriesData_viewer._( + {required this.G__typename, required this.repositories}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer', 'G__typename'); - } - if (repositories == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer', 'repositories'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReadRepositoriesData_viewer', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + repositories, 'GReadRepositoriesData_viewer', 'repositories'); } @override @@ -431,18 +429,18 @@ class GReadRepositoriesData_viewerBuilder implements Builder { - _$GReadRepositoriesData_viewer _$v; + _$GReadRepositoriesData_viewer? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GReadRepositoriesData_viewer_repositoriesBuilder _repositories; + GReadRepositoriesData_viewer_repositoriesBuilder? _repositories; GReadRepositoriesData_viewer_repositoriesBuilder get repositories => _$this._repositories ??= new GReadRepositoriesData_viewer_repositoriesBuilder(); set repositories( - GReadRepositoriesData_viewer_repositoriesBuilder repositories) => + GReadRepositoriesData_viewer_repositoriesBuilder? repositories) => _$this._repositories = repositories; GReadRepositoriesData_viewerBuilder() { @@ -450,9 +448,10 @@ class GReadRepositoriesData_viewerBuilder } GReadRepositoriesData_viewerBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _repositories = _$v.repositories?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _repositories = $v.repositories.toBuilder(); _$v = null; } return this; @@ -460,14 +459,12 @@ class GReadRepositoriesData_viewerBuilder @override void replace(GReadRepositoriesData_viewer other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReadRepositoriesData_viewer; } @override - void update(void Function(GReadRepositoriesData_viewerBuilder) updates) { + void update(void Function(GReadRepositoriesData_viewerBuilder)? updates) { if (updates != null) updates(this); } @@ -477,9 +474,11 @@ class GReadRepositoriesData_viewerBuilder try { _$result = _$v ?? new _$GReadRepositoriesData_viewer._( - G__typename: G__typename, repositories: repositories.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GReadRepositoriesData_viewer', 'G__typename'), + repositories: repositories.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'repositories'; repositories.build(); @@ -499,20 +498,19 @@ class _$GReadRepositoriesData_viewer_repositories @override final String G__typename; @override - final BuiltList nodes; + final BuiltList? nodes; factory _$GReadRepositoriesData_viewer_repositories( - [void Function(GReadRepositoriesData_viewer_repositoriesBuilder) + [void Function(GReadRepositoriesData_viewer_repositoriesBuilder)? updates]) => (new GReadRepositoriesData_viewer_repositoriesBuilder()..update(updates)) .build(); - _$GReadRepositoriesData_viewer_repositories._({this.G__typename, this.nodes}) + _$GReadRepositoriesData_viewer_repositories._( + {required this.G__typename, this.nodes}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer_repositories', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GReadRepositoriesData_viewer_repositories', 'G__typename'); } @override @@ -552,18 +550,19 @@ class GReadRepositoriesData_viewer_repositoriesBuilder implements Builder { - _$GReadRepositoriesData_viewer_repositories _$v; + _$GReadRepositoriesData_viewer_repositories? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - ListBuilder _nodes; + ListBuilder? _nodes; ListBuilder get nodes => _$this._nodes ??= new ListBuilder(); set nodes( - ListBuilder nodes) => + ListBuilder? + nodes) => _$this._nodes = nodes; GReadRepositoriesData_viewer_repositoriesBuilder() { @@ -571,9 +570,10 @@ class GReadRepositoriesData_viewer_repositoriesBuilder } GReadRepositoriesData_viewer_repositoriesBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _nodes = _$v.nodes?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _nodes = $v.nodes?.toBuilder(); _$v = null; } return this; @@ -581,15 +581,14 @@ class GReadRepositoriesData_viewer_repositoriesBuilder @override void replace(GReadRepositoriesData_viewer_repositories other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReadRepositoriesData_viewer_repositories; } @override void update( - void Function(GReadRepositoriesData_viewer_repositoriesBuilder) updates) { + void Function(GReadRepositoriesData_viewer_repositoriesBuilder)? + updates) { if (updates != null) updates(this); } @@ -599,9 +598,11 @@ class GReadRepositoriesData_viewer_repositoriesBuilder try { _$result = _$v ?? new _$GReadRepositoriesData_viewer_repositories._( - G__typename: G__typename, nodes: _nodes?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GReadRepositoriesData_viewer_repositories', 'G__typename'), + nodes: _nodes?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'nodes'; _nodes?.build(); @@ -632,40 +633,30 @@ class _$GReadRepositoriesData_viewer_repositories_nodes final _i2.GDateTime createdAt; factory _$GReadRepositoriesData_viewer_repositories_nodes( - [void Function(GReadRepositoriesData_viewer_repositories_nodesBuilder) + [void Function( + GReadRepositoriesData_viewer_repositories_nodesBuilder)? updates]) => (new GReadRepositoriesData_viewer_repositories_nodesBuilder() ..update(updates)) .build(); _$GReadRepositoriesData_viewer_repositories_nodes._( - {this.G__typename, - this.id, - this.name, - this.viewerHasStarred, - this.createdAt}) + {required this.G__typename, + required this.id, + required this.name, + required this.viewerHasStarred, + required this.createdAt}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer_repositories_nodes', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer_repositories_nodes', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer_repositories_nodes', 'name'); - } - if (viewerHasStarred == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer_repositories_nodes', - 'viewerHasStarred'); - } - if (createdAt == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesData_viewer_repositories_nodes', 'createdAt'); - } + BuiltValueNullFieldError.checkNotNull(G__typename, + 'GReadRepositoriesData_viewer_repositories_nodes', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, 'GReadRepositoriesData_viewer_repositories_nodes', 'id'); + BuiltValueNullFieldError.checkNotNull( + name, 'GReadRepositoriesData_viewer_repositories_nodes', 'name'); + BuiltValueNullFieldError.checkNotNull(viewerHasStarred, + 'GReadRepositoriesData_viewer_repositories_nodes', 'viewerHasStarred'); + BuiltValueNullFieldError.checkNotNull(createdAt, + 'GReadRepositoriesData_viewer_repositories_nodes', 'createdAt'); } @override @@ -715,29 +706,29 @@ class GReadRepositoriesData_viewer_repositories_nodesBuilder implements Builder { - _$GReadRepositoriesData_viewer_repositories_nodes _$v; + _$GReadRepositoriesData_viewer_repositories_nodes? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - bool _viewerHasStarred; - bool get viewerHasStarred => _$this._viewerHasStarred; - set viewerHasStarred(bool viewerHasStarred) => + bool? _viewerHasStarred; + bool? get viewerHasStarred => _$this._viewerHasStarred; + set viewerHasStarred(bool? viewerHasStarred) => _$this._viewerHasStarred = viewerHasStarred; - _i2.GDateTimeBuilder _createdAt; + _i2.GDateTimeBuilder? _createdAt; _i2.GDateTimeBuilder get createdAt => _$this._createdAt ??= new _i2.GDateTimeBuilder(); - set createdAt(_i2.GDateTimeBuilder createdAt) => + set createdAt(_i2.GDateTimeBuilder? createdAt) => _$this._createdAt = createdAt; GReadRepositoriesData_viewer_repositories_nodesBuilder() { @@ -745,12 +736,13 @@ class GReadRepositoriesData_viewer_repositories_nodesBuilder } GReadRepositoriesData_viewer_repositories_nodesBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _viewerHasStarred = _$v.viewerHasStarred; - _createdAt = _$v.createdAt?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _viewerHasStarred = $v.viewerHasStarred; + _createdAt = $v.createdAt.toBuilder(); _$v = null; } return this; @@ -758,15 +750,13 @@ class GReadRepositoriesData_viewer_repositories_nodesBuilder @override void replace(GReadRepositoriesData_viewer_repositories_nodes other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReadRepositoriesData_viewer_repositories_nodes; } @override void update( - void Function(GReadRepositoriesData_viewer_repositories_nodesBuilder) + void Function(GReadRepositoriesData_viewer_repositories_nodesBuilder)? updates) { if (updates != null) updates(this); } @@ -777,13 +767,21 @@ class GReadRepositoriesData_viewer_repositories_nodesBuilder try { _$result = _$v ?? new _$GReadRepositoriesData_viewer_repositories_nodes._( - G__typename: G__typename, - id: id, - name: name, - viewerHasStarred: viewerHasStarred, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, + 'GReadRepositoriesData_viewer_repositories_nodes', + 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GReadRepositoriesData_viewer_repositories_nodes', 'id'), + name: BuiltValueNullFieldError.checkNotNull(name, + 'GReadRepositoriesData_viewer_repositories_nodes', 'name'), + viewerHasStarred: BuiltValueNullFieldError.checkNotNull( + viewerHasStarred, + 'GReadRepositoriesData_viewer_repositories_nodes', + 'viewerHasStarred'), createdAt: createdAt.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'createdAt'; createdAt.build(); diff --git a/examples/gql_example_cli_github/lib/read_repos.req.gql.dart b/examples/gql_example_cli_github/lib/read_repos.req.gql.dart index cb76d84e0..18a128495 100644 --- a/examples/gql_example_cli_github/lib/read_repos.req.gql.dart +++ b/examples/gql_example_cli_github/lib/read_repos.req.gql.dart @@ -24,7 +24,8 @@ abstract class GReadRepositories static Serializer get serializer => _$gReadRepositoriesSerializer; Map toJson() => - _i4.serializers.serializeWith(GReadRepositories.serializer, this); - static GReadRepositories fromJson(Map json) => + (_i4.serializers.serializeWith(GReadRepositories.serializer, this) + as Map); + static GReadRepositories? fromJson(Map json) => _i4.serializers.deserializeWith(GReadRepositories.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/read_repos.req.gql.g.dart b/examples/gql_example_cli_github/lib/read_repos.req.gql.g.dart index f7cae7dd7..2a3f32a07 100644 --- a/examples/gql_example_cli_github/lib/read_repos.req.gql.g.dart +++ b/examples/gql_example_cli_github/lib/read_repos.req.gql.g.dart @@ -17,9 +17,9 @@ class _$GReadRepositoriesSerializer final String wireName = 'GReadRepositories'; @override - Iterable serialize(Serializers serializers, GReadRepositories object, + Iterable serialize(Serializers serializers, GReadRepositories object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GReadRepositoriesVars)), @@ -33,7 +33,7 @@ class _$GReadRepositoriesSerializer @override GReadRepositories deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReadRepositoriesBuilder(); @@ -41,11 +41,11 @@ class _$GReadRepositoriesSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GReadRepositoriesVars)) + specifiedType: const FullType(_i3.GReadRepositoriesVars))! as _i3.GReadRepositoriesVars); break; case 'operation': @@ -66,16 +66,14 @@ class _$GReadRepositories extends GReadRepositories { final _i1.Operation operation; factory _$GReadRepositories( - [void Function(GReadRepositoriesBuilder) updates]) => + [void Function(GReadRepositoriesBuilder)? updates]) => (new GReadRepositoriesBuilder()..update(updates)).build(); - _$GReadRepositories._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GReadRepositories', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GReadRepositories', 'operation'); - } + _$GReadRepositories._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GReadRepositories', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GReadRepositories', 'operation'); } @override @@ -110,25 +108,26 @@ class _$GReadRepositories extends GReadRepositories { class GReadRepositoriesBuilder implements Builder { - _$GReadRepositories _$v; + _$GReadRepositories? _$v; - _i3.GReadRepositoriesVarsBuilder _vars; + _i3.GReadRepositoriesVarsBuilder? _vars; _i3.GReadRepositoriesVarsBuilder get vars => _$this._vars ??= new _i3.GReadRepositoriesVarsBuilder(); - set vars(_i3.GReadRepositoriesVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GReadRepositoriesVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GReadRepositoriesBuilder() { GReadRepositories._initializeBuilder(this); } GReadRepositoriesBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -136,14 +135,12 @@ class GReadRepositoriesBuilder @override void replace(GReadRepositories other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReadRepositories; } @override - void update(void Function(GReadRepositoriesBuilder) updates) { + void update(void Function(GReadRepositoriesBuilder)? updates) { if (updates != null) updates(this); } @@ -152,9 +149,12 @@ class GReadRepositoriesBuilder _$GReadRepositories _$result; try { _$result = _$v ?? - new _$GReadRepositories._(vars: vars.build(), operation: operation); + new _$GReadRepositories._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GReadRepositories', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_cli_github/lib/read_repos.var.gql.dart b/examples/gql_example_cli_github/lib/read_repos.var.gql.dart index 4fc155031..1736e6f1b 100644 --- a/examples/gql_example_cli_github/lib/read_repos.var.gql.dart +++ b/examples/gql_example_cli_github/lib/read_repos.var.gql.dart @@ -18,7 +18,8 @@ abstract class GReadRepositoriesVars static Serializer get serializer => _$gReadRepositoriesVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GReadRepositoriesVars.serializer, this); - static GReadRepositoriesVars fromJson(Map json) => + (_i1.serializers.serializeWith(GReadRepositoriesVars.serializer, this) + as Map); + static GReadRepositoriesVars? fromJson(Map json) => _i1.serializers.deserializeWith(GReadRepositoriesVars.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/read_repos.var.gql.g.dart b/examples/gql_example_cli_github/lib/read_repos.var.gql.g.dart index b56bef8fa..0c912ce67 100644 --- a/examples/gql_example_cli_github/lib/read_repos.var.gql.g.dart +++ b/examples/gql_example_cli_github/lib/read_repos.var.gql.g.dart @@ -20,10 +20,10 @@ class _$GReadRepositoriesVarsSerializer final String wireName = 'GReadRepositoriesVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReadRepositoriesVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'nRepositories', serializers.serialize(object.nRepositories, specifiedType: const FullType(int)), @@ -34,7 +34,7 @@ class _$GReadRepositoriesVarsSerializer @override GReadRepositoriesVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReadRepositoriesVarsBuilder(); @@ -42,7 +42,7 @@ class _$GReadRepositoriesVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'nRepositories': result.nRepositories = serializers.deserialize(value, @@ -60,14 +60,12 @@ class _$GReadRepositoriesVars extends GReadRepositoriesVars { final int nRepositories; factory _$GReadRepositoriesVars( - [void Function(GReadRepositoriesVarsBuilder) updates]) => + [void Function(GReadRepositoriesVarsBuilder)? updates]) => (new GReadRepositoriesVarsBuilder()..update(updates)).build(); - _$GReadRepositoriesVars._({this.nRepositories}) : super._() { - if (nRepositories == null) { - throw new BuiltValueNullFieldError( - 'GReadRepositoriesVars', 'nRepositories'); - } + _$GReadRepositoriesVars._({required this.nRepositories}) : super._() { + BuiltValueNullFieldError.checkNotNull( + nRepositories, 'GReadRepositoriesVars', 'nRepositories'); } @override @@ -101,17 +99,19 @@ class _$GReadRepositoriesVars extends GReadRepositoriesVars { class GReadRepositoriesVarsBuilder implements Builder { - _$GReadRepositoriesVars _$v; + _$GReadRepositoriesVars? _$v; - int _nRepositories; - int get nRepositories => _$this._nRepositories; - set nRepositories(int nRepositories) => _$this._nRepositories = nRepositories; + int? _nRepositories; + int? get nRepositories => _$this._nRepositories; + set nRepositories(int? nRepositories) => + _$this._nRepositories = nRepositories; GReadRepositoriesVarsBuilder(); GReadRepositoriesVarsBuilder get _$this { - if (_$v != null) { - _nRepositories = _$v.nRepositories; + final $v = _$v; + if ($v != null) { + _nRepositories = $v.nRepositories; _$v = null; } return this; @@ -119,21 +119,21 @@ class GReadRepositoriesVarsBuilder @override void replace(GReadRepositoriesVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReadRepositoriesVars; } @override - void update(void Function(GReadRepositoriesVarsBuilder) updates) { + void update(void Function(GReadRepositoriesVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GReadRepositoriesVars build() { - final _$result = - _$v ?? new _$GReadRepositoriesVars._(nRepositories: nRepositories); + final _$result = _$v ?? + new _$GReadRepositoriesVars._( + nRepositories: BuiltValueNullFieldError.checkNotNull( + nRepositories, 'GReadRepositoriesVars', 'nRepositories')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli_github/lib/remove_star.data.gql.dart b/examples/gql_example_cli_github/lib/remove_star.data.gql.dart index 17ad20a03..de6acf6f5 100644 --- a/examples/gql_example_cli_github/lib/remove_star.data.gql.dart +++ b/examples/gql_example_cli_github/lib/remove_star.data.gql.dart @@ -17,13 +17,13 @@ abstract class GRemoveStarData b..G__typename = 'Mutation'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GRemoveStarData_action get action; + GRemoveStarData_action? get action; static Serializer get serializer => _$gRemoveStarDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GRemoveStarData.serializer, this); - static GRemoveStarData fromJson(Map json) => + (_i1.serializers.serializeWith(GRemoveStarData.serializer, this) + as Map); + static GRemoveStarData? fromJson(Map json) => _i1.serializers.deserializeWith(GRemoveStarData.serializer, json); } @@ -39,13 +39,13 @@ abstract class GRemoveStarData_action b..G__typename = 'RemoveStarPayload'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GRemoveStarData_action_starrable get starrable; + GRemoveStarData_action_starrable? get starrable; static Serializer get serializer => _$gRemoveStarDataActionSerializer; Map toJson() => - _i1.serializers.serializeWith(GRemoveStarData_action.serializer, this); - static GRemoveStarData_action fromJson(Map json) => + (_i1.serializers.serializeWith(GRemoveStarData_action.serializer, this) + as Map); + static GRemoveStarData_action? fromJson(Map json) => _i1.serializers.deserializeWith(GRemoveStarData_action.serializer, json); } @@ -66,9 +66,11 @@ abstract class GRemoveStarData_action_starrable bool get viewerHasStarred; static Serializer get serializer => _$gRemoveStarDataActionStarrableSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRemoveStarData_action_starrable.serializer, this); - static GRemoveStarData_action_starrable fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GRemoveStarData_action_starrable.serializer, this) + as Map); + static GRemoveStarData_action_starrable? fromJson( + Map json) => _i1.serializers .deserializeWith(GRemoveStarData_action_starrable.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/remove_star.data.gql.g.dart b/examples/gql_example_cli_github/lib/remove_star.data.gql.g.dart index 00f721f5d..47e4ed3ff 100644 --- a/examples/gql_example_cli_github/lib/remove_star.data.gql.g.dart +++ b/examples/gql_example_cli_github/lib/remove_star.data.gql.g.dart @@ -22,17 +22,19 @@ class _$GRemoveStarDataSerializer final String wireName = 'GRemoveStarData'; @override - Iterable serialize(Serializers serializers, GRemoveStarData object, + Iterable serialize(Serializers serializers, GRemoveStarData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.action != null) { + Object? value; + value = object.action; + if (value != null) { result ..add('action') - ..add(serializers.serialize(object.action, + ..add(serializers.serialize(value, specifiedType: const FullType(GRemoveStarData_action))); } return result; @@ -40,7 +42,7 @@ class _$GRemoveStarDataSerializer @override GRemoveStarData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveStarDataBuilder(); @@ -48,7 +50,7 @@ class _$GRemoveStarDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -56,7 +58,7 @@ class _$GRemoveStarDataSerializer break; case 'action': result.action.replace(serializers.deserialize(value, - specifiedType: const FullType(GRemoveStarData_action)) + specifiedType: const FullType(GRemoveStarData_action))! as GRemoveStarData_action); break; } @@ -77,18 +79,20 @@ class _$GRemoveStarData_actionSerializer final String wireName = 'GRemoveStarData_action'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveStarData_action object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.starrable != null) { + Object? value; + value = object.starrable; + if (value != null) { result ..add('starrable') - ..add(serializers.serialize(object.starrable, + ..add(serializers.serialize(value, specifiedType: const FullType(GRemoveStarData_action_starrable))); } return result; @@ -96,7 +100,7 @@ class _$GRemoveStarData_actionSerializer @override GRemoveStarData_action deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveStarData_actionBuilder(); @@ -104,7 +108,7 @@ class _$GRemoveStarData_actionSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -113,7 +117,7 @@ class _$GRemoveStarData_actionSerializer case 'starrable': result.starrable.replace(serializers.deserialize(value, specifiedType: - const FullType(GRemoveStarData_action_starrable)) + const FullType(GRemoveStarData_action_starrable))! as GRemoveStarData_action_starrable); break; } @@ -134,10 +138,10 @@ class _$GRemoveStarData_action_starrableSerializer final String wireName = 'GRemoveStarData_action_starrable'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveStarData_action_starrable object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), @@ -151,7 +155,7 @@ class _$GRemoveStarData_action_starrableSerializer @override GRemoveStarData_action_starrable deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveStarData_action_starrableBuilder(); @@ -159,7 +163,7 @@ class _$GRemoveStarData_action_starrableSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -180,15 +184,14 @@ class _$GRemoveStarData extends GRemoveStarData { @override final String G__typename; @override - final GRemoveStarData_action action; + final GRemoveStarData_action? action; - factory _$GRemoveStarData([void Function(GRemoveStarDataBuilder) updates]) => + factory _$GRemoveStarData([void Function(GRemoveStarDataBuilder)? updates]) => (new GRemoveStarDataBuilder()..update(updates)).build(); - _$GRemoveStarData._({this.G__typename, this.action}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GRemoveStarData', 'G__typename'); - } + _$GRemoveStarData._({required this.G__typename, this.action}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GRemoveStarData', 'G__typename'); } @override @@ -223,25 +226,26 @@ class _$GRemoveStarData extends GRemoveStarData { class GRemoveStarDataBuilder implements Builder { - _$GRemoveStarData _$v; + _$GRemoveStarData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GRemoveStarData_actionBuilder _action; + GRemoveStarData_actionBuilder? _action; GRemoveStarData_actionBuilder get action => _$this._action ??= new GRemoveStarData_actionBuilder(); - set action(GRemoveStarData_actionBuilder action) => _$this._action = action; + set action(GRemoveStarData_actionBuilder? action) => _$this._action = action; GRemoveStarDataBuilder() { GRemoveStarData._initializeBuilder(this); } GRemoveStarDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _action = _$v.action?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _action = $v.action?.toBuilder(); _$v = null; } return this; @@ -249,14 +253,12 @@ class GRemoveStarDataBuilder @override void replace(GRemoveStarData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveStarData; } @override - void update(void Function(GRemoveStarDataBuilder) updates) { + void update(void Function(GRemoveStarDataBuilder)? updates) { if (updates != null) updates(this); } @@ -266,9 +268,11 @@ class GRemoveStarDataBuilder try { _$result = _$v ?? new _$GRemoveStarData._( - G__typename: G__typename, action: _action?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GRemoveStarData', 'G__typename'), + action: _action?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'action'; _action?.build(); @@ -287,17 +291,16 @@ class _$GRemoveStarData_action extends GRemoveStarData_action { @override final String G__typename; @override - final GRemoveStarData_action_starrable starrable; + final GRemoveStarData_action_starrable? starrable; factory _$GRemoveStarData_action( - [void Function(GRemoveStarData_actionBuilder) updates]) => + [void Function(GRemoveStarData_actionBuilder)? updates]) => (new GRemoveStarData_actionBuilder()..update(updates)).build(); - _$GRemoveStarData_action._({this.G__typename, this.starrable}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GRemoveStarData_action', 'G__typename'); - } + _$GRemoveStarData_action._({required this.G__typename, this.starrable}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GRemoveStarData_action', 'G__typename'); } @override @@ -333,16 +336,16 @@ class _$GRemoveStarData_action extends GRemoveStarData_action { class GRemoveStarData_actionBuilder implements Builder { - _$GRemoveStarData_action _$v; + _$GRemoveStarData_action? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GRemoveStarData_action_starrableBuilder _starrable; + GRemoveStarData_action_starrableBuilder? _starrable; GRemoveStarData_action_starrableBuilder get starrable => _$this._starrable ??= new GRemoveStarData_action_starrableBuilder(); - set starrable(GRemoveStarData_action_starrableBuilder starrable) => + set starrable(GRemoveStarData_action_starrableBuilder? starrable) => _$this._starrable = starrable; GRemoveStarData_actionBuilder() { @@ -350,9 +353,10 @@ class GRemoveStarData_actionBuilder } GRemoveStarData_actionBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _starrable = _$v.starrable?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _starrable = $v.starrable?.toBuilder(); _$v = null; } return this; @@ -360,14 +364,12 @@ class GRemoveStarData_actionBuilder @override void replace(GRemoveStarData_action other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveStarData_action; } @override - void update(void Function(GRemoveStarData_actionBuilder) updates) { + void update(void Function(GRemoveStarData_actionBuilder)? updates) { if (updates != null) updates(this); } @@ -377,9 +379,11 @@ class GRemoveStarData_actionBuilder try { _$result = _$v ?? new _$GRemoveStarData_action._( - G__typename: G__typename, starrable: _starrable?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GRemoveStarData_action', 'G__typename'), + starrable: _starrable?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'starrable'; _starrable?.build(); @@ -402,20 +406,16 @@ class _$GRemoveStarData_action_starrable final bool viewerHasStarred; factory _$GRemoveStarData_action_starrable( - [void Function(GRemoveStarData_action_starrableBuilder) updates]) => + [void Function(GRemoveStarData_action_starrableBuilder)? updates]) => (new GRemoveStarData_action_starrableBuilder()..update(updates)).build(); _$GRemoveStarData_action_starrable._( - {this.G__typename, this.viewerHasStarred}) + {required this.G__typename, required this.viewerHasStarred}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GRemoveStarData_action_starrable', 'G__typename'); - } - if (viewerHasStarred == null) { - throw new BuiltValueNullFieldError( - 'GRemoveStarData_action_starrable', 'viewerHasStarred'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GRemoveStarData_action_starrable', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(viewerHasStarred, + 'GRemoveStarData_action_starrable', 'viewerHasStarred'); } @override @@ -453,15 +453,15 @@ class GRemoveStarData_action_starrableBuilder implements Builder { - _$GRemoveStarData_action_starrable _$v; + _$GRemoveStarData_action_starrable? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - bool _viewerHasStarred; - bool get viewerHasStarred => _$this._viewerHasStarred; - set viewerHasStarred(bool viewerHasStarred) => + bool? _viewerHasStarred; + bool? get viewerHasStarred => _$this._viewerHasStarred; + set viewerHasStarred(bool? viewerHasStarred) => _$this._viewerHasStarred = viewerHasStarred; GRemoveStarData_action_starrableBuilder() { @@ -469,9 +469,10 @@ class GRemoveStarData_action_starrableBuilder } GRemoveStarData_action_starrableBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _viewerHasStarred = _$v.viewerHasStarred; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _viewerHasStarred = $v.viewerHasStarred; _$v = null; } return this; @@ -479,14 +480,12 @@ class GRemoveStarData_action_starrableBuilder @override void replace(GRemoveStarData_action_starrable other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveStarData_action_starrable; } @override - void update(void Function(GRemoveStarData_action_starrableBuilder) updates) { + void update(void Function(GRemoveStarData_action_starrableBuilder)? updates) { if (updates != null) updates(this); } @@ -494,7 +493,12 @@ class GRemoveStarData_action_starrableBuilder _$GRemoveStarData_action_starrable build() { final _$result = _$v ?? new _$GRemoveStarData_action_starrable._( - G__typename: G__typename, viewerHasStarred: viewerHasStarred); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GRemoveStarData_action_starrable', 'G__typename'), + viewerHasStarred: BuiltValueNullFieldError.checkNotNull( + viewerHasStarred, + 'GRemoveStarData_action_starrable', + 'viewerHasStarred')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli_github/lib/remove_star.req.gql.dart b/examples/gql_example_cli_github/lib/remove_star.req.gql.dart index 88747d275..9f532da8d 100644 --- a/examples/gql_example_cli_github/lib/remove_star.req.gql.dart +++ b/examples/gql_example_cli_github/lib/remove_star.req.gql.dart @@ -21,7 +21,8 @@ abstract class GRemoveStar implements Built { _i1.Operation get operation; static Serializer get serializer => _$gRemoveStarSerializer; Map toJson() => - _i4.serializers.serializeWith(GRemoveStar.serializer, this); - static GRemoveStar fromJson(Map json) => + (_i4.serializers.serializeWith(GRemoveStar.serializer, this) + as Map); + static GRemoveStar? fromJson(Map json) => _i4.serializers.deserializeWith(GRemoveStar.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/remove_star.req.gql.g.dart b/examples/gql_example_cli_github/lib/remove_star.req.gql.g.dart index 582fef898..47cb7dfba 100644 --- a/examples/gql_example_cli_github/lib/remove_star.req.gql.g.dart +++ b/examples/gql_example_cli_github/lib/remove_star.req.gql.g.dart @@ -15,9 +15,9 @@ class _$GRemoveStarSerializer implements StructuredSerializer { final String wireName = 'GRemoveStar'; @override - Iterable serialize(Serializers serializers, GRemoveStar object, + Iterable serialize(Serializers serializers, GRemoveStar object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GRemoveStarVars)), @@ -30,7 +30,7 @@ class _$GRemoveStarSerializer implements StructuredSerializer { } @override - GRemoveStar deserialize(Serializers serializers, Iterable serialized, + GRemoveStar deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveStarBuilder(); @@ -38,11 +38,11 @@ class _$GRemoveStarSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GRemoveStarVars)) + specifiedType: const FullType(_i3.GRemoveStarVars))! as _i3.GRemoveStarVars); break; case 'operation': @@ -62,16 +62,13 @@ class _$GRemoveStar extends GRemoveStar { @override final _i1.Operation operation; - factory _$GRemoveStar([void Function(GRemoveStarBuilder) updates]) => + factory _$GRemoveStar([void Function(GRemoveStarBuilder)? updates]) => (new GRemoveStarBuilder()..update(updates)).build(); - _$GRemoveStar._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GRemoveStar', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GRemoveStar', 'operation'); - } + _$GRemoveStar._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GRemoveStar', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GRemoveStar', 'operation'); } @override @@ -104,25 +101,26 @@ class _$GRemoveStar extends GRemoveStar { } class GRemoveStarBuilder implements Builder { - _$GRemoveStar _$v; + _$GRemoveStar? _$v; - _i3.GRemoveStarVarsBuilder _vars; + _i3.GRemoveStarVarsBuilder? _vars; _i3.GRemoveStarVarsBuilder get vars => _$this._vars ??= new _i3.GRemoveStarVarsBuilder(); - set vars(_i3.GRemoveStarVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GRemoveStarVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GRemoveStarBuilder() { GRemoveStar._initializeBuilder(this); } GRemoveStarBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -130,14 +128,12 @@ class GRemoveStarBuilder implements Builder { @override void replace(GRemoveStar other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveStar; } @override - void update(void Function(GRemoveStarBuilder) updates) { + void update(void Function(GRemoveStarBuilder)? updates) { if (updates != null) updates(this); } @@ -145,10 +141,13 @@ class GRemoveStarBuilder implements Builder { _$GRemoveStar build() { _$GRemoveStar _$result; try { - _$result = - _$v ?? new _$GRemoveStar._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GRemoveStar._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GRemoveStar', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_cli_github/lib/remove_star.var.gql.dart b/examples/gql_example_cli_github/lib/remove_star.var.gql.dart index 9d39598dd..c498810de 100644 --- a/examples/gql_example_cli_github/lib/remove_star.var.gql.dart +++ b/examples/gql_example_cli_github/lib/remove_star.var.gql.dart @@ -17,7 +17,8 @@ abstract class GRemoveStarVars static Serializer get serializer => _$gRemoveStarVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GRemoveStarVars.serializer, this); - static GRemoveStarVars fromJson(Map json) => + (_i1.serializers.serializeWith(GRemoveStarVars.serializer, this) + as Map); + static GRemoveStarVars? fromJson(Map json) => _i1.serializers.deserializeWith(GRemoveStarVars.serializer, json); } diff --git a/examples/gql_example_cli_github/lib/remove_star.var.gql.g.dart b/examples/gql_example_cli_github/lib/remove_star.var.gql.g.dart index aef1b5182..bb81d08c3 100644 --- a/examples/gql_example_cli_github/lib/remove_star.var.gql.g.dart +++ b/examples/gql_example_cli_github/lib/remove_star.var.gql.g.dart @@ -17,9 +17,9 @@ class _$GRemoveStarVarsSerializer final String wireName = 'GRemoveStarVars'; @override - Iterable serialize(Serializers serializers, GRemoveStarVars object, + Iterable serialize(Serializers serializers, GRemoveStarVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'starrableId', serializers.serialize(object.starrableId, specifiedType: const FullType(String)), @@ -30,7 +30,7 @@ class _$GRemoveStarVarsSerializer @override GRemoveStarVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveStarVarsBuilder(); @@ -38,7 +38,7 @@ class _$GRemoveStarVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'starrableId': result.starrableId = serializers.deserialize(value, @@ -55,13 +55,12 @@ class _$GRemoveStarVars extends GRemoveStarVars { @override final String starrableId; - factory _$GRemoveStarVars([void Function(GRemoveStarVarsBuilder) updates]) => + factory _$GRemoveStarVars([void Function(GRemoveStarVarsBuilder)? updates]) => (new GRemoveStarVarsBuilder()..update(updates)).build(); - _$GRemoveStarVars._({this.starrableId}) : super._() { - if (starrableId == null) { - throw new BuiltValueNullFieldError('GRemoveStarVars', 'starrableId'); - } + _$GRemoveStarVars._({required this.starrableId}) : super._() { + BuiltValueNullFieldError.checkNotNull( + starrableId, 'GRemoveStarVars', 'starrableId'); } @override @@ -93,17 +92,18 @@ class _$GRemoveStarVars extends GRemoveStarVars { class GRemoveStarVarsBuilder implements Builder { - _$GRemoveStarVars _$v; + _$GRemoveStarVars? _$v; - String _starrableId; - String get starrableId => _$this._starrableId; - set starrableId(String starrableId) => _$this._starrableId = starrableId; + String? _starrableId; + String? get starrableId => _$this._starrableId; + set starrableId(String? starrableId) => _$this._starrableId = starrableId; GRemoveStarVarsBuilder(); GRemoveStarVarsBuilder get _$this { - if (_$v != null) { - _starrableId = _$v.starrableId; + final $v = _$v; + if ($v != null) { + _starrableId = $v.starrableId; _$v = null; } return this; @@ -111,20 +111,21 @@ class GRemoveStarVarsBuilder @override void replace(GRemoveStarVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveStarVars; } @override - void update(void Function(GRemoveStarVarsBuilder) updates) { + void update(void Function(GRemoveStarVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GRemoveStarVars build() { - final _$result = _$v ?? new _$GRemoveStarVars._(starrableId: starrableId); + final _$result = _$v ?? + new _$GRemoveStarVars._( + starrableId: BuiltValueNullFieldError.checkNotNull( + starrableId, 'GRemoveStarVars', 'starrableId')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli_github/lib/schema.schema.gql.dart b/examples/gql_example_cli_github/lib/schema.schema.gql.dart index 4cbd48ace..bc0b43eb6 100644 --- a/examples/gql_example_cli_github/lib/schema.schema.gql.dart +++ b/examples/gql_example_cli_github/lib/schema.schema.gql.dart @@ -19,15 +19,15 @@ abstract class GAcceptEnterpriseAdministratorInvitationInput [Function(GAcceptEnterpriseAdministratorInvitationInputBuilder b) updates]) = _$GAcceptEnterpriseAdministratorInvitationInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get invitationId; static Serializer get serializer => _$gAcceptEnterpriseAdministratorInvitationInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GAcceptEnterpriseAdministratorInvitationInput.serializer, this); - static GAcceptEnterpriseAdministratorInvitationInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GAcceptEnterpriseAdministratorInvitationInput.serializer, this) + as Map); + static GAcceptEnterpriseAdministratorInvitationInput? fromJson( Map json) => _i1.serializers.deserializeWith( GAcceptEnterpriseAdministratorInvitationInput.serializer, json); @@ -42,15 +42,14 @@ abstract class GAcceptTopicSuggestionInput [Function(GAcceptTopicSuggestionInputBuilder b) updates]) = _$GAcceptTopicSuggestionInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get name; String get repositoryId; static Serializer get serializer => _$gAcceptTopicSuggestionInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAcceptTopicSuggestionInput.serializer, this); - static GAcceptTopicSuggestionInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GAcceptTopicSuggestionInput.serializer, this) as Map); + static GAcceptTopicSuggestionInput? fromJson(Map json) => _i1.serializers .deserializeWith(GAcceptTopicSuggestionInput.serializer, json); } @@ -90,13 +89,12 @@ abstract class GAddAssigneesToAssignableInput String get assignableId; BuiltList get assigneeIds; - @nullable - String get clientMutationId; + String? get clientMutationId; static Serializer get serializer => _$gAddAssigneesToAssignableInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAddAssigneesToAssignableInput.serializer, this); - static GAddAssigneesToAssignableInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GAddAssigneesToAssignableInput.serializer, this) as Map); + static GAddAssigneesToAssignableInput? fromJson(Map json) => _i1.serializers .deserializeWith(GAddAssigneesToAssignableInput.serializer, json); } @@ -109,14 +107,14 @@ abstract class GAddCommentInput _$GAddCommentInput; String get body; - @nullable - String get clientMutationId; + String? get clientMutationId; String get subjectId; static Serializer get serializer => _$gAddCommentInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddCommentInput.serializer, this); - static GAddCommentInput fromJson(Map json) => + (_i1.serializers.serializeWith(GAddCommentInput.serializer, this) + as Map); + static GAddCommentInput? fromJson(Map json) => _i1.serializers.deserializeWith(GAddCommentInput.serializer, json); } @@ -129,15 +127,14 @@ abstract class GAddLabelsToLabelableInput [Function(GAddLabelsToLabelableInputBuilder b) updates]) = _$GAddLabelsToLabelableInput; - @nullable - String get clientMutationId; + String? get clientMutationId; BuiltList get labelIds; String get labelableId; static Serializer get serializer => _$gAddLabelsToLabelableInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAddLabelsToLabelableInput.serializer, this); - static GAddLabelsToLabelableInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GAddLabelsToLabelableInput.serializer, this) as Map); + static GAddLabelsToLabelableInput? fromJson(Map json) => _i1.serializers .deserializeWith(GAddLabelsToLabelableInput.serializer, json); } @@ -150,18 +147,16 @@ abstract class GAddProjectCardInput [Function(GAddProjectCardInputBuilder b) updates]) = _$GAddProjectCardInput; - @nullable - String get clientMutationId; - @nullable - String get contentId; - @nullable - String get note; + String? get clientMutationId; + String? get contentId; + String? get note; String get projectColumnId; static Serializer get serializer => _$gAddProjectCardInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddProjectCardInput.serializer, this); - static GAddProjectCardInput fromJson(Map json) => + (_i1.serializers.serializeWith(GAddProjectCardInput.serializer, this) + as Map); + static GAddProjectCardInput? fromJson(Map json) => _i1.serializers.deserializeWith(GAddProjectCardInput.serializer, json); } @@ -173,15 +168,15 @@ abstract class GAddProjectColumnInput [Function(GAddProjectColumnInputBuilder b) updates]) = _$GAddProjectColumnInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get name; String get projectId; static Serializer get serializer => _$gAddProjectColumnInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddProjectColumnInput.serializer, this); - static GAddProjectColumnInput fromJson(Map json) => + (_i1.serializers.serializeWith(GAddProjectColumnInput.serializer, this) + as Map); + static GAddProjectColumnInput? fromJson(Map json) => _i1.serializers.deserializeWith(GAddProjectColumnInput.serializer, json); } @@ -196,25 +191,19 @@ abstract class GAddPullRequestReviewCommentInput _$GAddPullRequestReviewCommentInput; String get body; - @nullable - String get clientMutationId; - @nullable - GGitObjectID get commitOID; - @nullable - String get inReplyTo; - @nullable - String get path; - @nullable - int get position; - @nullable - String get pullRequestId; - @nullable - String get pullRequestReviewId; + String? get clientMutationId; + GGitObjectID? get commitOID; + String? get inReplyTo; + String? get path; + int? get position; + String? get pullRequestId; + String? get pullRequestReviewId; static Serializer get serializer => _$gAddPullRequestReviewCommentInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAddPullRequestReviewCommentInput.serializer, this); - static GAddPullRequestReviewCommentInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GAddPullRequestReviewCommentInput.serializer, this) + as Map); + static GAddPullRequestReviewCommentInput? fromJson( Map json) => _i1.serializers .deserializeWith(GAddPullRequestReviewCommentInput.serializer, json); @@ -229,22 +218,17 @@ abstract class GAddPullRequestReviewInput [Function(GAddPullRequestReviewInputBuilder b) updates]) = _$GAddPullRequestReviewInput; - @nullable - String get body; - @nullable - String get clientMutationId; - @nullable - BuiltList get comments; - @nullable - GGitObjectID get commitOID; - @nullable - GPullRequestReviewEvent get event; + String? get body; + String? get clientMutationId; + BuiltList? get comments; + GGitObjectID? get commitOID; + GPullRequestReviewEvent? get event; String get pullRequestId; static Serializer get serializer => _$gAddPullRequestReviewInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GAddPullRequestReviewInput.serializer, this); - static GAddPullRequestReviewInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GAddPullRequestReviewInput.serializer, this) as Map); + static GAddPullRequestReviewInput? fromJson(Map json) => _i1.serializers .deserializeWith(GAddPullRequestReviewInput.serializer, json); } @@ -256,15 +240,15 @@ abstract class GAddReactionInput factory GAddReactionInput([Function(GAddReactionInputBuilder b) updates]) = _$GAddReactionInput; - @nullable - String get clientMutationId; + String? get clientMutationId; GReactionContent get content; String get subjectId; static Serializer get serializer => _$gAddReactionInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddReactionInput.serializer, this); - static GAddReactionInput fromJson(Map json) => + (_i1.serializers.serializeWith(GAddReactionInput.serializer, this) + as Map); + static GAddReactionInput? fromJson(Map json) => _i1.serializers.deserializeWith(GAddReactionInput.serializer, json); } @@ -275,13 +259,13 @@ abstract class GAddStarInput factory GAddStarInput([Function(GAddStarInputBuilder b) updates]) = _$GAddStarInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get starrableId; static Serializer get serializer => _$gAddStarInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GAddStarInput.serializer, this); - static GAddStarInput fromJson(Map json) => + (_i1.serializers.serializeWith(GAddStarInput.serializer, this) + as Map); + static GAddStarInput? fromJson(Map json) => _i1.serializers.deserializeWith(GAddStarInput.serializer, json); } @@ -293,14 +277,14 @@ abstract class GArchiveRepositoryInput [Function(GArchiveRepositoryInputBuilder b) updates]) = _$GArchiveRepositoryInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get repositoryId; static Serializer get serializer => _$gArchiveRepositoryInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GArchiveRepositoryInput.serializer, this); - static GArchiveRepositoryInput fromJson(Map json) => + (_i1.serializers.serializeWith(GArchiveRepositoryInput.serializer, this) + as Map); + static GArchiveRepositoryInput? fromJson(Map json) => _i1.serializers.deserializeWith(GArchiveRepositoryInput.serializer, json); } @@ -311,15 +295,14 @@ abstract class GAuditLogOrder factory GAuditLogOrder([Function(GAuditLogOrderBuilder b) updates]) = _$GAuditLogOrder; - @nullable - GOrderDirection get direction; - @nullable - GAuditLogOrderField get field; + GOrderDirection? get direction; + GAuditLogOrderField? get field; static Serializer get serializer => _$gAuditLogOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GAuditLogOrder.serializer, this); - static GAuditLogOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GAuditLogOrder.serializer, this) + as Map); + static GAuditLogOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GAuditLogOrder.serializer, json); } @@ -346,14 +329,14 @@ abstract class GCancelEnterpriseAdminInvitationInput [Function(GCancelEnterpriseAdminInvitationInputBuilder b) updates]) = _$GCancelEnterpriseAdminInvitationInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get invitationId; static Serializer get serializer => _$gCancelEnterpriseAdminInvitationInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCancelEnterpriseAdminInvitationInput.serializer, this); - static GCancelEnterpriseAdminInvitationInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GCancelEnterpriseAdminInvitationInput.serializer, this) + as Map); + static GCancelEnterpriseAdminInvitationInput? fromJson( Map json) => _i1.serializers.deserializeWith( GCancelEnterpriseAdminInvitationInput.serializer, json); @@ -367,23 +350,18 @@ abstract class GChangeUserStatusInput [Function(GChangeUserStatusInputBuilder b) updates]) = _$GChangeUserStatusInput; - @nullable - String get clientMutationId; - @nullable - String get emoji; - @nullable - GDateTime get expiresAt; - @nullable - bool get limitedAvailability; - @nullable - String get message; - @nullable - String get organizationId; + String? get clientMutationId; + String? get emoji; + GDateTime? get expiresAt; + bool? get limitedAvailability; + String? get message; + String? get organizationId; static Serializer get serializer => _$gChangeUserStatusInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GChangeUserStatusInput.serializer, this); - static GChangeUserStatusInput fromJson(Map json) => + (_i1.serializers.serializeWith(GChangeUserStatusInput.serializer, this) + as Map); + static GChangeUserStatusInput? fromJson(Map json) => _i1.serializers.deserializeWith(GChangeUserStatusInput.serializer, json); } @@ -397,14 +375,13 @@ abstract class GClearLabelsFromLabelableInput [Function(GClearLabelsFromLabelableInputBuilder b) updates]) = _$GClearLabelsFromLabelableInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get labelableId; static Serializer get serializer => _$gClearLabelsFromLabelableInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GClearLabelsFromLabelableInput.serializer, this); - static GClearLabelsFromLabelableInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GClearLabelsFromLabelableInput.serializer, this) as Map); + static GClearLabelsFromLabelableInput? fromJson(Map json) => _i1.serializers .deserializeWith(GClearLabelsFromLabelableInput.serializer, json); } @@ -416,21 +393,19 @@ abstract class GCloneProjectInput factory GCloneProjectInput([Function(GCloneProjectInputBuilder b) updates]) = _$GCloneProjectInput; - @nullable - String get body; - @nullable - String get clientMutationId; + String? get body; + String? get clientMutationId; bool get includeWorkflows; String get name; - @nullable - bool get public; + bool? get public; String get sourceId; String get targetOwnerId; static Serializer get serializer => _$gCloneProjectInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCloneProjectInput.serializer, this); - static GCloneProjectInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCloneProjectInput.serializer, this) + as Map); + static GCloneProjectInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCloneProjectInput.serializer, json); } @@ -444,19 +419,17 @@ abstract class GCloneTemplateRepositoryInput [Function(GCloneTemplateRepositoryInputBuilder b) updates]) = _$GCloneTemplateRepositoryInput; - @nullable - String get clientMutationId; - @nullable - String get description; + String? get clientMutationId; + String? get description; String get name; String get ownerId; String get repositoryId; GRepositoryVisibility get visibility; static Serializer get serializer => _$gCloneTemplateRepositoryInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCloneTemplateRepositoryInput.serializer, this); - static GCloneTemplateRepositoryInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GCloneTemplateRepositoryInput.serializer, this) as Map); + static GCloneTemplateRepositoryInput? fromJson(Map json) => _i1.serializers .deserializeWith(GCloneTemplateRepositoryInput.serializer, json); } @@ -468,14 +441,14 @@ abstract class GCloseIssueInput factory GCloseIssueInput([Function(GCloseIssueInputBuilder b) updates]) = _$GCloseIssueInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get issueId; static Serializer get serializer => _$gCloseIssueInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCloseIssueInput.serializer, this); - static GCloseIssueInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCloseIssueInput.serializer, this) + as Map); + static GCloseIssueInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCloseIssueInput.serializer, json); } @@ -487,14 +460,14 @@ abstract class GClosePullRequestInput [Function(GClosePullRequestInputBuilder b) updates]) = _$GClosePullRequestInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get pullRequestId; static Serializer get serializer => _$gClosePullRequestInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GClosePullRequestInput.serializer, this); - static GClosePullRequestInput fromJson(Map json) => + (_i1.serializers.serializeWith(GClosePullRequestInput.serializer, this) + as Map); + static GClosePullRequestInput? fromJson(Map json) => _i1.serializers.deserializeWith(GClosePullRequestInput.serializer, json); } @@ -587,13 +560,13 @@ abstract class GCommitAuthor factory GCommitAuthor([Function(GCommitAuthorBuilder b) updates]) = _$GCommitAuthor; - BuiltList get emails; - @nullable - String get id; + BuiltList? get emails; + String? get id; static Serializer get serializer => _$gCommitAuthorSerializer; Map toJson() => - _i1.serializers.serializeWith(GCommitAuthor.serializer, this); - static GCommitAuthor fromJson(Map json) => + (_i1.serializers.serializeWith(GCommitAuthor.serializer, this) + as Map); + static GCommitAuthor? fromJson(Map json) => _i1.serializers.deserializeWith(GCommitAuthor.serializer, json); } @@ -611,8 +584,9 @@ abstract class GCommitContributionOrder static Serializer get serializer => _$gCommitContributionOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GCommitContributionOrder.serializer, this); - static GCommitContributionOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GCommitContributionOrder.serializer, this) + as Map); + static GCommitContributionOrder? fromJson(Map json) => _i1.serializers .deserializeWith(GCommitContributionOrder.serializer, json); } @@ -642,13 +616,13 @@ abstract class GContributionOrder _$GContributionOrder; GOrderDirection get direction; - @nullable - GContributionOrderField get field; + GContributionOrderField? get field; static Serializer get serializer => _$gContributionOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GContributionOrder.serializer, this); - static GContributionOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GContributionOrder.serializer, this) + as Map); + static GContributionOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GContributionOrder.serializer, json); } @@ -676,19 +650,17 @@ abstract class GConvertProjectCardNoteToIssueInput [Function(GConvertProjectCardNoteToIssueInputBuilder b) updates]) = _$GConvertProjectCardNoteToIssueInput; - @nullable - String get body; - @nullable - String get clientMutationId; + String? get body; + String? get clientMutationId; String get projectCardId; String get repositoryId; - @nullable - String get title; + String? get title; static Serializer get serializer => _$gConvertProjectCardNoteToIssueInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GConvertProjectCardNoteToIssueInput.serializer, this); - static GConvertProjectCardNoteToIssueInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GConvertProjectCardNoteToIssueInput.serializer, this) + as Map); + static GConvertProjectCardNoteToIssueInput? fromJson( Map json) => _i1.serializers.deserializeWith( GConvertProjectCardNoteToIssueInput.serializer, json); @@ -704,38 +676,29 @@ abstract class GCreateBranchProtectionRuleInput [Function(GCreateBranchProtectionRuleInputBuilder b) updates]) = _$GCreateBranchProtectionRuleInput; - @nullable - String get clientMutationId; - @nullable - bool get dismissesStaleReviews; - @nullable - bool get isAdminEnforced; + String? get clientMutationId; + bool? get dismissesStaleReviews; + bool? get isAdminEnforced; String get pattern; - BuiltList get pushActorIds; + BuiltList? get pushActorIds; String get repositoryId; - @nullable - int get requiredApprovingReviewCount; - BuiltList get requiredStatusCheckContexts; - @nullable - bool get requiresApprovingReviews; - @nullable - bool get requiresCodeOwnerReviews; - @nullable - bool get requiresCommitSignatures; - @nullable - bool get requiresStatusChecks; - @nullable - bool get requiresStrictStatusChecks; - @nullable - bool get restrictsPushes; - @nullable - bool get restrictsReviewDismissals; - BuiltList get reviewDismissalActorIds; + int? get requiredApprovingReviewCount; + BuiltList? get requiredStatusCheckContexts; + bool? get requiresApprovingReviews; + bool? get requiresCodeOwnerReviews; + bool? get requiresCommitSignatures; + bool? get requiresStatusChecks; + bool? get requiresStrictStatusChecks; + bool? get restrictsPushes; + bool? get restrictsReviewDismissals; + BuiltList? get reviewDismissalActorIds; static Serializer get serializer => _$gCreateBranchProtectionRuleInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCreateBranchProtectionRuleInput.serializer, this); - static GCreateBranchProtectionRuleInput fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GCreateBranchProtectionRuleInput.serializer, this) + as Map); + static GCreateBranchProtectionRuleInput? fromJson( + Map json) => _i1.serializers .deserializeWith(GCreateBranchProtectionRuleInput.serializer, json); } @@ -752,16 +715,16 @@ abstract class GCreateEnterpriseOrganizationInput BuiltList get adminLogins; String get billingEmail; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; String get login; String get profileName; static Serializer get serializer => _$gCreateEnterpriseOrganizationInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCreateEnterpriseOrganizationInput.serializer, this); - static GCreateEnterpriseOrganizationInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GCreateEnterpriseOrganizationInput.serializer, this) + as Map); + static GCreateEnterpriseOrganizationInput? fromJson( Map json) => _i1.serializers .deserializeWith(GCreateEnterpriseOrganizationInput.serializer, json); @@ -774,22 +737,20 @@ abstract class GCreateIssueInput factory GCreateIssueInput([Function(GCreateIssueInputBuilder b) updates]) = _$GCreateIssueInput; - BuiltList get assigneeIds; - @nullable - String get body; - @nullable - String get clientMutationId; - BuiltList get labelIds; - @nullable - String get milestoneId; - BuiltList get projectIds; + BuiltList? get assigneeIds; + String? get body; + String? get clientMutationId; + BuiltList? get labelIds; + String? get milestoneId; + BuiltList? get projectIds; String get repositoryId; String get title; static Serializer get serializer => _$gCreateIssueInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCreateIssueInput.serializer, this); - static GCreateIssueInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCreateIssueInput.serializer, this) + as Map); + static GCreateIssueInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCreateIssueInput.serializer, json); } @@ -800,20 +761,18 @@ abstract class GCreateProjectInput factory GCreateProjectInput( [Function(GCreateProjectInputBuilder b) updates]) = _$GCreateProjectInput; - @nullable - String get body; - @nullable - String get clientMutationId; + String? get body; + String? get clientMutationId; String get name; String get ownerId; - BuiltList get repositoryIds; - @nullable - GProjectTemplate get template; + BuiltList? get repositoryIds; + GProjectTemplate? get template; static Serializer get serializer => _$gCreateProjectInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCreateProjectInput.serializer, this); - static GCreateProjectInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCreateProjectInput.serializer, this) + as Map); + static GCreateProjectInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCreateProjectInput.serializer, json); } @@ -826,20 +785,18 @@ abstract class GCreatePullRequestInput _$GCreatePullRequestInput; String get baseRefName; - @nullable - String get body; - @nullable - String get clientMutationId; + String? get body; + String? get clientMutationId; String get headRefName; - @nullable - bool get maintainerCanModify; + bool? get maintainerCanModify; String get repositoryId; String get title; static Serializer get serializer => _$gCreatePullRequestInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCreatePullRequestInput.serializer, this); - static GCreatePullRequestInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCreatePullRequestInput.serializer, this) + as Map); + static GCreatePullRequestInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCreatePullRequestInput.serializer, json); } @@ -850,16 +807,16 @@ abstract class GCreateRefInput factory GCreateRefInput([Function(GCreateRefInputBuilder b) updates]) = _$GCreateRefInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get name; GGitObjectID get oid; String get repositoryId; static Serializer get serializer => _$gCreateRefInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCreateRefInput.serializer, this); - static GCreateRefInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCreateRefInput.serializer, this) + as Map); + static GCreateRefInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCreateRefInput.serializer, json); } @@ -871,29 +828,22 @@ abstract class GCreateRepositoryInput [Function(GCreateRepositoryInputBuilder b) updates]) = _$GCreateRepositoryInput; - @nullable - String get clientMutationId; - @nullable - String get description; - @nullable - bool get hasIssuesEnabled; - @nullable - bool get hasWikiEnabled; - @nullable - GURI get homepageUrl; + String? get clientMutationId; + String? get description; + bool? get hasIssuesEnabled; + bool? get hasWikiEnabled; + GURI? get homepageUrl; String get name; - @nullable - String get ownerId; - @nullable - String get teamId; - @nullable - bool get template; + String? get ownerId; + String? get teamId; + bool? get template; GRepositoryVisibility get visibility; static Serializer get serializer => _$gCreateRepositoryInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GCreateRepositoryInput.serializer, this); - static GCreateRepositoryInput fromJson(Map json) => + (_i1.serializers.serializeWith(GCreateRepositoryInput.serializer, this) + as Map); + static GCreateRepositoryInput? fromJson(Map json) => _i1.serializers.deserializeWith(GCreateRepositoryInput.serializer, json); } @@ -908,14 +858,14 @@ abstract class GCreateTeamDiscussionCommentInput _$GCreateTeamDiscussionCommentInput; String get body; - @nullable - String get clientMutationId; + String? get clientMutationId; String get discussionId; static Serializer get serializer => _$gCreateTeamDiscussionCommentInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCreateTeamDiscussionCommentInput.serializer, this); - static GCreateTeamDiscussionCommentInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GCreateTeamDiscussionCommentInput.serializer, this) + as Map); + static GCreateTeamDiscussionCommentInput? fromJson( Map json) => _i1.serializers .deserializeWith(GCreateTeamDiscussionCommentInput.serializer, json); @@ -931,17 +881,15 @@ abstract class GCreateTeamDiscussionInput _$GCreateTeamDiscussionInput; String get body; - @nullable - String get clientMutationId; - @nullable - bool get private; + String? get clientMutationId; + bool? get private; String get teamId; String get title; static Serializer get serializer => _$gCreateTeamDiscussionInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GCreateTeamDiscussionInput.serializer, this); - static GCreateTeamDiscussionInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GCreateTeamDiscussionInput.serializer, this) as Map); + static GCreateTeamDiscussionInput? fromJson(Map json) => _i1.serializers .deserializeWith(GCreateTeamDiscussionInput.serializer, json); } @@ -949,26 +897,26 @@ abstract class GCreateTeamDiscussionInput abstract class GDate implements Built { GDate._(); - factory GDate([String value]) => + factory GDate([String? value]) => _$GDate((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GDate(serialized)); + (Object serialized) => GDate((serialized as String?))); } abstract class GDateTime implements Built { GDateTime._(); - factory GDateTime([String value]) => + factory GDateTime([String? value]) => _$GDateTime((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GDateTime(serialized)); + (Object serialized) => GDateTime((serialized as String?))); } abstract class GDeclineTopicSuggestionInput @@ -981,16 +929,15 @@ abstract class GDeclineTopicSuggestionInput [Function(GDeclineTopicSuggestionInputBuilder b) updates]) = _$GDeclineTopicSuggestionInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get name; GTopicSuggestionDeclineReason get reason; String get repositoryId; static Serializer get serializer => _$gDeclineTopicSuggestionInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDeclineTopicSuggestionInput.serializer, this); - static GDeclineTopicSuggestionInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GDeclineTopicSuggestionInput.serializer, this) as Map); + static GDeclineTopicSuggestionInput? fromJson(Map json) => _i1.serializers .deserializeWith(GDeclineTopicSuggestionInput.serializer, json); } @@ -1029,13 +976,14 @@ abstract class GDeleteBranchProtectionRuleInput _$GDeleteBranchProtectionRuleInput; String get branchProtectionRuleId; - @nullable - String get clientMutationId; + String? get clientMutationId; static Serializer get serializer => _$gDeleteBranchProtectionRuleInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDeleteBranchProtectionRuleInput.serializer, this); - static GDeleteBranchProtectionRuleInput fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GDeleteBranchProtectionRuleInput.serializer, this) + as Map); + static GDeleteBranchProtectionRuleInput? fromJson( + Map json) => _i1.serializers .deserializeWith(GDeleteBranchProtectionRuleInput.serializer, json); } @@ -1048,14 +996,14 @@ abstract class GDeleteDeploymentInput [Function(GDeleteDeploymentInputBuilder b) updates]) = _$GDeleteDeploymentInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get id; static Serializer get serializer => _$gDeleteDeploymentInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteDeploymentInput.serializer, this); - static GDeleteDeploymentInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteDeploymentInput.serializer, this) + as Map); + static GDeleteDeploymentInput? fromJson(Map json) => _i1.serializers.deserializeWith(GDeleteDeploymentInput.serializer, json); } @@ -1068,14 +1016,14 @@ abstract class GDeleteIssueCommentInput [Function(GDeleteIssueCommentInputBuilder b) updates]) = _$GDeleteIssueCommentInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get id; static Serializer get serializer => _$gDeleteIssueCommentInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteIssueCommentInput.serializer, this); - static GDeleteIssueCommentInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteIssueCommentInput.serializer, this) + as Map); + static GDeleteIssueCommentInput? fromJson(Map json) => _i1.serializers .deserializeWith(GDeleteIssueCommentInput.serializer, json); } @@ -1087,14 +1035,14 @@ abstract class GDeleteIssueInput factory GDeleteIssueInput([Function(GDeleteIssueInputBuilder b) updates]) = _$GDeleteIssueInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get issueId; static Serializer get serializer => _$gDeleteIssueInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteIssueInput.serializer, this); - static GDeleteIssueInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteIssueInput.serializer, this) + as Map); + static GDeleteIssueInput? fromJson(Map json) => _i1.serializers.deserializeWith(GDeleteIssueInput.serializer, json); } @@ -1107,13 +1055,13 @@ abstract class GDeleteProjectCardInput _$GDeleteProjectCardInput; String get cardId; - @nullable - String get clientMutationId; + String? get clientMutationId; static Serializer get serializer => _$gDeleteProjectCardInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteProjectCardInput.serializer, this); - static GDeleteProjectCardInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteProjectCardInput.serializer, this) + as Map); + static GDeleteProjectCardInput? fromJson(Map json) => _i1.serializers.deserializeWith(GDeleteProjectCardInput.serializer, json); } @@ -1126,14 +1074,14 @@ abstract class GDeleteProjectColumnInput [Function(GDeleteProjectColumnInputBuilder b) updates]) = _$GDeleteProjectColumnInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get columnId; static Serializer get serializer => _$gDeleteProjectColumnInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteProjectColumnInput.serializer, this); - static GDeleteProjectColumnInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteProjectColumnInput.serializer, this) + as Map); + static GDeleteProjectColumnInput? fromJson(Map json) => _i1.serializers .deserializeWith(GDeleteProjectColumnInput.serializer, json); } @@ -1145,14 +1093,14 @@ abstract class GDeleteProjectInput factory GDeleteProjectInput( [Function(GDeleteProjectInputBuilder b) updates]) = _$GDeleteProjectInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get projectId; static Serializer get serializer => _$gDeleteProjectInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteProjectInput.serializer, this); - static GDeleteProjectInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteProjectInput.serializer, this) + as Map); + static GDeleteProjectInput? fromJson(Map json) => _i1.serializers.deserializeWith(GDeleteProjectInput.serializer, json); } @@ -1166,14 +1114,14 @@ abstract class GDeletePullRequestReviewCommentInput [Function(GDeletePullRequestReviewCommentInputBuilder b) updates]) = _$GDeletePullRequestReviewCommentInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get id; static Serializer get serializer => _$gDeletePullRequestReviewCommentInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDeletePullRequestReviewCommentInput.serializer, this); - static GDeletePullRequestReviewCommentInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GDeletePullRequestReviewCommentInput.serializer, this) + as Map); + static GDeletePullRequestReviewCommentInput? fromJson( Map json) => _i1.serializers.deserializeWith( GDeletePullRequestReviewCommentInput.serializer, json); @@ -1189,14 +1137,13 @@ abstract class GDeletePullRequestReviewInput [Function(GDeletePullRequestReviewInputBuilder b) updates]) = _$GDeletePullRequestReviewInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get pullRequestReviewId; static Serializer get serializer => _$gDeletePullRequestReviewInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDeletePullRequestReviewInput.serializer, this); - static GDeletePullRequestReviewInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GDeletePullRequestReviewInput.serializer, this) as Map); + static GDeletePullRequestReviewInput? fromJson(Map json) => _i1.serializers .deserializeWith(GDeletePullRequestReviewInput.serializer, json); } @@ -1208,14 +1155,14 @@ abstract class GDeleteRefInput factory GDeleteRefInput([Function(GDeleteRefInputBuilder b) updates]) = _$GDeleteRefInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get refId; static Serializer get serializer => _$gDeleteRefInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeleteRefInput.serializer, this); - static GDeleteRefInput fromJson(Map json) => + (_i1.serializers.serializeWith(GDeleteRefInput.serializer, this) + as Map); + static GDeleteRefInput? fromJson(Map json) => _i1.serializers.deserializeWith(GDeleteRefInput.serializer, json); } @@ -1229,14 +1176,14 @@ abstract class GDeleteTeamDiscussionCommentInput [Function(GDeleteTeamDiscussionCommentInputBuilder b) updates]) = _$GDeleteTeamDiscussionCommentInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get id; static Serializer get serializer => _$gDeleteTeamDiscussionCommentInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDeleteTeamDiscussionCommentInput.serializer, this); - static GDeleteTeamDiscussionCommentInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GDeleteTeamDiscussionCommentInput.serializer, this) + as Map); + static GDeleteTeamDiscussionCommentInput? fromJson( Map json) => _i1.serializers .deserializeWith(GDeleteTeamDiscussionCommentInput.serializer, json); @@ -1251,14 +1198,13 @@ abstract class GDeleteTeamDiscussionInput [Function(GDeleteTeamDiscussionInputBuilder b) updates]) = _$GDeleteTeamDiscussionInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get id; static Serializer get serializer => _$gDeleteTeamDiscussionInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDeleteTeamDiscussionInput.serializer, this); - static GDeleteTeamDiscussionInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GDeleteTeamDiscussionInput.serializer, this) as Map); + static GDeleteTeamDiscussionInput? fromJson(Map json) => _i1.serializers .deserializeWith(GDeleteTeamDiscussionInput.serializer, json); } @@ -1275,8 +1221,9 @@ abstract class GDeploymentOrder static Serializer get serializer => _$gDeploymentOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GDeploymentOrder.serializer, this); - static GDeploymentOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GDeploymentOrder.serializer, this) + as Map); + static GDeploymentOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GDeploymentOrder.serializer, json); } @@ -1359,15 +1306,14 @@ abstract class GDismissPullRequestReviewInput [Function(GDismissPullRequestReviewInputBuilder b) updates]) = _$GDismissPullRequestReviewInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get message; String get pullRequestReviewId; static Serializer get serializer => _$gDismissPullRequestReviewInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDismissPullRequestReviewInput.serializer, this); - static GDismissPullRequestReviewInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GDismissPullRequestReviewInput.serializer, this) as Map); + static GDismissPullRequestReviewInput? fromJson(Map json) => _i1.serializers .deserializeWith(GDismissPullRequestReviewInput.serializer, json); } @@ -1387,9 +1333,9 @@ abstract class GDraftPullRequestReviewComment int get position; static Serializer get serializer => _$gDraftPullRequestReviewCommentSerializer; - Map toJson() => _i1.serializers - .serializeWith(GDraftPullRequestReviewComment.serializer, this); - static GDraftPullRequestReviewComment fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GDraftPullRequestReviewComment.serializer, this) as Map); + static GDraftPullRequestReviewComment? fromJson(Map json) => _i1.serializers .deserializeWith(GDraftPullRequestReviewComment.serializer, json); } @@ -1408,9 +1354,10 @@ abstract class GEnterpriseAdministratorInvitationOrder GEnterpriseAdministratorInvitationOrderField get field; static Serializer get serializer => _$gEnterpriseAdministratorInvitationOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GEnterpriseAdministratorInvitationOrder.serializer, this); - static GEnterpriseAdministratorInvitationOrder fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GEnterpriseAdministratorInvitationOrder.serializer, this) + as Map); + static GEnterpriseAdministratorInvitationOrder? fromJson( Map json) => _i1.serializers.deserializeWith( GEnterpriseAdministratorInvitationOrder.serializer, json); @@ -1528,8 +1475,9 @@ abstract class GEnterpriseMemberOrder static Serializer get serializer => _$gEnterpriseMemberOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GEnterpriseMemberOrder.serializer, this); - static GEnterpriseMemberOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GEnterpriseMemberOrder.serializer, this) + as Map); + static GEnterpriseMemberOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GEnterpriseMemberOrder.serializer, json); } @@ -1612,9 +1560,10 @@ abstract class GEnterpriseServerInstallationOrder GEnterpriseServerInstallationOrderField get field; static Serializer get serializer => _$gEnterpriseServerInstallationOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GEnterpriseServerInstallationOrder.serializer, this); - static GEnterpriseServerInstallationOrder fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GEnterpriseServerInstallationOrder.serializer, this) + as Map); + static GEnterpriseServerInstallationOrder? fromJson( Map json) => _i1.serializers .deserializeWith(GEnterpriseServerInstallationOrder.serializer, json); @@ -1654,9 +1603,10 @@ abstract class GEnterpriseServerUserAccountEmailOrder GEnterpriseServerUserAccountEmailOrderField get field; static Serializer get serializer => _$gEnterpriseServerUserAccountEmailOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GEnterpriseServerUserAccountEmailOrder.serializer, this); - static GEnterpriseServerUserAccountEmailOrder fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GEnterpriseServerUserAccountEmailOrder.serializer, this) + as Map); + static GEnterpriseServerUserAccountEmailOrder? fromJson( Map json) => _i1.serializers.deserializeWith( GEnterpriseServerUserAccountEmailOrder.serializer, json); @@ -1691,9 +1641,10 @@ abstract class GEnterpriseServerUserAccountOrder GEnterpriseServerUserAccountOrderField get field; static Serializer get serializer => _$gEnterpriseServerUserAccountOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GEnterpriseServerUserAccountOrder.serializer, this); - static GEnterpriseServerUserAccountOrder fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GEnterpriseServerUserAccountOrder.serializer, this) + as Map); + static GEnterpriseServerUserAccountOrder? fromJson( Map json) => _i1.serializers .deserializeWith(GEnterpriseServerUserAccountOrder.serializer, json); @@ -1730,9 +1681,10 @@ abstract class GEnterpriseServerUserAccountsUploadOrder GEnterpriseServerUserAccountsUploadOrderField get field; static Serializer get serializer => _$gEnterpriseServerUserAccountsUploadOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GEnterpriseServerUserAccountsUploadOrder.serializer, this); - static GEnterpriseServerUserAccountsUploadOrder fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GEnterpriseServerUserAccountsUploadOrder.serializer, this) + as Map); + static GEnterpriseServerUserAccountsUploadOrder? fromJson( Map json) => _i1.serializers.deserializeWith( GEnterpriseServerUserAccountsUploadOrder.serializer, json); @@ -1817,14 +1769,14 @@ abstract class GFollowUserInput factory GFollowUserInput([Function(GFollowUserInputBuilder b) updates]) = _$GFollowUserInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get userId; static Serializer get serializer => _$gFollowUserInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GFollowUserInput.serializer, this); - static GFollowUserInput fromJson(Map json) => + (_i1.serializers.serializeWith(GFollowUserInput.serializer, this) + as Map); + static GFollowUserInput? fromJson(Map json) => _i1.serializers.deserializeWith(GFollowUserInput.serializer, json); } @@ -1869,8 +1821,9 @@ abstract class GGistOrder implements Built { GGistOrderField get field; static Serializer get serializer => _$gGistOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GGistOrder.serializer, this); - static GGistOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GGistOrder.serializer, this) + as Map); + static GGistOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GGistOrder.serializer, json); } @@ -1907,28 +1860,28 @@ abstract class GGitObjectID implements Built { GGitObjectID._(); - factory GGitObjectID([String value]) => + factory GGitObjectID([String? value]) => _$GGitObjectID((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GGitObjectID(serialized)); + (Object serialized) => GGitObjectID((serialized as String?))); } abstract class GGitSSHRemote implements Built { GGitSSHRemote._(); - factory GGitSSHRemote([String value]) => + factory GGitSSHRemote([String? value]) => _$GGitSSHRemote((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GGitSSHRemote(serialized)); + (Object serialized) => GGitSSHRemote((serialized as String?))); } class GGitSignatureState extends EnumClass { @@ -1987,26 +1940,26 @@ abstract class GGitTimestamp implements Built { GGitTimestamp._(); - factory GGitTimestamp([String value]) => + factory GGitTimestamp([String? value]) => _$GGitTimestamp((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GGitTimestamp(serialized)); + (Object serialized) => GGitTimestamp((serialized as String?))); } abstract class GHTML implements Built { GHTML._(); - factory GHTML([String value]) => + factory GHTML([String? value]) => _$GHTML((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GHTML(serialized)); + (Object serialized) => GHTML((serialized as String?))); } class GIdentityProviderConfigurationState extends EnumClass { @@ -2038,20 +1991,16 @@ abstract class GInviteEnterpriseAdminInput [Function(GInviteEnterpriseAdminInputBuilder b) updates]) = _$GInviteEnterpriseAdminInput; - @nullable - String get clientMutationId; - @nullable - String get email; + String? get clientMutationId; + String? get email; String get enterpriseId; - @nullable - String get invitee; - @nullable - GEnterpriseAdministratorRole get role; + String? get invitee; + GEnterpriseAdministratorRole? get role; static Serializer get serializer => _$gInviteEnterpriseAdminInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GInviteEnterpriseAdminInput.serializer, this); - static GInviteEnterpriseAdminInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GInviteEnterpriseAdminInput.serializer, this) as Map); + static GInviteEnterpriseAdminInput? fromJson(Map json) => _i1.serializers .deserializeWith(GInviteEnterpriseAdminInput.serializer, json); } @@ -2063,24 +2012,19 @@ abstract class GIssueFilters factory GIssueFilters([Function(GIssueFiltersBuilder b) updates]) = _$GIssueFilters; - @nullable - String get assignee; - @nullable - String get createdBy; - BuiltList get labels; - @nullable - String get mentioned; - @nullable - String get milestone; - @nullable - GDateTime get since; - BuiltList get states; - @nullable - bool get viewerSubscribed; + String? get assignee; + String? get createdBy; + BuiltList? get labels; + String? get mentioned; + String? get milestone; + GDateTime? get since; + BuiltList? get states; + bool? get viewerSubscribed; static Serializer get serializer => _$gIssueFiltersSerializer; Map toJson() => - _i1.serializers.serializeWith(GIssueFilters.serializer, this); - static GIssueFilters fromJson(Map json) => + (_i1.serializers.serializeWith(GIssueFilters.serializer, this) + as Map); + static GIssueFilters? fromJson(Map json) => _i1.serializers.deserializeWith(GIssueFilters.serializer, json); } @@ -2093,8 +2037,9 @@ abstract class GIssueOrder implements Built { GIssueOrderField get field; static Serializer get serializer => _$gIssueOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GIssueOrder.serializer, this); - static GIssueOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GIssueOrder.serializer, this) + as Map); + static GIssueOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GIssueOrder.serializer, json); } @@ -2236,8 +2181,9 @@ abstract class GLabelOrder implements Built { GLabelOrderField get field; static Serializer get serializer => _$gLabelOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GLabelOrder.serializer, this); - static GLabelOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GLabelOrder.serializer, this) + as Map); + static GLabelOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GLabelOrder.serializer, json); } @@ -2267,8 +2213,9 @@ abstract class GLanguageOrder static Serializer get serializer => _$gLanguageOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GLanguageOrder.serializer, this); - static GLanguageOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GLanguageOrder.serializer, this) + as Map); + static GLanguageOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GLanguageOrder.serializer, json); } @@ -2295,15 +2242,14 @@ abstract class GLinkRepositoryToProjectInput [Function(GLinkRepositoryToProjectInputBuilder b) updates]) = _$GLinkRepositoryToProjectInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get projectId; String get repositoryId; static Serializer get serializer => _$gLinkRepositoryToProjectInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GLinkRepositoryToProjectInput.serializer, this); - static GLinkRepositoryToProjectInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GLinkRepositoryToProjectInput.serializer, this) as Map); + static GLinkRepositoryToProjectInput? fromJson(Map json) => _i1.serializers .deserializeWith(GLinkRepositoryToProjectInput.serializer, json); } @@ -2315,16 +2261,15 @@ abstract class GLockLockableInput factory GLockLockableInput([Function(GLockLockableInputBuilder b) updates]) = _$GLockLockableInput; - @nullable - String get clientMutationId; - @nullable - GLockReason get lockReason; + String? get clientMutationId; + GLockReason? get lockReason; String get lockableId; static Serializer get serializer => _$gLockLockableInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GLockLockableInput.serializer, this); - static GLockLockableInput fromJson(Map json) => + (_i1.serializers.serializeWith(GLockLockableInput.serializer, this) + as Map); + static GLockLockableInput? fromJson(Map json) => _i1.serializers.deserializeWith(GLockLockableInput.serializer, json); } @@ -2352,17 +2297,16 @@ abstract class GMergeBranchInput _$GMergeBranchInput; String get base; - @nullable - String get clientMutationId; - @nullable - String get commitMessage; + String? get clientMutationId; + String? get commitMessage; String get head; String get repositoryId; static Serializer get serializer => _$gMergeBranchInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GMergeBranchInput.serializer, this); - static GMergeBranchInput fromJson(Map json) => + (_i1.serializers.serializeWith(GMergeBranchInput.serializer, this) + as Map); + static GMergeBranchInput? fromJson(Map json) => _i1.serializers.deserializeWith(GMergeBranchInput.serializer, json); } @@ -2374,22 +2318,18 @@ abstract class GMergePullRequestInput [Function(GMergePullRequestInputBuilder b) updates]) = _$GMergePullRequestInput; - @nullable - String get clientMutationId; - @nullable - String get commitBody; - @nullable - String get commitHeadline; - @nullable - GGitObjectID get expectedHeadOid; - @nullable - GPullRequestMergeMethod get mergeMethod; + String? get clientMutationId; + String? get commitBody; + String? get commitHeadline; + GGitObjectID? get expectedHeadOid; + GPullRequestMergeMethod? get mergeMethod; String get pullRequestId; static Serializer get serializer => _$gMergePullRequestInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GMergePullRequestInput.serializer, this); - static GMergePullRequestInput fromJson(Map json) => + (_i1.serializers.serializeWith(GMergePullRequestInput.serializer, this) + as Map); + static GMergePullRequestInput? fromJson(Map json) => _i1.serializers.deserializeWith(GMergePullRequestInput.serializer, json); } @@ -2420,8 +2360,9 @@ abstract class GMilestoneOrder static Serializer get serializer => _$gMilestoneOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GMilestoneOrder.serializer, this); - static GMilestoneOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GMilestoneOrder.serializer, this) + as Map); + static GMilestoneOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GMilestoneOrder.serializer, json); } @@ -2467,17 +2408,16 @@ abstract class GMoveProjectCardInput [Function(GMoveProjectCardInputBuilder b) updates]) = _$GMoveProjectCardInput; - @nullable - String get afterCardId; + String? get afterCardId; String get cardId; - @nullable - String get clientMutationId; + String? get clientMutationId; String get columnId; static Serializer get serializer => _$gMoveProjectCardInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GMoveProjectCardInput.serializer, this); - static GMoveProjectCardInput fromJson(Map json) => + (_i1.serializers.serializeWith(GMoveProjectCardInput.serializer, this) + as Map); + static GMoveProjectCardInput? fromJson(Map json) => _i1.serializers.deserializeWith(GMoveProjectCardInput.serializer, json); } @@ -2489,16 +2429,15 @@ abstract class GMoveProjectColumnInput [Function(GMoveProjectColumnInputBuilder b) updates]) = _$GMoveProjectColumnInput; - @nullable - String get afterColumnId; - @nullable - String get clientMutationId; + String? get afterColumnId; + String? get clientMutationId; String get columnId; static Serializer get serializer => _$gMoveProjectColumnInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GMoveProjectColumnInput.serializer, this); - static GMoveProjectColumnInput fromJson(Map json) => + (_i1.serializers.serializeWith(GMoveProjectColumnInput.serializer, this) + as Map); + static GMoveProjectColumnInput? fromJson(Map json) => _i1.serializers.deserializeWith(GMoveProjectColumnInput.serializer, json); } @@ -2884,8 +2823,9 @@ abstract class GOrganizationOrder static Serializer get serializer => _$gOrganizationOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GOrganizationOrder.serializer, this); - static GOrganizationOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GOrganizationOrder.serializer, this) + as Map); + static GOrganizationOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GOrganizationOrder.serializer, json); } @@ -2935,14 +2875,14 @@ abstract class GPreciseDateTime implements Built { GPreciseDateTime._(); - factory GPreciseDateTime([String value]) => + factory GPreciseDateTime([String? value]) => _$GPreciseDateTime((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GPreciseDateTime(serialized)); + (Object serialized) => GPreciseDateTime((serialized as String?))); } class GProjectCardArchivedState extends EnumClass { @@ -3007,8 +2947,9 @@ abstract class GProjectOrder GProjectOrderField get field; static Serializer get serializer => _$gProjectOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GProjectOrder.serializer, this); - static GProjectOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GProjectOrder.serializer, this) + as Map); + static GProjectOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GProjectOrder.serializer, json); } @@ -3089,8 +3030,9 @@ abstract class GPullRequestOrder static Serializer get serializer => _$gPullRequestOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GPullRequestOrder.serializer, this); - static GPullRequestOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GPullRequestOrder.serializer, this) + as Map); + static GPullRequestOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GPullRequestOrder.serializer, json); } @@ -3401,8 +3343,9 @@ abstract class GReactionOrder static Serializer get serializer => _$gReactionOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GReactionOrder.serializer, this); - static GReactionOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GReactionOrder.serializer, this) + as Map); + static GReactionOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GReactionOrder.serializer, json); } @@ -3428,8 +3371,9 @@ abstract class GRefOrder implements Built { GRefOrderField get field; static Serializer get serializer => _$gRefOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GRefOrder.serializer, this); - static GRefOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GRefOrder.serializer, this) + as Map); + static GRefOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GRefOrder.serializer, json); } @@ -3457,15 +3401,15 @@ abstract class GRegenerateEnterpriseIdentityProviderRecoveryCodesInput GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder b) updates]) = _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; static Serializer get serializer => _$gRegenerateEnterpriseIdentityProviderRecoveryCodesInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GRegenerateEnterpriseIdentityProviderRecoveryCodesInput.serializer, this); - static GRegenerateEnterpriseIdentityProviderRecoveryCodesInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GRegenerateEnterpriseIdentityProviderRecoveryCodesInput.serializer, + this) as Map); + static GRegenerateEnterpriseIdentityProviderRecoveryCodesInput? fromJson( Map json) => _i1.serializers.deserializeWith( GRegenerateEnterpriseIdentityProviderRecoveryCodesInput.serializer, @@ -3511,14 +3455,14 @@ abstract class GRegistryPackageMetadatum _$GRegistryPackageMetadatum; String get name; - @nullable - bool get update; + bool? get update; String get value; static Serializer get serializer => _$gRegistryPackageMetadatumSerializer; Map toJson() => - _i1.serializers.serializeWith(GRegistryPackageMetadatum.serializer, this); - static GRegistryPackageMetadatum fromJson(Map json) => + (_i1.serializers.serializeWith(GRegistryPackageMetadatum.serializer, this) + as Map); + static GRegistryPackageMetadatum? fromJson(Map json) => _i1.serializers .deserializeWith(GRegistryPackageMetadatum.serializer, json); } @@ -3559,8 +3503,9 @@ abstract class GReleaseOrder GReleaseOrderField get field; static Serializer get serializer => _$gReleaseOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GReleaseOrder.serializer, this); - static GReleaseOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GReleaseOrder.serializer, this) + as Map); + static GReleaseOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GReleaseOrder.serializer, json); } @@ -3590,13 +3535,13 @@ abstract class GRemoveAssigneesFromAssignableInput String get assignableId; BuiltList get assigneeIds; - @nullable - String get clientMutationId; + String? get clientMutationId; static Serializer get serializer => _$gRemoveAssigneesFromAssignableInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRemoveAssigneesFromAssignableInput.serializer, this); - static GRemoveAssigneesFromAssignableInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GRemoveAssigneesFromAssignableInput.serializer, this) + as Map); + static GRemoveAssigneesFromAssignableInput? fromJson( Map json) => _i1.serializers.deserializeWith( GRemoveAssigneesFromAssignableInput.serializer, json); @@ -3611,15 +3556,14 @@ abstract class GRemoveEnterpriseAdminInput [Function(GRemoveEnterpriseAdminInputBuilder b) updates]) = _$GRemoveEnterpriseAdminInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; String get login; static Serializer get serializer => _$gRemoveEnterpriseAdminInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRemoveEnterpriseAdminInput.serializer, this); - static GRemoveEnterpriseAdminInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GRemoveEnterpriseAdminInput.serializer, this) as Map); + static GRemoveEnterpriseAdminInput? fromJson(Map json) => _i1.serializers .deserializeWith(GRemoveEnterpriseAdminInput.serializer, json); } @@ -3634,15 +3578,15 @@ abstract class GRemoveEnterpriseOrganizationInput [Function(GRemoveEnterpriseOrganizationInputBuilder b) updates]) = _$GRemoveEnterpriseOrganizationInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; String get organizationId; static Serializer get serializer => _$gRemoveEnterpriseOrganizationInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRemoveEnterpriseOrganizationInput.serializer, this); - static GRemoveEnterpriseOrganizationInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GRemoveEnterpriseOrganizationInput.serializer, this) + as Map); + static GRemoveEnterpriseOrganizationInput? fromJson( Map json) => _i1.serializers .deserializeWith(GRemoveEnterpriseOrganizationInput.serializer, json); @@ -3658,15 +3602,15 @@ abstract class GRemoveLabelsFromLabelableInput [Function(GRemoveLabelsFromLabelableInputBuilder b) updates]) = _$GRemoveLabelsFromLabelableInput; - @nullable - String get clientMutationId; + String? get clientMutationId; BuiltList get labelIds; String get labelableId; static Serializer get serializer => _$gRemoveLabelsFromLabelableInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRemoveLabelsFromLabelableInput.serializer, this); - static GRemoveLabelsFromLabelableInput fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GRemoveLabelsFromLabelableInput.serializer, this) + as Map); + static GRemoveLabelsFromLabelableInput? fromJson(Map json) => _i1.serializers .deserializeWith(GRemoveLabelsFromLabelableInput.serializer, json); } @@ -3681,15 +3625,15 @@ abstract class GRemoveOutsideCollaboratorInput [Function(GRemoveOutsideCollaboratorInputBuilder b) updates]) = _$GRemoveOutsideCollaboratorInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get organizationId; String get userId; static Serializer get serializer => _$gRemoveOutsideCollaboratorInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRemoveOutsideCollaboratorInput.serializer, this); - static GRemoveOutsideCollaboratorInput fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GRemoveOutsideCollaboratorInput.serializer, this) + as Map); + static GRemoveOutsideCollaboratorInput? fromJson(Map json) => _i1.serializers .deserializeWith(GRemoveOutsideCollaboratorInput.serializer, json); } @@ -3702,15 +3646,15 @@ abstract class GRemoveReactionInput [Function(GRemoveReactionInputBuilder b) updates]) = _$GRemoveReactionInput; - @nullable - String get clientMutationId; + String? get clientMutationId; GReactionContent get content; String get subjectId; static Serializer get serializer => _$gRemoveReactionInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GRemoveReactionInput.serializer, this); - static GRemoveReactionInput fromJson(Map json) => + (_i1.serializers.serializeWith(GRemoveReactionInput.serializer, this) + as Map); + static GRemoveReactionInput? fromJson(Map json) => _i1.serializers.deserializeWith(GRemoveReactionInput.serializer, json); } @@ -3721,14 +3665,14 @@ abstract class GRemoveStarInput factory GRemoveStarInput([Function(GRemoveStarInputBuilder b) updates]) = _$GRemoveStarInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get starrableId; static Serializer get serializer => _$gRemoveStarInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GRemoveStarInput.serializer, this); - static GRemoveStarInput fromJson(Map json) => + (_i1.serializers.serializeWith(GRemoveStarInput.serializer, this) + as Map); + static GRemoveStarInput? fromJson(Map json) => _i1.serializers.deserializeWith(GRemoveStarInput.serializer, json); } @@ -3739,14 +3683,14 @@ abstract class GReopenIssueInput factory GReopenIssueInput([Function(GReopenIssueInputBuilder b) updates]) = _$GReopenIssueInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get issueId; static Serializer get serializer => _$gReopenIssueInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GReopenIssueInput.serializer, this); - static GReopenIssueInput fromJson(Map json) => + (_i1.serializers.serializeWith(GReopenIssueInput.serializer, this) + as Map); + static GReopenIssueInput? fromJson(Map json) => _i1.serializers.deserializeWith(GReopenIssueInput.serializer, json); } @@ -3758,14 +3702,14 @@ abstract class GReopenPullRequestInput [Function(GReopenPullRequestInputBuilder b) updates]) = _$GReopenPullRequestInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get pullRequestId; static Serializer get serializer => _$gReopenPullRequestInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GReopenPullRequestInput.serializer, this); - static GReopenPullRequestInput fromJson(Map json) => + (_i1.serializers.serializeWith(GReopenPullRequestInput.serializer, this) + as Map); + static GReopenPullRequestInput? fromJson(Map json) => _i1.serializers.deserializeWith(GReopenPullRequestInput.serializer, json); } @@ -3967,9 +3911,9 @@ abstract class GRepositoryInvitationOrder GRepositoryInvitationOrderField get field; static Serializer get serializer => _$gRepositoryInvitationOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GRepositoryInvitationOrder.serializer, this); - static GRepositoryInvitationOrder fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GRepositoryInvitationOrder.serializer, this) as Map); + static GRepositoryInvitationOrder? fromJson(Map json) => _i1.serializers .deserializeWith(GRepositoryInvitationOrder.serializer, json); } @@ -4023,8 +3967,9 @@ abstract class GRepositoryOrder static Serializer get serializer => _$gRepositoryOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GRepositoryOrder.serializer, this); - static GRepositoryOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GRepositoryOrder.serializer, this) + as Map); + static GRepositoryOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GRepositoryOrder.serializer, json); } @@ -4113,18 +4058,17 @@ abstract class GRequestReviewsInput [Function(GRequestReviewsInputBuilder b) updates]) = _$GRequestReviewsInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get pullRequestId; - BuiltList get teamIds; - @nullable - bool get union; - BuiltList get userIds; + BuiltList? get teamIds; + bool? get union; + BuiltList? get userIds; static Serializer get serializer => _$gRequestReviewsInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GRequestReviewsInput.serializer, this); - static GRequestReviewsInput fromJson(Map json) => + (_i1.serializers.serializeWith(GRequestReviewsInput.serializer, this) + as Map); + static GRequestReviewsInput? fromJson(Map json) => _i1.serializers.deserializeWith(GRequestReviewsInput.serializer, json); } @@ -4137,14 +4081,14 @@ abstract class GResolveReviewThreadInput [Function(GResolveReviewThreadInputBuilder b) updates]) = _$GResolveReviewThreadInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get threadId; static Serializer get serializer => _$gResolveReviewThreadInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GResolveReviewThreadInput.serializer, this); - static GResolveReviewThreadInput fromJson(Map json) => + (_i1.serializers.serializeWith(GResolveReviewThreadInput.serializer, this) + as Map); + static GResolveReviewThreadInput? fromJson(Map json) => _i1.serializers .deserializeWith(GResolveReviewThreadInput.serializer, json); } @@ -4203,8 +4147,9 @@ abstract class GSavedReplyOrder static Serializer get serializer => _$gSavedReplyOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GSavedReplyOrder.serializer, this); - static GSavedReplyOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GSavedReplyOrder.serializer, this) + as Map); + static GSavedReplyOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GSavedReplyOrder.serializer, json); } @@ -4277,9 +4222,10 @@ abstract class GSecurityAdvisoryIdentifierFilter String get value; static Serializer get serializer => _$gSecurityAdvisoryIdentifierFilterSerializer; - Map toJson() => _i1.serializers - .serializeWith(GSecurityAdvisoryIdentifierFilter.serializer, this); - static GSecurityAdvisoryIdentifierFilter fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GSecurityAdvisoryIdentifierFilter.serializer, this) + as Map); + static GSecurityAdvisoryIdentifierFilter? fromJson( Map json) => _i1.serializers .deserializeWith(GSecurityAdvisoryIdentifierFilter.serializer, json); @@ -4315,8 +4261,9 @@ abstract class GSecurityAdvisoryOrder static Serializer get serializer => _$gSecurityAdvisoryOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GSecurityAdvisoryOrder.serializer, this); - static GSecurityAdvisoryOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GSecurityAdvisoryOrder.serializer, this) + as Map); + static GSecurityAdvisoryOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GSecurityAdvisoryOrder.serializer, json); } @@ -4371,9 +4318,9 @@ abstract class GSecurityVulnerabilityOrder GSecurityVulnerabilityOrderField get field; static Serializer get serializer => _$gSecurityVulnerabilityOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GSecurityVulnerabilityOrder.serializer, this); - static GSecurityVulnerabilityOrder fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GSecurityVulnerabilityOrder.serializer, this) as Map); + static GSecurityVulnerabilityOrder? fromJson(Map json) => _i1.serializers .deserializeWith(GSecurityVulnerabilityOrder.serializer, json); } @@ -4404,8 +4351,9 @@ abstract class GSponsorsTierOrder static Serializer get serializer => _$gSponsorsTierOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GSponsorsTierOrder.serializer, this); - static GSponsorsTierOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GSponsorsTierOrder.serializer, this) + as Map); + static GSponsorsTierOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GSponsorsTierOrder.serializer, json); } @@ -4438,8 +4386,9 @@ abstract class GSponsorshipOrder static Serializer get serializer => _$gSponsorshipOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GSponsorshipOrder.serializer, this); - static GSponsorshipOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GSponsorshipOrder.serializer, this) + as Map); + static GSponsorshipOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GSponsorshipOrder.serializer, json); } @@ -4481,8 +4430,9 @@ abstract class GStarOrder implements Built { GStarOrderField get field; static Serializer get serializer => _$gStarOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GStarOrder.serializer, this); - static GStarOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GStarOrder.serializer, this) + as Map); + static GStarOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GStarOrder.serializer, json); } @@ -4525,20 +4475,16 @@ abstract class GSubmitPullRequestReviewInput [Function(GSubmitPullRequestReviewInputBuilder b) updates]) = _$GSubmitPullRequestReviewInput; - @nullable - String get body; - @nullable - String get clientMutationId; + String? get body; + String? get clientMutationId; GPullRequestReviewEvent get event; - @nullable - String get pullRequestId; - @nullable - String get pullRequestReviewId; + String? get pullRequestId; + String? get pullRequestReviewId; static Serializer get serializer => _$gSubmitPullRequestReviewInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GSubmitPullRequestReviewInput.serializer, this); - static GSubmitPullRequestReviewInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GSubmitPullRequestReviewInput.serializer, this) as Map); + static GSubmitPullRequestReviewInput? fromJson(Map json) => _i1.serializers .deserializeWith(GSubmitPullRequestReviewInput.serializer, json); } @@ -4573,9 +4519,9 @@ abstract class GTeamDiscussionCommentOrder GTeamDiscussionCommentOrderField get field; static Serializer get serializer => _$gTeamDiscussionCommentOrderSerializer; - Map toJson() => _i1.serializers - .serializeWith(GTeamDiscussionCommentOrder.serializer, this); - static GTeamDiscussionCommentOrder fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GTeamDiscussionCommentOrder.serializer, this) as Map); + static GTeamDiscussionCommentOrder? fromJson(Map json) => _i1.serializers .deserializeWith(GTeamDiscussionCommentOrder.serializer, json); } @@ -4607,8 +4553,9 @@ abstract class GTeamDiscussionOrder static Serializer get serializer => _$gTeamDiscussionOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GTeamDiscussionOrder.serializer, this); - static GTeamDiscussionOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GTeamDiscussionOrder.serializer, this) + as Map); + static GTeamDiscussionOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GTeamDiscussionOrder.serializer, json); } @@ -4638,8 +4585,9 @@ abstract class GTeamMemberOrder static Serializer get serializer => _$gTeamMemberOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GTeamMemberOrder.serializer, this); - static GTeamMemberOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GTeamMemberOrder.serializer, this) + as Map); + static GTeamMemberOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GTeamMemberOrder.serializer, json); } @@ -4698,8 +4646,9 @@ abstract class GTeamOrder implements Built { GTeamOrderField get field; static Serializer get serializer => _$gTeamOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GTeamOrder.serializer, this); - static GTeamOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GTeamOrder.serializer, this) + as Map); + static GTeamOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GTeamOrder.serializer, json); } @@ -4739,8 +4688,9 @@ abstract class GTeamRepositoryOrder static Serializer get serializer => _$gTeamRepositoryOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GTeamRepositoryOrder.serializer, this); - static GTeamRepositoryOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GTeamRepositoryOrder.serializer, this) + as Map); + static GTeamRepositoryOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GTeamRepositoryOrder.serializer, json); } @@ -4814,28 +4764,28 @@ abstract class GTransferIssueInput factory GTransferIssueInput( [Function(GTransferIssueInputBuilder b) updates]) = _$GTransferIssueInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get issueId; String get repositoryId; static Serializer get serializer => _$gTransferIssueInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GTransferIssueInput.serializer, this); - static GTransferIssueInput fromJson(Map json) => + (_i1.serializers.serializeWith(GTransferIssueInput.serializer, this) + as Map); + static GTransferIssueInput? fromJson(Map json) => _i1.serializers.deserializeWith(GTransferIssueInput.serializer, json); } abstract class GURI implements Built { GURI._(); - factory GURI([String value]) => + factory GURI([String? value]) => _$GURI((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GURI(serialized)); + (Object serialized) => GURI((serialized as String?))); } abstract class GUnarchiveRepositoryInput @@ -4847,14 +4797,14 @@ abstract class GUnarchiveRepositoryInput [Function(GUnarchiveRepositoryInputBuilder b) updates]) = _$GUnarchiveRepositoryInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get repositoryId; static Serializer get serializer => _$gUnarchiveRepositoryInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUnarchiveRepositoryInput.serializer, this); - static GUnarchiveRepositoryInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUnarchiveRepositoryInput.serializer, this) + as Map); + static GUnarchiveRepositoryInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUnarchiveRepositoryInput.serializer, json); } @@ -4866,14 +4816,14 @@ abstract class GUnfollowUserInput factory GUnfollowUserInput([Function(GUnfollowUserInputBuilder b) updates]) = _$GUnfollowUserInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get userId; static Serializer get serializer => _$gUnfollowUserInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUnfollowUserInput.serializer, this); - static GUnfollowUserInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUnfollowUserInput.serializer, this) + as Map); + static GUnfollowUserInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUnfollowUserInput.serializer, json); } @@ -4887,15 +4837,15 @@ abstract class GUnlinkRepositoryFromProjectInput [Function(GUnlinkRepositoryFromProjectInputBuilder b) updates]) = _$GUnlinkRepositoryFromProjectInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get projectId; String get repositoryId; static Serializer get serializer => _$gUnlinkRepositoryFromProjectInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUnlinkRepositoryFromProjectInput.serializer, this); - static GUnlinkRepositoryFromProjectInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GUnlinkRepositoryFromProjectInput.serializer, this) + as Map); + static GUnlinkRepositoryFromProjectInput? fromJson( Map json) => _i1.serializers .deserializeWith(GUnlinkRepositoryFromProjectInput.serializer, json); @@ -4909,14 +4859,14 @@ abstract class GUnlockLockableInput [Function(GUnlockLockableInputBuilder b) updates]) = _$GUnlockLockableInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get lockableId; static Serializer get serializer => _$gUnlockLockableInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUnlockLockableInput.serializer, this); - static GUnlockLockableInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUnlockLockableInput.serializer, this) + as Map); + static GUnlockLockableInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUnlockLockableInput.serializer, json); } @@ -4931,14 +4881,13 @@ abstract class GUnmarkIssueAsDuplicateInput _$GUnmarkIssueAsDuplicateInput; String get canonicalId; - @nullable - String get clientMutationId; + String? get clientMutationId; String get duplicateId; static Serializer get serializer => _$gUnmarkIssueAsDuplicateInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUnmarkIssueAsDuplicateInput.serializer, this); - static GUnmarkIssueAsDuplicateInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GUnmarkIssueAsDuplicateInput.serializer, this) as Map); + static GUnmarkIssueAsDuplicateInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUnmarkIssueAsDuplicateInput.serializer, json); } @@ -4952,14 +4901,13 @@ abstract class GUnresolveReviewThreadInput [Function(GUnresolveReviewThreadInputBuilder b) updates]) = _$GUnresolveReviewThreadInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get threadId; static Serializer get serializer => _$gUnresolveReviewThreadInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUnresolveReviewThreadInput.serializer, this); - static GUnresolveReviewThreadInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GUnresolveReviewThreadInput.serializer, this) as Map); + static GUnresolveReviewThreadInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUnresolveReviewThreadInput.serializer, json); } @@ -4975,38 +4923,28 @@ abstract class GUpdateBranchProtectionRuleInput _$GUpdateBranchProtectionRuleInput; String get branchProtectionRuleId; - @nullable - String get clientMutationId; - @nullable - bool get dismissesStaleReviews; - @nullable - bool get isAdminEnforced; - @nullable - String get pattern; - BuiltList get pushActorIds; - @nullable - int get requiredApprovingReviewCount; - BuiltList get requiredStatusCheckContexts; - @nullable - bool get requiresApprovingReviews; - @nullable - bool get requiresCodeOwnerReviews; - @nullable - bool get requiresCommitSignatures; - @nullable - bool get requiresStatusChecks; - @nullable - bool get requiresStrictStatusChecks; - @nullable - bool get restrictsPushes; - @nullable - bool get restrictsReviewDismissals; - BuiltList get reviewDismissalActorIds; + String? get clientMutationId; + bool? get dismissesStaleReviews; + bool? get isAdminEnforced; + String? get pattern; + BuiltList? get pushActorIds; + int? get requiredApprovingReviewCount; + BuiltList? get requiredStatusCheckContexts; + bool? get requiresApprovingReviews; + bool? get requiresCodeOwnerReviews; + bool? get requiresCommitSignatures; + bool? get requiresStatusChecks; + bool? get requiresStrictStatusChecks; + bool? get restrictsPushes; + bool? get restrictsReviewDismissals; + BuiltList? get reviewDismissalActorIds; static Serializer get serializer => _$gUpdateBranchProtectionRuleInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdateBranchProtectionRuleInput.serializer, this); - static GUpdateBranchProtectionRuleInput fromJson(Map json) => + Map toJson() => (_i1.serializers + .serializeWith(GUpdateBranchProtectionRuleInput.serializer, this) + as Map); + static GUpdateBranchProtectionRuleInput? fromJson( + Map json) => _i1.serializers .deserializeWith(GUpdateBranchProtectionRuleInput.serializer, json); } @@ -5022,15 +4960,15 @@ abstract class GUpdateEnterpriseActionExecutionCapabilitySettingInput updates]) = _$GUpdateEnterpriseActionExecutionCapabilitySettingInput; GActionExecutionCapabilitySetting get capability; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; static Serializer get serializer => _$gUpdateEnterpriseActionExecutionCapabilitySettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GUpdateEnterpriseActionExecutionCapabilitySettingInput.serializer, this); - static GUpdateEnterpriseActionExecutionCapabilitySettingInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseActionExecutionCapabilitySettingInput.serializer, + this) as Map); + static GUpdateEnterpriseActionExecutionCapabilitySettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseActionExecutionCapabilitySettingInput.serializer, @@ -5047,16 +4985,16 @@ abstract class GUpdateEnterpriseAdministratorRoleInput [Function(GUpdateEnterpriseAdministratorRoleInputBuilder b) updates]) = _$GUpdateEnterpriseAdministratorRoleInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; String get login; GEnterpriseAdministratorRole get role; static Serializer get serializer => _$gUpdateEnterpriseAdministratorRoleInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdateEnterpriseAdministratorRoleInput.serializer, this); - static GUpdateEnterpriseAdministratorRoleInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseAdministratorRoleInput.serializer, this) + as Map); + static GUpdateEnterpriseAdministratorRoleInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseAdministratorRoleInput.serializer, json); @@ -5074,17 +5012,16 @@ abstract class GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput b) updates]) = _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput.serializer, - this); - static GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput fromJson( + this) as Map); + static GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput.serializer, @@ -5102,17 +5039,16 @@ abstract class GUpdateEnterpriseDefaultRepositoryPermissionSettingInput GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder b) updates]) = _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseDefaultRepositoryPermissionSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseDefaultRepositoryPermissionSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseDefaultRepositoryPermissionSettingInput.serializer, - this); - static GUpdateEnterpriseDefaultRepositoryPermissionSettingInput fromJson( + this) as Map); + static GUpdateEnterpriseDefaultRepositoryPermissionSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseDefaultRepositoryPermissionSettingInput.serializer, @@ -5132,19 +5068,18 @@ abstract class GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput updates]) = _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer< GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput> get serializer => _$gUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput .serializer, - this); - static GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput + this) as Map); + static GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput? fromJson(Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput .serializer, @@ -5163,26 +5098,20 @@ abstract class GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput b) updates]) = _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; - @nullable - bool get membersCanCreateInternalRepositories; - @nullable - bool get membersCanCreatePrivateRepositories; - @nullable - bool get membersCanCreatePublicRepositories; - @nullable - bool get membersCanCreateRepositoriesPolicyEnabled; - @nullable - GEnterpriseMembersCanCreateRepositoriesSettingValue get settingValue; + bool? get membersCanCreateInternalRepositories; + bool? get membersCanCreatePrivateRepositories; + bool? get membersCanCreatePublicRepositories; + bool? get membersCanCreateRepositoriesPolicyEnabled; + GEnterpriseMembersCanCreateRepositoriesSettingValue? get settingValue; static Serializer get serializer => _$gUpdateEnterpriseMembersCanCreateRepositoriesSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput.serializer, - this); - static GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput fromJson( + this) as Map); + static GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput.serializer, @@ -5199,16 +5128,16 @@ abstract class GUpdateEnterpriseMembersCanDeleteIssuesSettingInput [Function(GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder b) updates]) = _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseMembersCanDeleteIssuesSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GUpdateEnterpriseMembersCanDeleteIssuesSettingInput.serializer, this); - static GUpdateEnterpriseMembersCanDeleteIssuesSettingInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseMembersCanDeleteIssuesSettingInput.serializer, this) + as Map); + static GUpdateEnterpriseMembersCanDeleteIssuesSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanDeleteIssuesSettingInput.serializer, json); @@ -5226,17 +5155,16 @@ abstract class GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput b) updates]) = _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput.serializer, - this); - static GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput fromJson( + this) as Map); + static GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput.serializer, @@ -5255,17 +5183,16 @@ abstract class GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput b) updates]) = _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput.serializer, - this); - static GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput fromJson( + this) as Map); + static GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput.serializer, @@ -5282,16 +5209,16 @@ abstract class GUpdateEnterpriseMembersCanMakePurchasesSettingInput [Function(GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder b) updates]) = _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseMembersCanMakePurchasesSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseMembersCanMakePurchasesSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GUpdateEnterpriseMembersCanMakePurchasesSettingInput.serializer, this); - static GUpdateEnterpriseMembersCanMakePurchasesSettingInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseMembersCanMakePurchasesSettingInput.serializer, this) + as Map); + static GUpdateEnterpriseMembersCanMakePurchasesSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanMakePurchasesSettingInput.serializer, @@ -5311,18 +5238,17 @@ abstract class GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput updates]) = _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer< GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput> get serializer => _$gUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput.serializer, - this); - static GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput + this) as Map); + static GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput? fromJson(Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput .serializer, @@ -5342,20 +5268,18 @@ abstract class GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput updates]) = _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer< GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput> get serializer => _$gUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput.serializer, - this); - static GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput fromJson( - Map json) => - _i1.serializers.deserializeWith( + this) as Map); + static GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput? + fromJson(Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput .serializer, json); @@ -5371,16 +5295,16 @@ abstract class GUpdateEnterpriseOrganizationProjectsSettingInput [Function(GUpdateEnterpriseOrganizationProjectsSettingInputBuilder b) updates]) = _$GUpdateEnterpriseOrganizationProjectsSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseOrganizationProjectsSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GUpdateEnterpriseOrganizationProjectsSettingInput.serializer, this); - static GUpdateEnterpriseOrganizationProjectsSettingInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseOrganizationProjectsSettingInput.serializer, this) + as Map); + static GUpdateEnterpriseOrganizationProjectsSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseOrganizationProjectsSettingInput.serializer, json); @@ -5396,22 +5320,17 @@ abstract class GUpdateEnterpriseProfileInput [Function(GUpdateEnterpriseProfileInputBuilder b) updates]) = _$GUpdateEnterpriseProfileInput; - @nullable - String get clientMutationId; - @nullable - String get description; + String? get clientMutationId; + String? get description; String get enterpriseId; - @nullable - String get location; - @nullable - String get name; - @nullable - String get websiteUrl; + String? get location; + String? get name; + String? get websiteUrl; static Serializer get serializer => _$gUpdateEnterpriseProfileInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdateEnterpriseProfileInput.serializer, this); - static GUpdateEnterpriseProfileInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseProfileInput.serializer, this) as Map); + static GUpdateEnterpriseProfileInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUpdateEnterpriseProfileInput.serializer, json); } @@ -5426,16 +5345,16 @@ abstract class GUpdateEnterpriseRepositoryProjectsSettingInput [Function(GUpdateEnterpriseRepositoryProjectsSettingInputBuilder b) updates]) = _$GUpdateEnterpriseRepositoryProjectsSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseRepositoryProjectsSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GUpdateEnterpriseRepositoryProjectsSettingInput.serializer, this); - static GUpdateEnterpriseRepositoryProjectsSettingInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseRepositoryProjectsSettingInput.serializer, this) + as Map); + static GUpdateEnterpriseRepositoryProjectsSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseRepositoryProjectsSettingInput.serializer, json); @@ -5451,16 +5370,16 @@ abstract class GUpdateEnterpriseTeamDiscussionsSettingInput [Function(GUpdateEnterpriseTeamDiscussionsSettingInputBuilder b) updates]) = _$GUpdateEnterpriseTeamDiscussionsSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledDisabledSettingValue get settingValue; static Serializer get serializer => _$gUpdateEnterpriseTeamDiscussionsSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( - GUpdateEnterpriseTeamDiscussionsSettingInput.serializer, this); - static GUpdateEnterpriseTeamDiscussionsSettingInput fromJson( + Map toJson() => (_i1.serializers.serializeWith( + GUpdateEnterpriseTeamDiscussionsSettingInput.serializer, this) + as Map); + static GUpdateEnterpriseTeamDiscussionsSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseTeamDiscussionsSettingInput.serializer, json); @@ -5479,18 +5398,17 @@ abstract class GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput updates]) = _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get enterpriseId; GEnterpriseEnabledSettingValue get settingValue; static Serializer< GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput> get serializer => _$gUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputSerializer; - Map toJson() => _i1.serializers.serializeWith( + Map toJson() => (_i1.serializers.serializeWith( GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput.serializer, - this); - static GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput fromJson( + this) as Map); + static GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput @@ -5508,14 +5426,14 @@ abstract class GUpdateIssueCommentInput _$GUpdateIssueCommentInput; String get body; - @nullable - String get clientMutationId; + String? get clientMutationId; String get id; static Serializer get serializer => _$gUpdateIssueCommentInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateIssueCommentInput.serializer, this); - static GUpdateIssueCommentInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateIssueCommentInput.serializer, this) + as Map); + static GUpdateIssueCommentInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUpdateIssueCommentInput.serializer, json); } @@ -5527,25 +5445,21 @@ abstract class GUpdateIssueInput factory GUpdateIssueInput([Function(GUpdateIssueInputBuilder b) updates]) = _$GUpdateIssueInput; - BuiltList get assigneeIds; - @nullable - String get body; - @nullable - String get clientMutationId; + BuiltList? get assigneeIds; + String? get body; + String? get clientMutationId; String get id; - BuiltList get labelIds; - @nullable - String get milestoneId; - BuiltList get projectIds; - @nullable - GIssueState get state; - @nullable - String get title; + BuiltList? get labelIds; + String? get milestoneId; + BuiltList? get projectIds; + GIssueState? get state; + String? get title; static Serializer get serializer => _$gUpdateIssueInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateIssueInput.serializer, this); - static GUpdateIssueInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateIssueInput.serializer, this) + as Map); + static GUpdateIssueInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdateIssueInput.serializer, json); } @@ -5557,18 +5471,16 @@ abstract class GUpdateProjectCardInput [Function(GUpdateProjectCardInputBuilder b) updates]) = _$GUpdateProjectCardInput; - @nullable - String get clientMutationId; - @nullable - bool get isArchived; - @nullable - String get note; + String? get clientMutationId; + bool? get isArchived; + String? get note; String get projectCardId; static Serializer get serializer => _$gUpdateProjectCardInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateProjectCardInput.serializer, this); - static GUpdateProjectCardInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateProjectCardInput.serializer, this) + as Map); + static GUpdateProjectCardInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdateProjectCardInput.serializer, json); } @@ -5581,15 +5493,15 @@ abstract class GUpdateProjectColumnInput [Function(GUpdateProjectColumnInputBuilder b) updates]) = _$GUpdateProjectColumnInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get name; String get projectColumnId; static Serializer get serializer => _$gUpdateProjectColumnInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateProjectColumnInput.serializer, this); - static GUpdateProjectColumnInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateProjectColumnInput.serializer, this) + as Map); + static GUpdateProjectColumnInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUpdateProjectColumnInput.serializer, json); } @@ -5601,22 +5513,18 @@ abstract class GUpdateProjectInput factory GUpdateProjectInput( [Function(GUpdateProjectInputBuilder b) updates]) = _$GUpdateProjectInput; - @nullable - String get body; - @nullable - String get clientMutationId; - @nullable - String get name; + String? get body; + String? get clientMutationId; + String? get name; String get projectId; - @nullable - bool get public; - @nullable - GProjectState get state; + bool? get public; + GProjectState? get state; static Serializer get serializer => _$gUpdateProjectInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateProjectInput.serializer, this); - static GUpdateProjectInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateProjectInput.serializer, this) + as Map); + static GUpdateProjectInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdateProjectInput.serializer, json); } @@ -5628,29 +5536,23 @@ abstract class GUpdatePullRequestInput [Function(GUpdatePullRequestInputBuilder b) updates]) = _$GUpdatePullRequestInput; - BuiltList get assigneeIds; - @nullable - String get baseRefName; - @nullable - String get body; - @nullable - String get clientMutationId; - BuiltList get labelIds; - @nullable - bool get maintainerCanModify; - @nullable - String get milestoneId; - BuiltList get projectIds; + BuiltList? get assigneeIds; + String? get baseRefName; + String? get body; + String? get clientMutationId; + BuiltList? get labelIds; + bool? get maintainerCanModify; + String? get milestoneId; + BuiltList? get projectIds; String get pullRequestId; - @nullable - GPullRequestUpdateState get state; - @nullable - String get title; + GPullRequestUpdateState? get state; + String? get title; static Serializer get serializer => _$gUpdatePullRequestInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdatePullRequestInput.serializer, this); - static GUpdatePullRequestInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdatePullRequestInput.serializer, this) + as Map); + static GUpdatePullRequestInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdatePullRequestInput.serializer, json); } @@ -5665,14 +5567,14 @@ abstract class GUpdatePullRequestReviewCommentInput _$GUpdatePullRequestReviewCommentInput; String get body; - @nullable - String get clientMutationId; + String? get clientMutationId; String get pullRequestReviewCommentId; static Serializer get serializer => _$gUpdatePullRequestReviewCommentInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdatePullRequestReviewCommentInput.serializer, this); - static GUpdatePullRequestReviewCommentInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GUpdatePullRequestReviewCommentInput.serializer, this) + as Map); + static GUpdatePullRequestReviewCommentInput? fromJson( Map json) => _i1.serializers.deserializeWith( GUpdatePullRequestReviewCommentInput.serializer, json); @@ -5689,14 +5591,13 @@ abstract class GUpdatePullRequestReviewInput _$GUpdatePullRequestReviewInput; String get body; - @nullable - String get clientMutationId; + String? get clientMutationId; String get pullRequestReviewId; static Serializer get serializer => _$gUpdatePullRequestReviewInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdatePullRequestReviewInput.serializer, this); - static GUpdatePullRequestReviewInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GUpdatePullRequestReviewInput.serializer, this) as Map); + static GUpdatePullRequestReviewInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUpdatePullRequestReviewInput.serializer, json); } @@ -5708,17 +5609,16 @@ abstract class GUpdateRefInput factory GUpdateRefInput([Function(GUpdateRefInputBuilder b) updates]) = _$GUpdateRefInput; - @nullable - String get clientMutationId; - @nullable - bool get force; + String? get clientMutationId; + bool? get force; GGitObjectID get oid; String get refId; static Serializer get serializer => _$gUpdateRefInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateRefInput.serializer, this); - static GUpdateRefInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateRefInput.serializer, this) + as Map); + static GUpdateRefInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdateRefInput.serializer, json); } @@ -5730,28 +5630,21 @@ abstract class GUpdateRepositoryInput [Function(GUpdateRepositoryInputBuilder b) updates]) = _$GUpdateRepositoryInput; - @nullable - String get clientMutationId; - @nullable - String get description; - @nullable - bool get hasIssuesEnabled; - @nullable - bool get hasProjectsEnabled; - @nullable - bool get hasWikiEnabled; - @nullable - GURI get homepageUrl; - @nullable - String get name; + String? get clientMutationId; + String? get description; + bool? get hasIssuesEnabled; + bool? get hasProjectsEnabled; + bool? get hasWikiEnabled; + GURI? get homepageUrl; + String? get name; String get repositoryId; - @nullable - bool get template; + bool? get template; static Serializer get serializer => _$gUpdateRepositoryInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateRepositoryInput.serializer, this); - static GUpdateRepositoryInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateRepositoryInput.serializer, this) + as Map); + static GUpdateRepositoryInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdateRepositoryInput.serializer, json); } @@ -5764,15 +5657,15 @@ abstract class GUpdateSubscriptionInput [Function(GUpdateSubscriptionInputBuilder b) updates]) = _$GUpdateSubscriptionInput; - @nullable - String get clientMutationId; + String? get clientMutationId; GSubscriptionState get state; String get subscribableId; static Serializer get serializer => _$gUpdateSubscriptionInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateSubscriptionInput.serializer, this); - static GUpdateSubscriptionInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateSubscriptionInput.serializer, this) + as Map); + static GUpdateSubscriptionInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUpdateSubscriptionInput.serializer, json); } @@ -5788,16 +5681,15 @@ abstract class GUpdateTeamDiscussionCommentInput _$GUpdateTeamDiscussionCommentInput; String get body; - @nullable - String get bodyVersion; - @nullable - String get clientMutationId; + String? get bodyVersion; + String? get clientMutationId; String get id; static Serializer get serializer => _$gUpdateTeamDiscussionCommentInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdateTeamDiscussionCommentInput.serializer, this); - static GUpdateTeamDiscussionCommentInput fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GUpdateTeamDiscussionCommentInput.serializer, this) + as Map); + static GUpdateTeamDiscussionCommentInput? fromJson( Map json) => _i1.serializers .deserializeWith(GUpdateTeamDiscussionCommentInput.serializer, json); @@ -5812,22 +5704,17 @@ abstract class GUpdateTeamDiscussionInput [Function(GUpdateTeamDiscussionInputBuilder b) updates]) = _$GUpdateTeamDiscussionInput; - @nullable - String get body; - @nullable - String get bodyVersion; - @nullable - String get clientMutationId; + String? get body; + String? get bodyVersion; + String? get clientMutationId; String get id; - @nullable - bool get pinned; - @nullable - String get title; + bool? get pinned; + String? get title; static Serializer get serializer => _$gUpdateTeamDiscussionInputSerializer; - Map toJson() => _i1.serializers - .serializeWith(GUpdateTeamDiscussionInput.serializer, this); - static GUpdateTeamDiscussionInput fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GUpdateTeamDiscussionInput.serializer, this) as Map); + static GUpdateTeamDiscussionInput? fromJson(Map json) => _i1.serializers .deserializeWith(GUpdateTeamDiscussionInput.serializer, json); } @@ -5839,15 +5726,15 @@ abstract class GUpdateTopicsInput factory GUpdateTopicsInput([Function(GUpdateTopicsInputBuilder b) updates]) = _$GUpdateTopicsInput; - @nullable - String get clientMutationId; + String? get clientMutationId; String get repositoryId; BuiltList get topicNames; static Serializer get serializer => _$gUpdateTopicsInputSerializer; Map toJson() => - _i1.serializers.serializeWith(GUpdateTopicsInput.serializer, this); - static GUpdateTopicsInput fromJson(Map json) => + (_i1.serializers.serializeWith(GUpdateTopicsInput.serializer, this) + as Map); + static GUpdateTopicsInput? fromJson(Map json) => _i1.serializers.deserializeWith(GUpdateTopicsInput.serializer, json); } @@ -5883,8 +5770,9 @@ abstract class GUserStatusOrder static Serializer get serializer => _$gUserStatusOrderSerializer; Map toJson() => - _i1.serializers.serializeWith(GUserStatusOrder.serializer, this); - static GUserStatusOrder fromJson(Map json) => + (_i1.serializers.serializeWith(GUserStatusOrder.serializer, this) + as Map); + static GUserStatusOrder? fromJson(Map json) => _i1.serializers.deserializeWith(GUserStatusOrder.serializer, json); } @@ -5906,12 +5794,12 @@ abstract class GX509Certificate implements Built { GX509Certificate._(); - factory GX509Certificate([String value]) => + factory GX509Certificate([String? value]) => _$GX509Certificate((b) => value != null ? (b..value = value) : b); String get value; @BuiltValueSerializer(custom: true) static Serializer get serializer => _i2.DefaultScalarSerializer( - (Object serialized) => GX509Certificate(serialized)); + (Object serialized) => GX509Certificate((serialized as String?))); } diff --git a/examples/gql_example_cli_github/lib/schema.schema.gql.g.dart b/examples/gql_example_cli_github/lib/schema.schema.gql.g.dart index 8557d3212..65a85882b 100644 --- a/examples/gql_example_cli_github/lib/schema.schema.gql.g.dart +++ b/examples/gql_example_cli_github/lib/schema.schema.gql.g.dart @@ -4712,18 +4712,20 @@ class _$GAcceptEnterpriseAdministratorInvitationInputSerializer final String wireName = 'GAcceptEnterpriseAdministratorInvitationInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GAcceptEnterpriseAdministratorInvitationInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'invitationId', serializers.serialize(object.invitationId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -4731,7 +4733,7 @@ class _$GAcceptEnterpriseAdministratorInvitationInputSerializer @override GAcceptEnterpriseAdministratorInvitationInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAcceptEnterpriseAdministratorInvitationInputBuilder(); @@ -4739,7 +4741,7 @@ class _$GAcceptEnterpriseAdministratorInvitationInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -4767,20 +4769,22 @@ class _$GAcceptTopicSuggestionInputSerializer final String wireName = 'GAcceptTopicSuggestionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAcceptTopicSuggestionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -4788,7 +4792,7 @@ class _$GAcceptTopicSuggestionInputSerializer @override GAcceptTopicSuggestionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAcceptTopicSuggestionInputBuilder(); @@ -4796,7 +4800,7 @@ class _$GAcceptTopicSuggestionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -4848,10 +4852,10 @@ class _$GAddAssigneesToAssignableInputSerializer final String wireName = 'GAddAssigneesToAssignableInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddAssigneesToAssignableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'assignableId', serializers.serialize(object.assignableId, specifiedType: const FullType(String)), @@ -4860,10 +4864,12 @@ class _$GAddAssigneesToAssignableInputSerializer specifiedType: const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -4871,7 +4877,7 @@ class _$GAddAssigneesToAssignableInputSerializer @override GAddAssigneesToAssignableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddAssigneesToAssignableInputBuilder(); @@ -4879,7 +4885,7 @@ class _$GAddAssigneesToAssignableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'assignableId': result.assignableId = serializers.deserialize(value, @@ -4887,8 +4893,8 @@ class _$GAddAssigneesToAssignableInputSerializer break; case 'assigneeIds': result.assigneeIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'clientMutationId': @@ -4910,19 +4916,21 @@ class _$GAddCommentInputSerializer final String wireName = 'GAddCommentInput'; @override - Iterable serialize(Serializers serializers, GAddCommentInput object, + Iterable serialize(Serializers serializers, GAddCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'subjectId', serializers.serialize(object.subjectId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -4930,7 +4938,7 @@ class _$GAddCommentInputSerializer @override GAddCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddCommentInputBuilder(); @@ -4938,7 +4946,7 @@ class _$GAddCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -4970,10 +4978,10 @@ class _$GAddLabelsToLabelableInputSerializer final String wireName = 'GAddLabelsToLabelableInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddLabelsToLabelableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'labelIds', serializers.serialize(object.labelIds, specifiedType: @@ -4982,10 +4990,12 @@ class _$GAddLabelsToLabelableInputSerializer serializers.serialize(object.labelableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -4993,7 +5003,7 @@ class _$GAddLabelsToLabelableInputSerializer @override GAddLabelsToLabelableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddLabelsToLabelableInputBuilder(); @@ -5001,7 +5011,7 @@ class _$GAddLabelsToLabelableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5009,8 +5019,8 @@ class _$GAddLabelsToLabelableInputSerializer break; case 'labelIds': result.labelIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'labelableId': @@ -5035,30 +5045,34 @@ class _$GAddProjectCardInputSerializer final String wireName = 'GAddProjectCardInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddProjectCardInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectColumnId', serializers.serialize(object.projectColumnId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.contentId != null) { + value = object.contentId; + if (value != null) { result ..add('contentId') - ..add(serializers.serialize(object.contentId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.note != null) { + value = object.note; + if (value != null) { result ..add('note') - ..add(serializers.serialize(object.note, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5066,7 +5080,7 @@ class _$GAddProjectCardInputSerializer @override GAddProjectCardInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddProjectCardInputBuilder(); @@ -5074,7 +5088,7 @@ class _$GAddProjectCardInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5110,20 +5124,22 @@ class _$GAddProjectColumnInputSerializer final String wireName = 'GAddProjectColumnInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddProjectColumnInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'projectId', serializers.serialize(object.projectId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5131,7 +5147,7 @@ class _$GAddProjectColumnInputSerializer @override GAddProjectColumnInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddProjectColumnInputBuilder(); @@ -5139,7 +5155,7 @@ class _$GAddProjectColumnInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5171,53 +5187,60 @@ class _$GAddPullRequestReviewCommentInputSerializer final String wireName = 'GAddPullRequestReviewCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddPullRequestReviewCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.commitOID != null) { + value = object.commitOID; + if (value != null) { result ..add('commitOID') - ..add(serializers.serialize(object.commitOID, + ..add(serializers.serialize(value, specifiedType: const FullType(GGitObjectID))); } - if (object.inReplyTo != null) { + value = object.inReplyTo; + if (value != null) { result ..add('inReplyTo') - ..add(serializers.serialize(object.inReplyTo, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.path != null) { + value = object.path; + if (value != null) { result ..add('path') - ..add(serializers.serialize(object.path, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.position != null) { + value = object.position; + if (value != null) { result ..add('position') - ..add(serializers.serialize(object.position, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.pullRequestId != null) { + value = object.pullRequestId; + if (value != null) { result ..add('pullRequestId') - ..add(serializers.serialize(object.pullRequestId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.pullRequestReviewId != null) { + value = object.pullRequestReviewId; + if (value != null) { result ..add('pullRequestReviewId') - ..add(serializers.serialize(object.pullRequestReviewId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5225,7 +5248,7 @@ class _$GAddPullRequestReviewCommentInputSerializer @override GAddPullRequestReviewCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddPullRequestReviewCommentInputBuilder(); @@ -5233,7 +5256,7 @@ class _$GAddPullRequestReviewCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -5245,7 +5268,7 @@ class _$GAddPullRequestReviewCommentInputSerializer break; case 'commitOID': result.commitOID.replace(serializers.deserialize(value, - specifiedType: const FullType(GGitObjectID)) as GGitObjectID); + specifiedType: const FullType(GGitObjectID))! as GGitObjectID); break; case 'inReplyTo': result.inReplyTo = serializers.deserialize(value, @@ -5285,43 +5308,49 @@ class _$GAddPullRequestReviewInputSerializer final String wireName = 'GAddPullRequestReviewInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAddPullRequestReviewInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pullRequestId', serializers.serialize(object.pullRequestId, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.comments != null) { + value = object.comments; + if (value != null) { result ..add('comments') - ..add(serializers.serialize(object.comments, + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, const [const FullType(GDraftPullRequestReviewComment)]))); } - if (object.commitOID != null) { + value = object.commitOID; + if (value != null) { result ..add('commitOID') - ..add(serializers.serialize(object.commitOID, + ..add(serializers.serialize(value, specifiedType: const FullType(GGitObjectID))); } - if (object.event != null) { + value = object.event; + if (value != null) { result ..add('event') - ..add(serializers.serialize(object.event, + ..add(serializers.serialize(value, specifiedType: const FullType(GPullRequestReviewEvent))); } return result; @@ -5329,7 +5358,7 @@ class _$GAddPullRequestReviewInputSerializer @override GAddPullRequestReviewInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddPullRequestReviewInputBuilder(); @@ -5337,7 +5366,7 @@ class _$GAddPullRequestReviewInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -5351,11 +5380,11 @@ class _$GAddPullRequestReviewInputSerializer result.comments.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GDraftPullRequestReviewComment) - ])) as BuiltList); + ]))! as BuiltList); break; case 'commitOID': result.commitOID.replace(serializers.deserialize(value, - specifiedType: const FullType(GGitObjectID)) as GGitObjectID); + specifiedType: const FullType(GGitObjectID))! as GGitObjectID); break; case 'event': result.event = serializers.deserialize(value, @@ -5381,9 +5410,9 @@ class _$GAddReactionInputSerializer final String wireName = 'GAddReactionInput'; @override - Iterable serialize(Serializers serializers, GAddReactionInput object, + Iterable serialize(Serializers serializers, GAddReactionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'content', serializers.serialize(object.content, specifiedType: const FullType(GReactionContent)), @@ -5391,10 +5420,12 @@ class _$GAddReactionInputSerializer serializers.serialize(object.subjectId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5402,7 +5433,7 @@ class _$GAddReactionInputSerializer @override GAddReactionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddReactionInputBuilder(); @@ -5410,7 +5441,7 @@ class _$GAddReactionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5439,17 +5470,19 @@ class _$GAddStarInputSerializer implements StructuredSerializer { final String wireName = 'GAddStarInput'; @override - Iterable serialize(Serializers serializers, GAddStarInput object, + Iterable serialize(Serializers serializers, GAddStarInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'starrableId', serializers.serialize(object.starrableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5457,7 +5490,7 @@ class _$GAddStarInputSerializer implements StructuredSerializer { @override GAddStarInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAddStarInputBuilder(); @@ -5465,7 +5498,7 @@ class _$GAddStarInputSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5493,18 +5526,20 @@ class _$GArchiveRepositoryInputSerializer final String wireName = 'GArchiveRepositoryInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GArchiveRepositoryInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5512,7 +5547,7 @@ class _$GArchiveRepositoryInputSerializer @override GArchiveRepositoryInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GArchiveRepositoryInputBuilder(); @@ -5520,7 +5555,7 @@ class _$GArchiveRepositoryInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5545,19 +5580,22 @@ class _$GAuditLogOrderSerializer final String wireName = 'GAuditLogOrder'; @override - Iterable serialize(Serializers serializers, GAuditLogOrder object, + Iterable serialize(Serializers serializers, GAuditLogOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.direction != null) { + final result = []; + Object? value; + value = object.direction; + if (value != null) { result ..add('direction') - ..add(serializers.serialize(object.direction, + ..add(serializers.serialize(value, specifiedType: const FullType(GOrderDirection))); } - if (object.field != null) { + value = object.field; + if (value != null) { result ..add('field') - ..add(serializers.serialize(object.field, + ..add(serializers.serialize(value, specifiedType: const FullType(GAuditLogOrderField))); } return result; @@ -5565,7 +5603,7 @@ class _$GAuditLogOrderSerializer @override GAuditLogOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAuditLogOrderBuilder(); @@ -5573,7 +5611,7 @@ class _$GAuditLogOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -5621,18 +5659,20 @@ class _$GCancelEnterpriseAdminInvitationInputSerializer final String wireName = 'GCancelEnterpriseAdminInvitationInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCancelEnterpriseAdminInvitationInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'invitationId', serializers.serialize(object.invitationId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5640,7 +5680,7 @@ class _$GCancelEnterpriseAdminInvitationInputSerializer @override GCancelEnterpriseAdminInvitationInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCancelEnterpriseAdminInvitationInputBuilder(); @@ -5648,7 +5688,7 @@ class _$GCancelEnterpriseAdminInvitationInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5676,44 +5716,51 @@ class _$GChangeUserStatusInputSerializer final String wireName = 'GChangeUserStatusInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GChangeUserStatusInput object, {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.clientMutationId != null) { + final result = []; + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.emoji != null) { + value = object.emoji; + if (value != null) { result ..add('emoji') - ..add(serializers.serialize(object.emoji, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.expiresAt != null) { + value = object.expiresAt; + if (value != null) { result ..add('expiresAt') - ..add(serializers.serialize(object.expiresAt, + ..add(serializers.serialize(value, specifiedType: const FullType(GDateTime))); } - if (object.limitedAvailability != null) { + value = object.limitedAvailability; + if (value != null) { result ..add('limitedAvailability') - ..add(serializers.serialize(object.limitedAvailability, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.message != null) { + value = object.message; + if (value != null) { result ..add('message') - ..add(serializers.serialize(object.message, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.organizationId != null) { + value = object.organizationId; + if (value != null) { result ..add('organizationId') - ..add(serializers.serialize(object.organizationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5721,7 +5768,7 @@ class _$GChangeUserStatusInputSerializer @override GChangeUserStatusInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GChangeUserStatusInputBuilder(); @@ -5729,7 +5776,7 @@ class _$GChangeUserStatusInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5741,7 +5788,7 @@ class _$GChangeUserStatusInputSerializer break; case 'expiresAt': result.expiresAt.replace(serializers.deserialize(value, - specifiedType: const FullType(GDateTime)) as GDateTime); + specifiedType: const FullType(GDateTime))! as GDateTime); break; case 'limitedAvailability': result.limitedAvailability = serializers.deserialize(value, @@ -5773,18 +5820,20 @@ class _$GClearLabelsFromLabelableInputSerializer final String wireName = 'GClearLabelsFromLabelableInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GClearLabelsFromLabelableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'labelableId', serializers.serialize(object.labelableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5792,7 +5841,7 @@ class _$GClearLabelsFromLabelableInputSerializer @override GClearLabelsFromLabelableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GClearLabelsFromLabelableInputBuilder(); @@ -5800,7 +5849,7 @@ class _$GClearLabelsFromLabelableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -5825,9 +5874,10 @@ class _$GCloneProjectInputSerializer final String wireName = 'GCloneProjectInput'; @override - Iterable serialize(Serializers serializers, GCloneProjectInput object, + Iterable serialize( + Serializers serializers, GCloneProjectInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'includeWorkflows', serializers.serialize(object.includeWorkflows, specifiedType: const FullType(bool)), @@ -5840,30 +5890,34 @@ class _$GCloneProjectInputSerializer serializers.serialize(object.targetOwnerId, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.public != null) { + value = object.public; + if (value != null) { result ..add('public') - ..add(serializers.serialize(object.public, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GCloneProjectInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCloneProjectInputBuilder(); @@ -5871,7 +5925,7 @@ class _$GCloneProjectInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -5919,10 +5973,10 @@ class _$GCloneTemplateRepositoryInputSerializer final String wireName = 'GCloneTemplateRepositoryInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCloneTemplateRepositoryInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'ownerId', @@ -5935,16 +5989,19 @@ class _$GCloneTemplateRepositoryInputSerializer serializers.serialize(object.visibility, specifiedType: const FullType(GRepositoryVisibility)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.description != null) { + value = object.description; + if (value != null) { result ..add('description') - ..add(serializers.serialize(object.description, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -5952,7 +6009,7 @@ class _$GCloneTemplateRepositoryInputSerializer @override GCloneTemplateRepositoryInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCloneTemplateRepositoryInputBuilder(); @@ -5960,7 +6017,7 @@ class _$GCloneTemplateRepositoryInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -6002,17 +6059,19 @@ class _$GCloseIssueInputSerializer final String wireName = 'GCloseIssueInput'; @override - Iterable serialize(Serializers serializers, GCloseIssueInput object, + Iterable serialize(Serializers serializers, GCloseIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'issueId', serializers.serialize(object.issueId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -6020,7 +6079,7 @@ class _$GCloseIssueInputSerializer @override GCloseIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCloseIssueInputBuilder(); @@ -6028,7 +6087,7 @@ class _$GCloseIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -6056,18 +6115,20 @@ class _$GClosePullRequestInputSerializer final String wireName = 'GClosePullRequestInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GClosePullRequestInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pullRequestId', serializers.serialize(object.pullRequestId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -6075,7 +6136,7 @@ class _$GClosePullRequestInputSerializer @override GClosePullRequestInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GClosePullRequestInputBuilder(); @@ -6083,7 +6144,7 @@ class _$GClosePullRequestInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -6164,18 +6225,23 @@ class _$GCommitAuthorSerializer implements StructuredSerializer { final String wireName = 'GCommitAuthor'; @override - Iterable serialize(Serializers serializers, GCommitAuthor object, + Iterable serialize(Serializers serializers, GCommitAuthor object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'emails', - serializers.serialize(object.emails, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - ]; - if (object.id != null) { + final result = []; + Object? value; + value = object.emails; + if (value != null) { + result + ..add('emails') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -6183,7 +6249,7 @@ class _$GCommitAuthorSerializer implements StructuredSerializer { @override GCommitAuthor deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCommitAuthorBuilder(); @@ -6191,12 +6257,12 @@ class _$GCommitAuthorSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'emails': result.emails.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'id': @@ -6221,10 +6287,10 @@ class _$GCommitContributionOrderSerializer final String wireName = 'GCommitContributionOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCommitContributionOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -6238,7 +6304,7 @@ class _$GCommitContributionOrderSerializer @override GCommitContributionOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCommitContributionOrderBuilder(); @@ -6246,7 +6312,7 @@ class _$GCommitContributionOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -6293,17 +6359,20 @@ class _$GContributionOrderSerializer final String wireName = 'GContributionOrder'; @override - Iterable serialize(Serializers serializers, GContributionOrder object, + Iterable serialize( + Serializers serializers, GContributionOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), ]; - if (object.field != null) { + Object? value; + value = object.field; + if (value != null) { result ..add('field') - ..add(serializers.serialize(object.field, + ..add(serializers.serialize(value, specifiedType: const FullType(GContributionOrderField))); } return result; @@ -6311,7 +6380,7 @@ class _$GContributionOrderSerializer @override GContributionOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GContributionOrderBuilder(); @@ -6319,7 +6388,7 @@ class _$GContributionOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -6368,10 +6437,10 @@ class _$GConvertProjectCardNoteToIssueInputSerializer final String wireName = 'GConvertProjectCardNoteToIssueInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GConvertProjectCardNoteToIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectCardId', serializers.serialize(object.projectCardId, specifiedType: const FullType(String)), @@ -6379,22 +6448,26 @@ class _$GConvertProjectCardNoteToIssueInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.title != null) { + value = object.title; + if (value != null) { result ..add('title') - ..add(serializers.serialize(object.title, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -6402,7 +6475,7 @@ class _$GConvertProjectCardNoteToIssueInputSerializer @override GConvertProjectCardNoteToIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GConvertProjectCardNoteToIssueInputBuilder(); @@ -6410,7 +6483,7 @@ class _$GConvertProjectCardNoteToIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -6450,101 +6523,124 @@ class _$GCreateBranchProtectionRuleInputSerializer final String wireName = 'GCreateBranchProtectionRuleInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateBranchProtectionRuleInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pattern', serializers.serialize(object.pattern, specifiedType: const FullType(String)), - 'pushActorIds', - serializers.serialize(object.pushActorIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), - 'requiredStatusCheckContexts', - serializers.serialize(object.requiredStatusCheckContexts, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'reviewDismissalActorIds', - serializers.serialize(object.reviewDismissalActorIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.dismissesStaleReviews != null) { + value = object.dismissesStaleReviews; + if (value != null) { result ..add('dismissesStaleReviews') - ..add(serializers.serialize(object.dismissesStaleReviews, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.isAdminEnforced != null) { + value = object.isAdminEnforced; + if (value != null) { result ..add('isAdminEnforced') - ..add(serializers.serialize(object.isAdminEnforced, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); + } + value = object.pushActorIds; + if (value != null) { + result + ..add('pushActorIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); } - if (object.requiredApprovingReviewCount != null) { + value = object.requiredApprovingReviewCount; + if (value != null) { result ..add('requiredApprovingReviewCount') - ..add(serializers.serialize(object.requiredApprovingReviewCount, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.requiredStatusCheckContexts; + if (value != null) { + result + ..add('requiredStatusCheckContexts') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); } - if (object.requiresApprovingReviews != null) { + value = object.requiresApprovingReviews; + if (value != null) { result ..add('requiresApprovingReviews') - ..add(serializers.serialize(object.requiresApprovingReviews, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresCodeOwnerReviews != null) { + value = object.requiresCodeOwnerReviews; + if (value != null) { result ..add('requiresCodeOwnerReviews') - ..add(serializers.serialize(object.requiresCodeOwnerReviews, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresCommitSignatures != null) { + value = object.requiresCommitSignatures; + if (value != null) { result ..add('requiresCommitSignatures') - ..add(serializers.serialize(object.requiresCommitSignatures, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresStatusChecks != null) { + value = object.requiresStatusChecks; + if (value != null) { result ..add('requiresStatusChecks') - ..add(serializers.serialize(object.requiresStatusChecks, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresStrictStatusChecks != null) { + value = object.requiresStrictStatusChecks; + if (value != null) { result ..add('requiresStrictStatusChecks') - ..add(serializers.serialize(object.requiresStrictStatusChecks, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.restrictsPushes != null) { + value = object.restrictsPushes; + if (value != null) { result ..add('restrictsPushes') - ..add(serializers.serialize(object.restrictsPushes, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.restrictsReviewDismissals != null) { + value = object.restrictsReviewDismissals; + if (value != null) { result ..add('restrictsReviewDismissals') - ..add(serializers.serialize(object.restrictsReviewDismissals, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); + } + value = object.reviewDismissalActorIds; + if (value != null) { + result + ..add('reviewDismissalActorIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); } return result; } @override GCreateBranchProtectionRuleInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateBranchProtectionRuleInputBuilder(); @@ -6552,7 +6648,7 @@ class _$GCreateBranchProtectionRuleInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -6572,8 +6668,8 @@ class _$GCreateBranchProtectionRuleInputSerializer break; case 'pushActorIds': result.pushActorIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'repositoryId': @@ -6587,8 +6683,8 @@ class _$GCreateBranchProtectionRuleInputSerializer case 'requiredStatusCheckContexts': result.requiredStatusCheckContexts.replace(serializers.deserialize( value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'requiresApprovingReviews': @@ -6621,8 +6717,8 @@ class _$GCreateBranchProtectionRuleInputSerializer break; case 'reviewDismissalActorIds': result.reviewDismissalActorIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; } @@ -6643,10 +6739,10 @@ class _$GCreateEnterpriseOrganizationInputSerializer final String wireName = 'GCreateEnterpriseOrganizationInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateEnterpriseOrganizationInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'adminLogins', serializers.serialize(object.adminLogins, specifiedType: @@ -6664,10 +6760,12 @@ class _$GCreateEnterpriseOrganizationInputSerializer serializers.serialize(object.profileName, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -6675,7 +6773,7 @@ class _$GCreateEnterpriseOrganizationInputSerializer @override GCreateEnterpriseOrganizationInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateEnterpriseOrganizationInputBuilder(); @@ -6683,12 +6781,12 @@ class _$GCreateEnterpriseOrganizationInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'adminLogins': result.adminLogins.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'billingEmail': @@ -6726,21 +6824,9 @@ class _$GCreateIssueInputSerializer final String wireName = 'GCreateIssueInput'; @override - Iterable serialize(Serializers serializers, GCreateIssueInput object, + Iterable serialize(Serializers serializers, GCreateIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'assigneeIds', - serializers.serialize(object.assigneeIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'labelIds', - serializers.serialize(object.labelIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'projectIds', - serializers.serialize(object.projectIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), + final result = [ 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), @@ -6748,30 +6834,58 @@ class _$GCreateIssueInputSerializer serializers.serialize(object.title, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.assigneeIds; + if (value != null) { + result + ..add('assigneeIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.milestoneId != null) { + value = object.labelIds; + if (value != null) { + result + ..add('labelIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.milestoneId; + if (value != null) { result ..add('milestoneId') - ..add(serializers.serialize(object.milestoneId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.projectIds; + if (value != null) { + result + ..add('projectIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } return result; } @override GCreateIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateIssueInputBuilder(); @@ -6779,12 +6893,12 @@ class _$GCreateIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'assigneeIds': result.assigneeIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'body': @@ -6797,8 +6911,8 @@ class _$GCreateIssueInputSerializer break; case 'labelIds': result.labelIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'milestoneId': @@ -6807,8 +6921,8 @@ class _$GCreateIssueInputSerializer break; case 'projectIds': result.projectIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'repositoryId': @@ -6837,36 +6951,44 @@ class _$GCreateProjectInputSerializer final String wireName = 'GCreateProjectInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateProjectInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'ownerId', serializers.serialize(object.ownerId, specifiedType: const FullType(String)), - 'repositoryIds', - serializers.serialize(object.repositoryIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.template != null) { + value = object.repositoryIds; + if (value != null) { + result + ..add('repositoryIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.template; + if (value != null) { result ..add('template') - ..add(serializers.serialize(object.template, + ..add(serializers.serialize(value, specifiedType: const FullType(GProjectTemplate))); } return result; @@ -6874,7 +6996,7 @@ class _$GCreateProjectInputSerializer @override GCreateProjectInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateProjectInputBuilder(); @@ -6882,7 +7004,7 @@ class _$GCreateProjectInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -6902,8 +7024,8 @@ class _$GCreateProjectInputSerializer break; case 'repositoryIds': result.repositoryIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'template': @@ -6929,10 +7051,10 @@ class _$GCreatePullRequestInputSerializer final String wireName = 'GCreatePullRequestInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreatePullRequestInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'baseRefName', serializers.serialize(object.baseRefName, specifiedType: const FullType(String)), @@ -6946,30 +7068,34 @@ class _$GCreatePullRequestInputSerializer serializers.serialize(object.title, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maintainerCanModify != null) { + value = object.maintainerCanModify; + if (value != null) { result ..add('maintainerCanModify') - ..add(serializers.serialize(object.maintainerCanModify, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GCreatePullRequestInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreatePullRequestInputBuilder(); @@ -6977,7 +7103,7 @@ class _$GCreatePullRequestInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'baseRefName': result.baseRefName = serializers.deserialize(value, @@ -7022,9 +7148,9 @@ class _$GCreateRefInputSerializer final String wireName = 'GCreateRefInput'; @override - Iterable serialize(Serializers serializers, GCreateRefInput object, + Iterable serialize(Serializers serializers, GCreateRefInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'oid', @@ -7034,10 +7160,12 @@ class _$GCreateRefInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7045,7 +7173,7 @@ class _$GCreateRefInputSerializer @override GCreateRefInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateRefInputBuilder(); @@ -7053,7 +7181,7 @@ class _$GCreateRefInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7065,7 +7193,7 @@ class _$GCreateRefInputSerializer break; case 'oid': result.oid.replace(serializers.deserialize(value, - specifiedType: const FullType(GGitObjectID)) as GGitObjectID); + specifiedType: const FullType(GGitObjectID))! as GGitObjectID); break; case 'repositoryId': result.repositoryId = serializers.deserialize(value, @@ -7089,70 +7217,79 @@ class _$GCreateRepositoryInputSerializer final String wireName = 'GCreateRepositoryInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateRepositoryInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'visibility', serializers.serialize(object.visibility, specifiedType: const FullType(GRepositoryVisibility)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.description != null) { + value = object.description; + if (value != null) { result ..add('description') - ..add(serializers.serialize(object.description, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.hasIssuesEnabled != null) { + value = object.hasIssuesEnabled; + if (value != null) { result ..add('hasIssuesEnabled') - ..add(serializers.serialize(object.hasIssuesEnabled, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.hasWikiEnabled != null) { + value = object.hasWikiEnabled; + if (value != null) { result ..add('hasWikiEnabled') - ..add(serializers.serialize(object.hasWikiEnabled, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.homepageUrl != null) { + value = object.homepageUrl; + if (value != null) { result ..add('homepageUrl') - ..add(serializers.serialize(object.homepageUrl, - specifiedType: const FullType(GURI))); + ..add( + serializers.serialize(value, specifiedType: const FullType(GURI))); } - if (object.ownerId != null) { + value = object.ownerId; + if (value != null) { result ..add('ownerId') - ..add(serializers.serialize(object.ownerId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.teamId != null) { + value = object.teamId; + if (value != null) { result ..add('teamId') - ..add(serializers.serialize(object.teamId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.template != null) { + value = object.template; + if (value != null) { result ..add('template') - ..add(serializers.serialize(object.template, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GCreateRepositoryInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateRepositoryInputBuilder(); @@ -7160,7 +7297,7 @@ class _$GCreateRepositoryInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7180,7 +7317,7 @@ class _$GCreateRepositoryInputSerializer break; case 'homepageUrl': result.homepageUrl.replace(serializers.deserialize(value, - specifiedType: const FullType(GURI)) as GURI); + specifiedType: const FullType(GURI))! as GURI); break; case 'name': result.name = serializers.deserialize(value, @@ -7221,20 +7358,22 @@ class _$GCreateTeamDiscussionCommentInputSerializer final String wireName = 'GCreateTeamDiscussionCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateTeamDiscussionCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'discussionId', serializers.serialize(object.discussionId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7242,7 +7381,7 @@ class _$GCreateTeamDiscussionCommentInputSerializer @override GCreateTeamDiscussionCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateTeamDiscussionCommentInputBuilder(); @@ -7250,7 +7389,7 @@ class _$GCreateTeamDiscussionCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -7282,10 +7421,10 @@ class _$GCreateTeamDiscussionInputSerializer final String wireName = 'GCreateTeamDiscussionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GCreateTeamDiscussionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'teamId', @@ -7295,24 +7434,27 @@ class _$GCreateTeamDiscussionInputSerializer serializers.serialize(object.title, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.private != null) { + value = object.private; + if (value != null) { result ..add('private') - ..add(serializers.serialize(object.private, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GCreateTeamDiscussionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GCreateTeamDiscussionInputBuilder(); @@ -7320,7 +7462,7 @@ class _$GCreateTeamDiscussionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -7360,10 +7502,10 @@ class _$GDeclineTopicSuggestionInputSerializer final String wireName = 'GDeclineTopicSuggestionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeclineTopicSuggestionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'reason', @@ -7373,10 +7515,12 @@ class _$GDeclineTopicSuggestionInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7384,7 +7528,7 @@ class _$GDeclineTopicSuggestionInputSerializer @override GDeclineTopicSuggestionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeclineTopicSuggestionInputBuilder(); @@ -7392,7 +7536,7 @@ class _$GDeclineTopicSuggestionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7449,18 +7593,20 @@ class _$GDeleteBranchProtectionRuleInputSerializer final String wireName = 'GDeleteBranchProtectionRuleInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteBranchProtectionRuleInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'branchProtectionRuleId', serializers.serialize(object.branchProtectionRuleId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7468,7 +7614,7 @@ class _$GDeleteBranchProtectionRuleInputSerializer @override GDeleteBranchProtectionRuleInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteBranchProtectionRuleInputBuilder(); @@ -7476,7 +7622,7 @@ class _$GDeleteBranchProtectionRuleInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'branchProtectionRuleId': result.branchProtectionRuleId = serializers.deserialize(value, @@ -7504,17 +7650,19 @@ class _$GDeleteDeploymentInputSerializer final String wireName = 'GDeleteDeploymentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteDeploymentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7522,7 +7670,7 @@ class _$GDeleteDeploymentInputSerializer @override GDeleteDeploymentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteDeploymentInputBuilder(); @@ -7530,7 +7678,7 @@ class _$GDeleteDeploymentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7558,17 +7706,19 @@ class _$GDeleteIssueCommentInputSerializer final String wireName = 'GDeleteIssueCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteIssueCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7576,7 +7726,7 @@ class _$GDeleteIssueCommentInputSerializer @override GDeleteIssueCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteIssueCommentInputBuilder(); @@ -7584,7 +7734,7 @@ class _$GDeleteIssueCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7609,17 +7759,19 @@ class _$GDeleteIssueInputSerializer final String wireName = 'GDeleteIssueInput'; @override - Iterable serialize(Serializers serializers, GDeleteIssueInput object, + Iterable serialize(Serializers serializers, GDeleteIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'issueId', serializers.serialize(object.issueId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7627,7 +7779,7 @@ class _$GDeleteIssueInputSerializer @override GDeleteIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteIssueInputBuilder(); @@ -7635,7 +7787,7 @@ class _$GDeleteIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7663,18 +7815,20 @@ class _$GDeleteProjectCardInputSerializer final String wireName = 'GDeleteProjectCardInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteProjectCardInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'cardId', serializers.serialize(object.cardId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7682,7 +7836,7 @@ class _$GDeleteProjectCardInputSerializer @override GDeleteProjectCardInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteProjectCardInputBuilder(); @@ -7690,7 +7844,7 @@ class _$GDeleteProjectCardInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'cardId': result.cardId = serializers.deserialize(value, @@ -7718,18 +7872,20 @@ class _$GDeleteProjectColumnInputSerializer final String wireName = 'GDeleteProjectColumnInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteProjectColumnInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'columnId', serializers.serialize(object.columnId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7737,7 +7893,7 @@ class _$GDeleteProjectColumnInputSerializer @override GDeleteProjectColumnInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteProjectColumnInputBuilder(); @@ -7745,7 +7901,7 @@ class _$GDeleteProjectColumnInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7773,18 +7929,20 @@ class _$GDeleteProjectInputSerializer final String wireName = 'GDeleteProjectInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteProjectInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectId', serializers.serialize(object.projectId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7792,7 +7950,7 @@ class _$GDeleteProjectInputSerializer @override GDeleteProjectInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteProjectInputBuilder(); @@ -7800,7 +7958,7 @@ class _$GDeleteProjectInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7828,17 +7986,19 @@ class _$GDeletePullRequestReviewCommentInputSerializer final String wireName = 'GDeletePullRequestReviewCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeletePullRequestReviewCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7846,7 +8006,7 @@ class _$GDeletePullRequestReviewCommentInputSerializer @override GDeletePullRequestReviewCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeletePullRequestReviewCommentInputBuilder(); @@ -7854,7 +8014,7 @@ class _$GDeletePullRequestReviewCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7882,18 +8042,20 @@ class _$GDeletePullRequestReviewInputSerializer final String wireName = 'GDeletePullRequestReviewInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeletePullRequestReviewInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pullRequestReviewId', serializers.serialize(object.pullRequestReviewId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7901,7 +8063,7 @@ class _$GDeletePullRequestReviewInputSerializer @override GDeletePullRequestReviewInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeletePullRequestReviewInputBuilder(); @@ -7909,7 +8071,7 @@ class _$GDeletePullRequestReviewInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7934,17 +8096,19 @@ class _$GDeleteRefInputSerializer final String wireName = 'GDeleteRefInput'; @override - Iterable serialize(Serializers serializers, GDeleteRefInput object, + Iterable serialize(Serializers serializers, GDeleteRefInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'refId', serializers.serialize(object.refId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -7952,7 +8116,7 @@ class _$GDeleteRefInputSerializer @override GDeleteRefInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteRefInputBuilder(); @@ -7960,7 +8124,7 @@ class _$GDeleteRefInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -7988,17 +8152,19 @@ class _$GDeleteTeamDiscussionCommentInputSerializer final String wireName = 'GDeleteTeamDiscussionCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteTeamDiscussionCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -8006,7 +8172,7 @@ class _$GDeleteTeamDiscussionCommentInputSerializer @override GDeleteTeamDiscussionCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteTeamDiscussionCommentInputBuilder(); @@ -8014,7 +8180,7 @@ class _$GDeleteTeamDiscussionCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -8042,17 +8208,19 @@ class _$GDeleteTeamDiscussionInputSerializer final String wireName = 'GDeleteTeamDiscussionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDeleteTeamDiscussionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -8060,7 +8228,7 @@ class _$GDeleteTeamDiscussionInputSerializer @override GDeleteTeamDiscussionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeleteTeamDiscussionInputBuilder(); @@ -8068,7 +8236,7 @@ class _$GDeleteTeamDiscussionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -8093,9 +8261,9 @@ class _$GDeploymentOrderSerializer final String wireName = 'GDeploymentOrder'; @override - Iterable serialize(Serializers serializers, GDeploymentOrder object, + Iterable serialize(Serializers serializers, GDeploymentOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8109,7 +8277,7 @@ class _$GDeploymentOrderSerializer @override GDeploymentOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDeploymentOrderBuilder(); @@ -8117,7 +8285,7 @@ class _$GDeploymentOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8201,10 +8369,10 @@ class _$GDismissPullRequestReviewInputSerializer final String wireName = 'GDismissPullRequestReviewInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDismissPullRequestReviewInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'message', serializers.serialize(object.message, specifiedType: const FullType(String)), @@ -8212,10 +8380,12 @@ class _$GDismissPullRequestReviewInputSerializer serializers.serialize(object.pullRequestReviewId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -8223,7 +8393,7 @@ class _$GDismissPullRequestReviewInputSerializer @override GDismissPullRequestReviewInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDismissPullRequestReviewInputBuilder(); @@ -8231,7 +8401,7 @@ class _$GDismissPullRequestReviewInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -8263,10 +8433,10 @@ class _$GDraftPullRequestReviewCommentSerializer final String wireName = 'GDraftPullRequestReviewComment'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GDraftPullRequestReviewComment object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'path', @@ -8281,7 +8451,7 @@ class _$GDraftPullRequestReviewCommentSerializer @override GDraftPullRequestReviewComment deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GDraftPullRequestReviewCommentBuilder(); @@ -8289,7 +8459,7 @@ class _$GDraftPullRequestReviewCommentSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -8321,10 +8491,10 @@ class _$GEnterpriseAdministratorInvitationOrderSerializer final String wireName = 'GEnterpriseAdministratorInvitationOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GEnterpriseAdministratorInvitationOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8339,7 +8509,7 @@ class _$GEnterpriseAdministratorInvitationOrderSerializer @override GEnterpriseAdministratorInvitationOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GEnterpriseAdministratorInvitationOrderBuilder(); @@ -8347,7 +8517,7 @@ class _$GEnterpriseAdministratorInvitationOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8488,10 +8658,10 @@ class _$GEnterpriseMemberOrderSerializer final String wireName = 'GEnterpriseMemberOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GEnterpriseMemberOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8505,7 +8675,7 @@ class _$GEnterpriseMemberOrderSerializer @override GEnterpriseMemberOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GEnterpriseMemberOrderBuilder(); @@ -8513,7 +8683,7 @@ class _$GEnterpriseMemberOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8611,10 +8781,10 @@ class _$GEnterpriseServerInstallationOrderSerializer final String wireName = 'GEnterpriseServerInstallationOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GEnterpriseServerInstallationOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8629,7 +8799,7 @@ class _$GEnterpriseServerInstallationOrderSerializer @override GEnterpriseServerInstallationOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GEnterpriseServerInstallationOrderBuilder(); @@ -8637,7 +8807,7 @@ class _$GEnterpriseServerInstallationOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8690,10 +8860,10 @@ class _$GEnterpriseServerUserAccountEmailOrderSerializer final String wireName = 'GEnterpriseServerUserAccountEmailOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GEnterpriseServerUserAccountEmailOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8708,7 +8878,7 @@ class _$GEnterpriseServerUserAccountEmailOrderSerializer @override GEnterpriseServerUserAccountEmailOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GEnterpriseServerUserAccountEmailOrderBuilder(); @@ -8716,7 +8886,7 @@ class _$GEnterpriseServerUserAccountEmailOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8770,10 +8940,10 @@ class _$GEnterpriseServerUserAccountOrderSerializer final String wireName = 'GEnterpriseServerUserAccountOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GEnterpriseServerUserAccountOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8788,7 +8958,7 @@ class _$GEnterpriseServerUserAccountOrderSerializer @override GEnterpriseServerUserAccountOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GEnterpriseServerUserAccountOrderBuilder(); @@ -8796,7 +8966,7 @@ class _$GEnterpriseServerUserAccountOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8849,10 +9019,10 @@ class _$GEnterpriseServerUserAccountsUploadOrderSerializer final String wireName = 'GEnterpriseServerUserAccountsUploadOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GEnterpriseServerUserAccountsUploadOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -8867,7 +9037,7 @@ class _$GEnterpriseServerUserAccountsUploadOrderSerializer @override GEnterpriseServerUserAccountsUploadOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GEnterpriseServerUserAccountsUploadOrderBuilder(); @@ -8875,7 +9045,7 @@ class _$GEnterpriseServerUserAccountsUploadOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -8992,17 +9162,19 @@ class _$GFollowUserInputSerializer final String wireName = 'GFollowUserInput'; @override - Iterable serialize(Serializers serializers, GFollowUserInput object, + Iterable serialize(Serializers serializers, GFollowUserInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'userId', serializers.serialize(object.userId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -9010,7 +9182,7 @@ class _$GFollowUserInputSerializer @override GFollowUserInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GFollowUserInputBuilder(); @@ -9018,7 +9190,7 @@ class _$GFollowUserInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -9060,9 +9232,9 @@ class _$GGistOrderSerializer implements StructuredSerializer { final String wireName = 'GGistOrder'; @override - Iterable serialize(Serializers serializers, GGistOrder object, + Iterable serialize(Serializers serializers, GGistOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -9075,7 +9247,7 @@ class _$GGistOrderSerializer implements StructuredSerializer { } @override - GGistOrder deserialize(Serializers serializers, Iterable serialized, + GGistOrder deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GGistOrderBuilder(); @@ -9083,7 +9255,7 @@ class _$GGistOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -9188,36 +9360,41 @@ class _$GInviteEnterpriseAdminInputSerializer final String wireName = 'GInviteEnterpriseAdminInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GInviteEnterpriseAdminInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.email != null) { + value = object.email; + if (value != null) { result ..add('email') - ..add(serializers.serialize(object.email, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.invitee != null) { + value = object.invitee; + if (value != null) { result ..add('invitee') - ..add(serializers.serialize(object.invitee, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.role != null) { + value = object.role; + if (value != null) { result ..add('role') - ..add(serializers.serialize(object.role, + ..add(serializers.serialize(value, specifiedType: const FullType(GEnterpriseAdministratorRole))); } return result; @@ -9225,7 +9402,7 @@ class _$GInviteEnterpriseAdminInputSerializer @override GInviteEnterpriseAdminInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GInviteEnterpriseAdminInputBuilder(); @@ -9233,7 +9410,7 @@ class _$GInviteEnterpriseAdminInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -9270,60 +9447,74 @@ class _$GIssueFiltersSerializer implements StructuredSerializer { final String wireName = 'GIssueFilters'; @override - Iterable serialize(Serializers serializers, GIssueFilters object, + Iterable serialize(Serializers serializers, GIssueFilters object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'labels', - serializers.serialize(object.labels, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'states', - serializers.serialize(object.states, - specifiedType: - const FullType(BuiltList, const [const FullType(GIssueState)])), - ]; - if (object.assignee != null) { + final result = []; + Object? value; + value = object.assignee; + if (value != null) { result ..add('assignee') - ..add(serializers.serialize(object.assignee, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.createdBy != null) { + value = object.createdBy; + if (value != null) { result ..add('createdBy') - ..add(serializers.serialize(object.createdBy, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.mentioned != null) { + value = object.labels; + if (value != null) { + result + ..add('labels') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.mentioned; + if (value != null) { result ..add('mentioned') - ..add(serializers.serialize(object.mentioned, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.milestone != null) { + value = object.milestone; + if (value != null) { result ..add('milestone') - ..add(serializers.serialize(object.milestone, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.since != null) { + value = object.since; + if (value != null) { result ..add('since') - ..add(serializers.serialize(object.since, + ..add(serializers.serialize(value, specifiedType: const FullType(GDateTime))); } - if (object.viewerSubscribed != null) { + value = object.states; + if (value != null) { + result + ..add('states') + ..add(serializers.serialize(value, + specifiedType: const FullType( + BuiltList, const [const FullType(GIssueState)]))); + } + value = object.viewerSubscribed; + if (value != null) { result ..add('viewerSubscribed') - ..add(serializers.serialize(object.viewerSubscribed, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GIssueFilters deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GIssueFiltersBuilder(); @@ -9331,7 +9522,7 @@ class _$GIssueFiltersSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'assignee': result.assignee = serializers.deserialize(value, @@ -9343,8 +9534,8 @@ class _$GIssueFiltersSerializer implements StructuredSerializer { break; case 'labels': result.labels.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'mentioned': @@ -9357,12 +9548,12 @@ class _$GIssueFiltersSerializer implements StructuredSerializer { break; case 'since': result.since.replace(serializers.deserialize(value, - specifiedType: const FullType(GDateTime)) as GDateTime); + specifiedType: const FullType(GDateTime))! as GDateTime); break; case 'states': result.states.replace(serializers.deserialize(value, specifiedType: const FullType( - BuiltList, const [const FullType(GIssueState)])) + BuiltList, const [const FullType(GIssueState)]))! as BuiltList); break; case 'viewerSubscribed': @@ -9383,9 +9574,9 @@ class _$GIssueOrderSerializer implements StructuredSerializer { final String wireName = 'GIssueOrder'; @override - Iterable serialize(Serializers serializers, GIssueOrder object, + Iterable serialize(Serializers serializers, GIssueOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -9398,7 +9589,7 @@ class _$GIssueOrderSerializer implements StructuredSerializer { } @override - GIssueOrder deserialize(Serializers serializers, Iterable serialized, + GIssueOrder deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GIssueOrderBuilder(); @@ -9406,7 +9597,7 @@ class _$GIssueOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -9486,9 +9677,9 @@ class _$GLabelOrderSerializer implements StructuredSerializer { final String wireName = 'GLabelOrder'; @override - Iterable serialize(Serializers serializers, GLabelOrder object, + Iterable serialize(Serializers serializers, GLabelOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -9501,7 +9692,7 @@ class _$GLabelOrderSerializer implements StructuredSerializer { } @override - GLabelOrder deserialize(Serializers serializers, Iterable serialized, + GLabelOrder deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GLabelOrderBuilder(); @@ -9509,7 +9700,7 @@ class _$GLabelOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -9554,9 +9745,9 @@ class _$GLanguageOrderSerializer final String wireName = 'GLanguageOrder'; @override - Iterable serialize(Serializers serializers, GLanguageOrder object, + Iterable serialize(Serializers serializers, GLanguageOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -9570,7 +9761,7 @@ class _$GLanguageOrderSerializer @override GLanguageOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GLanguageOrderBuilder(); @@ -9578,7 +9769,7 @@ class _$GLanguageOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -9626,10 +9817,10 @@ class _$GLinkRepositoryToProjectInputSerializer final String wireName = 'GLinkRepositoryToProjectInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GLinkRepositoryToProjectInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectId', serializers.serialize(object.projectId, specifiedType: const FullType(String)), @@ -9637,10 +9828,12 @@ class _$GLinkRepositoryToProjectInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -9648,7 +9841,7 @@ class _$GLinkRepositoryToProjectInputSerializer @override GLinkRepositoryToProjectInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GLinkRepositoryToProjectInputBuilder(); @@ -9656,7 +9849,7 @@ class _$GLinkRepositoryToProjectInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -9685,23 +9878,27 @@ class _$GLockLockableInputSerializer final String wireName = 'GLockLockableInput'; @override - Iterable serialize(Serializers serializers, GLockLockableInput object, + Iterable serialize( + Serializers serializers, GLockLockableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'lockableId', serializers.serialize(object.lockableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.lockReason != null) { + value = object.lockReason; + if (value != null) { result ..add('lockReason') - ..add(serializers.serialize(object.lockReason, + ..add(serializers.serialize(value, specifiedType: const FullType(GLockReason))); } return result; @@ -9709,7 +9906,7 @@ class _$GLockLockableInputSerializer @override GLockLockableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GLockLockableInputBuilder(); @@ -9717,7 +9914,7 @@ class _$GLockLockableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -9763,9 +9960,9 @@ class _$GMergeBranchInputSerializer final String wireName = 'GMergeBranchInput'; @override - Iterable serialize(Serializers serializers, GMergeBranchInput object, + Iterable serialize(Serializers serializers, GMergeBranchInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'base', serializers.serialize(object.base, specifiedType: const FullType(String)), 'head', @@ -9774,16 +9971,19 @@ class _$GMergeBranchInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.commitMessage != null) { + value = object.commitMessage; + if (value != null) { result ..add('commitMessage') - ..add(serializers.serialize(object.commitMessage, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -9791,7 +9991,7 @@ class _$GMergeBranchInputSerializer @override GMergeBranchInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GMergeBranchInputBuilder(); @@ -9799,7 +9999,7 @@ class _$GMergeBranchInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'base': result.base = serializers.deserialize(value, @@ -9839,42 +10039,48 @@ class _$GMergePullRequestInputSerializer final String wireName = 'GMergePullRequestInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GMergePullRequestInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pullRequestId', serializers.serialize(object.pullRequestId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.commitBody != null) { + value = object.commitBody; + if (value != null) { result ..add('commitBody') - ..add(serializers.serialize(object.commitBody, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.commitHeadline != null) { + value = object.commitHeadline; + if (value != null) { result ..add('commitHeadline') - ..add(serializers.serialize(object.commitHeadline, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.expectedHeadOid != null) { + value = object.expectedHeadOid; + if (value != null) { result ..add('expectedHeadOid') - ..add(serializers.serialize(object.expectedHeadOid, + ..add(serializers.serialize(value, specifiedType: const FullType(GGitObjectID))); } - if (object.mergeMethod != null) { + value = object.mergeMethod; + if (value != null) { result ..add('mergeMethod') - ..add(serializers.serialize(object.mergeMethod, + ..add(serializers.serialize(value, specifiedType: const FullType(GPullRequestMergeMethod))); } return result; @@ -9882,7 +10088,7 @@ class _$GMergePullRequestInputSerializer @override GMergePullRequestInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GMergePullRequestInputBuilder(); @@ -9890,7 +10096,7 @@ class _$GMergePullRequestInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -9906,7 +10112,7 @@ class _$GMergePullRequestInputSerializer break; case 'expectedHeadOid': result.expectedHeadOid.replace(serializers.deserialize(value, - specifiedType: const FullType(GGitObjectID)) as GGitObjectID); + specifiedType: const FullType(GGitObjectID))! as GGitObjectID); break; case 'mergeMethod': result.mergeMethod = serializers.deserialize(value, @@ -9950,9 +10156,9 @@ class _$GMilestoneOrderSerializer final String wireName = 'GMilestoneOrder'; @override - Iterable serialize(Serializers serializers, GMilestoneOrder object, + Iterable serialize(Serializers serializers, GMilestoneOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -9966,7 +10172,7 @@ class _$GMilestoneOrderSerializer @override GMilestoneOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GMilestoneOrderBuilder(); @@ -9974,7 +10180,7 @@ class _$GMilestoneOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -10040,10 +10246,10 @@ class _$GMoveProjectCardInputSerializer final String wireName = 'GMoveProjectCardInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GMoveProjectCardInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'cardId', serializers.serialize(object.cardId, specifiedType: const FullType(String)), @@ -10051,16 +10257,19 @@ class _$GMoveProjectCardInputSerializer serializers.serialize(object.columnId, specifiedType: const FullType(String)), ]; - if (object.afterCardId != null) { + Object? value; + value = object.afterCardId; + if (value != null) { result ..add('afterCardId') - ..add(serializers.serialize(object.afterCardId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -10068,7 +10277,7 @@ class _$GMoveProjectCardInputSerializer @override GMoveProjectCardInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GMoveProjectCardInputBuilder(); @@ -10076,7 +10285,7 @@ class _$GMoveProjectCardInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'afterCardId': result.afterCardId = serializers.deserialize(value, @@ -10112,24 +10321,27 @@ class _$GMoveProjectColumnInputSerializer final String wireName = 'GMoveProjectColumnInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GMoveProjectColumnInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'columnId', serializers.serialize(object.columnId, specifiedType: const FullType(String)), ]; - if (object.afterColumnId != null) { + Object? value; + value = object.afterColumnId; + if (value != null) { result ..add('afterColumnId') - ..add(serializers.serialize(object.afterColumnId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -10137,7 +10349,7 @@ class _$GMoveProjectColumnInputSerializer @override GMoveProjectColumnInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GMoveProjectColumnInputBuilder(); @@ -10145,7 +10357,7 @@ class _$GMoveProjectColumnInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'afterColumnId': result.afterColumnId = serializers.deserialize(value, @@ -10545,9 +10757,10 @@ class _$GOrganizationOrderSerializer final String wireName = 'GOrganizationOrder'; @override - Iterable serialize(Serializers serializers, GOrganizationOrder object, + Iterable serialize( + Serializers serializers, GOrganizationOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -10561,7 +10774,7 @@ class _$GOrganizationOrderSerializer @override GOrganizationOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GOrganizationOrderBuilder(); @@ -10569,7 +10782,7 @@ class _$GOrganizationOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -10687,9 +10900,9 @@ class _$GProjectOrderSerializer implements StructuredSerializer { final String wireName = 'GProjectOrder'; @override - Iterable serialize(Serializers serializers, GProjectOrder object, + Iterable serialize(Serializers serializers, GProjectOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -10703,7 +10916,7 @@ class _$GProjectOrderSerializer implements StructuredSerializer { @override GProjectOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GProjectOrderBuilder(); @@ -10711,7 +10924,7 @@ class _$GProjectOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -10810,9 +11023,9 @@ class _$GPullRequestOrderSerializer final String wireName = 'GPullRequestOrder'; @override - Iterable serialize(Serializers serializers, GPullRequestOrder object, + Iterable serialize(Serializers serializers, GPullRequestOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -10826,7 +11039,7 @@ class _$GPullRequestOrderSerializer @override GPullRequestOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPullRequestOrderBuilder(); @@ -10834,7 +11047,7 @@ class _$GPullRequestOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -11012,9 +11225,9 @@ class _$GReactionOrderSerializer final String wireName = 'GReactionOrder'; @override - Iterable serialize(Serializers serializers, GReactionOrder object, + Iterable serialize(Serializers serializers, GReactionOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -11028,7 +11241,7 @@ class _$GReactionOrderSerializer @override GReactionOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReactionOrderBuilder(); @@ -11036,7 +11249,7 @@ class _$GReactionOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -11080,9 +11293,9 @@ class _$GRefOrderSerializer implements StructuredSerializer { final String wireName = 'GRefOrder'; @override - Iterable serialize(Serializers serializers, GRefOrder object, + Iterable serialize(Serializers serializers, GRefOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -11095,7 +11308,7 @@ class _$GRefOrderSerializer implements StructuredSerializer { } @override - GRefOrder deserialize(Serializers serializers, Iterable serialized, + GRefOrder deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRefOrderBuilder(); @@ -11103,7 +11316,7 @@ class _$GRefOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -11153,18 +11366,20 @@ class _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInputSerializer 'GRegenerateEnterpriseIdentityProviderRecoveryCodesInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GRegenerateEnterpriseIdentityProviderRecoveryCodesInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11172,7 +11387,7 @@ class _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInputSerializer @override GRegenerateEnterpriseIdentityProviderRecoveryCodesInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder(); @@ -11181,7 +11396,7 @@ class _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11229,28 +11444,30 @@ class _$GRegistryPackageMetadatumSerializer final String wireName = 'GRegistryPackageMetadatum'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRegistryPackageMetadatum object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'value', serializers.serialize(object.value, specifiedType: const FullType(String)), ]; - if (object.update != null) { + Object? value; + value = object.update; + if (value != null) { result ..add('update') - ..add(serializers.serialize(object.update, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GRegistryPackageMetadatum deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRegistryPackageMetadatumBuilder(); @@ -11258,7 +11475,7 @@ class _$GRegistryPackageMetadatumSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'name': result.name = serializers.deserialize(value, @@ -11304,9 +11521,9 @@ class _$GReleaseOrderSerializer implements StructuredSerializer { final String wireName = 'GReleaseOrder'; @override - Iterable serialize(Serializers serializers, GReleaseOrder object, + Iterable serialize(Serializers serializers, GReleaseOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -11320,7 +11537,7 @@ class _$GReleaseOrderSerializer implements StructuredSerializer { @override GReleaseOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReleaseOrderBuilder(); @@ -11328,7 +11545,7 @@ class _$GReleaseOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -11376,10 +11593,10 @@ class _$GRemoveAssigneesFromAssignableInputSerializer final String wireName = 'GRemoveAssigneesFromAssignableInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveAssigneesFromAssignableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'assignableId', serializers.serialize(object.assignableId, specifiedType: const FullType(String)), @@ -11388,10 +11605,12 @@ class _$GRemoveAssigneesFromAssignableInputSerializer specifiedType: const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11399,7 +11618,7 @@ class _$GRemoveAssigneesFromAssignableInputSerializer @override GRemoveAssigneesFromAssignableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveAssigneesFromAssignableInputBuilder(); @@ -11407,7 +11626,7 @@ class _$GRemoveAssigneesFromAssignableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'assignableId': result.assignableId = serializers.deserialize(value, @@ -11415,8 +11634,8 @@ class _$GRemoveAssigneesFromAssignableInputSerializer break; case 'assigneeIds': result.assigneeIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'clientMutationId': @@ -11441,10 +11660,10 @@ class _$GRemoveEnterpriseAdminInputSerializer final String wireName = 'GRemoveEnterpriseAdminInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveEnterpriseAdminInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -11452,10 +11671,12 @@ class _$GRemoveEnterpriseAdminInputSerializer serializers.serialize(object.login, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11463,7 +11684,7 @@ class _$GRemoveEnterpriseAdminInputSerializer @override GRemoveEnterpriseAdminInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveEnterpriseAdminInputBuilder(); @@ -11471,7 +11692,7 @@ class _$GRemoveEnterpriseAdminInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11503,10 +11724,10 @@ class _$GRemoveEnterpriseOrganizationInputSerializer final String wireName = 'GRemoveEnterpriseOrganizationInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveEnterpriseOrganizationInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -11514,10 +11735,12 @@ class _$GRemoveEnterpriseOrganizationInputSerializer serializers.serialize(object.organizationId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11525,7 +11748,7 @@ class _$GRemoveEnterpriseOrganizationInputSerializer @override GRemoveEnterpriseOrganizationInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveEnterpriseOrganizationInputBuilder(); @@ -11533,7 +11756,7 @@ class _$GRemoveEnterpriseOrganizationInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11565,10 +11788,10 @@ class _$GRemoveLabelsFromLabelableInputSerializer final String wireName = 'GRemoveLabelsFromLabelableInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveLabelsFromLabelableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'labelIds', serializers.serialize(object.labelIds, specifiedType: @@ -11577,10 +11800,12 @@ class _$GRemoveLabelsFromLabelableInputSerializer serializers.serialize(object.labelableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11588,7 +11813,7 @@ class _$GRemoveLabelsFromLabelableInputSerializer @override GRemoveLabelsFromLabelableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveLabelsFromLabelableInputBuilder(); @@ -11596,7 +11821,7 @@ class _$GRemoveLabelsFromLabelableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11604,8 +11829,8 @@ class _$GRemoveLabelsFromLabelableInputSerializer break; case 'labelIds': result.labelIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'labelableId': @@ -11630,10 +11855,10 @@ class _$GRemoveOutsideCollaboratorInputSerializer final String wireName = 'GRemoveOutsideCollaboratorInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveOutsideCollaboratorInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'organizationId', serializers.serialize(object.organizationId, specifiedType: const FullType(String)), @@ -11641,10 +11866,12 @@ class _$GRemoveOutsideCollaboratorInputSerializer serializers.serialize(object.userId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11652,7 +11879,7 @@ class _$GRemoveOutsideCollaboratorInputSerializer @override GRemoveOutsideCollaboratorInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveOutsideCollaboratorInputBuilder(); @@ -11660,7 +11887,7 @@ class _$GRemoveOutsideCollaboratorInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11692,10 +11919,10 @@ class _$GRemoveReactionInputSerializer final String wireName = 'GRemoveReactionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRemoveReactionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'content', serializers.serialize(object.content, specifiedType: const FullType(GReactionContent)), @@ -11703,10 +11930,12 @@ class _$GRemoveReactionInputSerializer serializers.serialize(object.subjectId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11714,7 +11943,7 @@ class _$GRemoveReactionInputSerializer @override GRemoveReactionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveReactionInputBuilder(); @@ -11722,7 +11951,7 @@ class _$GRemoveReactionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11752,17 +11981,19 @@ class _$GRemoveStarInputSerializer final String wireName = 'GRemoveStarInput'; @override - Iterable serialize(Serializers serializers, GRemoveStarInput object, + Iterable serialize(Serializers serializers, GRemoveStarInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'starrableId', serializers.serialize(object.starrableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11770,7 +12001,7 @@ class _$GRemoveStarInputSerializer @override GRemoveStarInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRemoveStarInputBuilder(); @@ -11778,7 +12009,7 @@ class _$GRemoveStarInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11803,17 +12034,19 @@ class _$GReopenIssueInputSerializer final String wireName = 'GReopenIssueInput'; @override - Iterable serialize(Serializers serializers, GReopenIssueInput object, + Iterable serialize(Serializers serializers, GReopenIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'issueId', serializers.serialize(object.issueId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11821,7 +12054,7 @@ class _$GReopenIssueInputSerializer @override GReopenIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReopenIssueInputBuilder(); @@ -11829,7 +12062,7 @@ class _$GReopenIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -11857,18 +12090,20 @@ class _$GReopenPullRequestInputSerializer final String wireName = 'GReopenPullRequestInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GReopenPullRequestInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pullRequestId', serializers.serialize(object.pullRequestId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -11876,7 +12111,7 @@ class _$GReopenPullRequestInputSerializer @override GReopenPullRequestInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GReopenPullRequestInputBuilder(); @@ -11884,7 +12119,7 @@ class _$GReopenPullRequestInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -12093,10 +12328,10 @@ class _$GRepositoryInvitationOrderSerializer final String wireName = 'GRepositoryInvitationOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRepositoryInvitationOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12110,7 +12345,7 @@ class _$GRepositoryInvitationOrderSerializer @override GRepositoryInvitationOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRepositoryInvitationOrderBuilder(); @@ -12118,7 +12353,7 @@ class _$GRepositoryInvitationOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12184,9 +12419,9 @@ class _$GRepositoryOrderSerializer final String wireName = 'GRepositoryOrder'; @override - Iterable serialize(Serializers serializers, GRepositoryOrder object, + Iterable serialize(Serializers serializers, GRepositoryOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12200,7 +12435,7 @@ class _$GRepositoryOrderSerializer @override GRepositoryOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRepositoryOrderBuilder(); @@ -12208,7 +12443,7 @@ class _$GRepositoryOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12310,40 +12545,51 @@ class _$GRequestReviewsInputSerializer final String wireName = 'GRequestReviewsInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GRequestReviewsInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'pullRequestId', serializers.serialize(object.pullRequestId, specifiedType: const FullType(String)), - 'teamIds', - serializers.serialize(object.teamIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'userIds', - serializers.serialize(object.userIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.union != null) { + value = object.teamIds; + if (value != null) { + result + ..add('teamIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.union; + if (value != null) { result ..add('union') - ..add(serializers.serialize(object.union, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); + } + value = object.userIds; + if (value != null) { + result + ..add('userIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); } return result; } @override GRequestReviewsInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GRequestReviewsInputBuilder(); @@ -12351,7 +12597,7 @@ class _$GRequestReviewsInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -12363,8 +12609,8 @@ class _$GRequestReviewsInputSerializer break; case 'teamIds': result.teamIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'union': @@ -12373,8 +12619,8 @@ class _$GRequestReviewsInputSerializer break; case 'userIds': result.userIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; } @@ -12395,18 +12641,20 @@ class _$GResolveReviewThreadInputSerializer final String wireName = 'GResolveReviewThreadInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GResolveReviewThreadInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'threadId', serializers.serialize(object.threadId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -12414,7 +12662,7 @@ class _$GResolveReviewThreadInputSerializer @override GResolveReviewThreadInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GResolveReviewThreadInputBuilder(); @@ -12422,7 +12670,7 @@ class _$GResolveReviewThreadInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -12484,9 +12732,9 @@ class _$GSavedReplyOrderSerializer final String wireName = 'GSavedReplyOrder'; @override - Iterable serialize(Serializers serializers, GSavedReplyOrder object, + Iterable serialize(Serializers serializers, GSavedReplyOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12500,7 +12748,7 @@ class _$GSavedReplyOrderSerializer @override GSavedReplyOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSavedReplyOrderBuilder(); @@ -12508,7 +12756,7 @@ class _$GSavedReplyOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12592,10 +12840,10 @@ class _$GSecurityAdvisoryIdentifierFilterSerializer final String wireName = 'GSecurityAdvisoryIdentifierFilter'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GSecurityAdvisoryIdentifierFilter object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'type', serializers.serialize(object.type, specifiedType: const FullType(GSecurityAdvisoryIdentifierType)), @@ -12609,7 +12857,7 @@ class _$GSecurityAdvisoryIdentifierFilterSerializer @override GSecurityAdvisoryIdentifierFilter deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSecurityAdvisoryIdentifierFilterBuilder(); @@ -12617,7 +12865,7 @@ class _$GSecurityAdvisoryIdentifierFilterSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'type': result.type = serializers.deserialize(value, @@ -12667,10 +12915,10 @@ class _$GSecurityAdvisoryOrderSerializer final String wireName = 'GSecurityAdvisoryOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GSecurityAdvisoryOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12684,7 +12932,7 @@ class _$GSecurityAdvisoryOrderSerializer @override GSecurityAdvisoryOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSecurityAdvisoryOrderBuilder(); @@ -12692,7 +12940,7 @@ class _$GSecurityAdvisoryOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12760,10 +13008,10 @@ class _$GSecurityVulnerabilityOrderSerializer final String wireName = 'GSecurityVulnerabilityOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GSecurityVulnerabilityOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12777,7 +13025,7 @@ class _$GSecurityVulnerabilityOrderSerializer @override GSecurityVulnerabilityOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSecurityVulnerabilityOrderBuilder(); @@ -12785,7 +13033,7 @@ class _$GSecurityVulnerabilityOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12833,9 +13081,10 @@ class _$GSponsorsTierOrderSerializer final String wireName = 'GSponsorsTierOrder'; @override - Iterable serialize(Serializers serializers, GSponsorsTierOrder object, + Iterable serialize( + Serializers serializers, GSponsorsTierOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12849,7 +13098,7 @@ class _$GSponsorsTierOrderSerializer @override GSponsorsTierOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSponsorsTierOrderBuilder(); @@ -12857,7 +13106,7 @@ class _$GSponsorsTierOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12903,9 +13152,9 @@ class _$GSponsorshipOrderSerializer final String wireName = 'GSponsorshipOrder'; @override - Iterable serialize(Serializers serializers, GSponsorshipOrder object, + Iterable serialize(Serializers serializers, GSponsorshipOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -12919,7 +13168,7 @@ class _$GSponsorshipOrderSerializer @override GSponsorshipOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSponsorshipOrderBuilder(); @@ -12927,7 +13176,7 @@ class _$GSponsorshipOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -12989,9 +13238,9 @@ class _$GStarOrderSerializer implements StructuredSerializer { final String wireName = 'GStarOrder'; @override - Iterable serialize(Serializers serializers, GStarOrder object, + Iterable serialize(Serializers serializers, GStarOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -13004,7 +13253,7 @@ class _$GStarOrderSerializer implements StructuredSerializer { } @override - GStarOrder deserialize(Serializers serializers, Iterable serialized, + GStarOrder deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GStarOrderBuilder(); @@ -13012,7 +13261,7 @@ class _$GStarOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -13077,36 +13326,41 @@ class _$GSubmitPullRequestReviewInputSerializer final String wireName = 'GSubmitPullRequestReviewInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GSubmitPullRequestReviewInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'event', serializers.serialize(object.event, specifiedType: const FullType(GPullRequestReviewEvent)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.pullRequestId != null) { + value = object.pullRequestId; + if (value != null) { result ..add('pullRequestId') - ..add(serializers.serialize(object.pullRequestId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.pullRequestReviewId != null) { + value = object.pullRequestReviewId; + if (value != null) { result ..add('pullRequestReviewId') - ..add(serializers.serialize(object.pullRequestReviewId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13114,7 +13368,7 @@ class _$GSubmitPullRequestReviewInputSerializer @override GSubmitPullRequestReviewInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GSubmitPullRequestReviewInputBuilder(); @@ -13122,7 +13376,7 @@ class _$GSubmitPullRequestReviewInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -13181,10 +13435,10 @@ class _$GTeamDiscussionCommentOrderSerializer final String wireName = 'GTeamDiscussionCommentOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GTeamDiscussionCommentOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -13198,7 +13452,7 @@ class _$GTeamDiscussionCommentOrderSerializer @override GTeamDiscussionCommentOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GTeamDiscussionCommentOrderBuilder(); @@ -13206,7 +13460,7 @@ class _$GTeamDiscussionCommentOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -13257,10 +13511,10 @@ class _$GTeamDiscussionOrderSerializer final String wireName = 'GTeamDiscussionOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GTeamDiscussionOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -13274,7 +13528,7 @@ class _$GTeamDiscussionOrderSerializer @override GTeamDiscussionOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GTeamDiscussionOrderBuilder(); @@ -13282,7 +13536,7 @@ class _$GTeamDiscussionOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -13328,9 +13582,9 @@ class _$GTeamMemberOrderSerializer final String wireName = 'GTeamMemberOrder'; @override - Iterable serialize(Serializers serializers, GTeamMemberOrder object, + Iterable serialize(Serializers serializers, GTeamMemberOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -13344,7 +13598,7 @@ class _$GTeamMemberOrderSerializer @override GTeamMemberOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GTeamMemberOrderBuilder(); @@ -13352,7 +13606,7 @@ class _$GTeamMemberOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -13432,9 +13686,9 @@ class _$GTeamOrderSerializer implements StructuredSerializer { final String wireName = 'GTeamOrder'; @override - Iterable serialize(Serializers serializers, GTeamOrder object, + Iterable serialize(Serializers serializers, GTeamOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -13447,7 +13701,7 @@ class _$GTeamOrderSerializer implements StructuredSerializer { } @override - GTeamOrder deserialize(Serializers serializers, Iterable serialized, + GTeamOrder deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GTeamOrderBuilder(); @@ -13455,7 +13709,7 @@ class _$GTeamOrderSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -13520,10 +13774,10 @@ class _$GTeamRepositoryOrderSerializer final String wireName = 'GTeamRepositoryOrder'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GTeamRepositoryOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -13537,7 +13791,7 @@ class _$GTeamRepositoryOrderSerializer @override GTeamRepositoryOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GTeamRepositoryOrderBuilder(); @@ -13545,7 +13799,7 @@ class _$GTeamRepositoryOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -13631,10 +13885,10 @@ class _$GTransferIssueInputSerializer final String wireName = 'GTransferIssueInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GTransferIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'issueId', serializers.serialize(object.issueId, specifiedType: const FullType(String)), @@ -13642,10 +13896,12 @@ class _$GTransferIssueInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13653,7 +13909,7 @@ class _$GTransferIssueInputSerializer @override GTransferIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GTransferIssueInputBuilder(); @@ -13661,7 +13917,7 @@ class _$GTransferIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -13693,18 +13949,20 @@ class _$GUnarchiveRepositoryInputSerializer final String wireName = 'GUnarchiveRepositoryInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUnarchiveRepositoryInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13712,7 +13970,7 @@ class _$GUnarchiveRepositoryInputSerializer @override GUnarchiveRepositoryInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUnarchiveRepositoryInputBuilder(); @@ -13720,7 +13978,7 @@ class _$GUnarchiveRepositoryInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -13745,17 +14003,20 @@ class _$GUnfollowUserInputSerializer final String wireName = 'GUnfollowUserInput'; @override - Iterable serialize(Serializers serializers, GUnfollowUserInput object, + Iterable serialize( + Serializers serializers, GUnfollowUserInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'userId', serializers.serialize(object.userId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13763,7 +14024,7 @@ class _$GUnfollowUserInputSerializer @override GUnfollowUserInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUnfollowUserInputBuilder(); @@ -13771,7 +14032,7 @@ class _$GUnfollowUserInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -13799,10 +14060,10 @@ class _$GUnlinkRepositoryFromProjectInputSerializer final String wireName = 'GUnlinkRepositoryFromProjectInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUnlinkRepositoryFromProjectInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectId', serializers.serialize(object.projectId, specifiedType: const FullType(String)), @@ -13810,10 +14071,12 @@ class _$GUnlinkRepositoryFromProjectInputSerializer serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13821,7 +14084,7 @@ class _$GUnlinkRepositoryFromProjectInputSerializer @override GUnlinkRepositoryFromProjectInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUnlinkRepositoryFromProjectInputBuilder(); @@ -13829,7 +14092,7 @@ class _$GUnlinkRepositoryFromProjectInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -13861,18 +14124,20 @@ class _$GUnlockLockableInputSerializer final String wireName = 'GUnlockLockableInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUnlockLockableInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'lockableId', serializers.serialize(object.lockableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13880,7 +14145,7 @@ class _$GUnlockLockableInputSerializer @override GUnlockLockableInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUnlockLockableInputBuilder(); @@ -13888,7 +14153,7 @@ class _$GUnlockLockableInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -13916,10 +14181,10 @@ class _$GUnmarkIssueAsDuplicateInputSerializer final String wireName = 'GUnmarkIssueAsDuplicateInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUnmarkIssueAsDuplicateInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'canonicalId', serializers.serialize(object.canonicalId, specifiedType: const FullType(String)), @@ -13927,10 +14192,12 @@ class _$GUnmarkIssueAsDuplicateInputSerializer serializers.serialize(object.duplicateId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13938,7 +14205,7 @@ class _$GUnmarkIssueAsDuplicateInputSerializer @override GUnmarkIssueAsDuplicateInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUnmarkIssueAsDuplicateInputBuilder(); @@ -13946,7 +14213,7 @@ class _$GUnmarkIssueAsDuplicateInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'canonicalId': result.canonicalId = serializers.deserialize(value, @@ -13978,18 +14245,20 @@ class _$GUnresolveReviewThreadInputSerializer final String wireName = 'GUnresolveReviewThreadInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUnresolveReviewThreadInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'threadId', serializers.serialize(object.threadId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -13997,7 +14266,7 @@ class _$GUnresolveReviewThreadInputSerializer @override GUnresolveReviewThreadInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUnresolveReviewThreadInputBuilder(); @@ -14005,7 +14274,7 @@ class _$GUnresolveReviewThreadInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14033,104 +14302,128 @@ class _$GUpdateBranchProtectionRuleInputSerializer final String wireName = 'GUpdateBranchProtectionRuleInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateBranchProtectionRuleInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'branchProtectionRuleId', serializers.serialize(object.branchProtectionRuleId, specifiedType: const FullType(String)), - 'pushActorIds', - serializers.serialize(object.pushActorIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'requiredStatusCheckContexts', - serializers.serialize(object.requiredStatusCheckContexts, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'reviewDismissalActorIds', - serializers.serialize(object.reviewDismissalActorIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.dismissesStaleReviews != null) { + value = object.dismissesStaleReviews; + if (value != null) { result ..add('dismissesStaleReviews') - ..add(serializers.serialize(object.dismissesStaleReviews, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.isAdminEnforced != null) { + value = object.isAdminEnforced; + if (value != null) { result ..add('isAdminEnforced') - ..add(serializers.serialize(object.isAdminEnforced, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.pattern != null) { + value = object.pattern; + if (value != null) { result ..add('pattern') - ..add(serializers.serialize(object.pattern, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.requiredApprovingReviewCount != null) { + value = object.pushActorIds; + if (value != null) { + result + ..add('pushActorIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.requiredApprovingReviewCount; + if (value != null) { result ..add('requiredApprovingReviewCount') - ..add(serializers.serialize(object.requiredApprovingReviewCount, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.requiredStatusCheckContexts; + if (value != null) { + result + ..add('requiredStatusCheckContexts') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); } - if (object.requiresApprovingReviews != null) { + value = object.requiresApprovingReviews; + if (value != null) { result ..add('requiresApprovingReviews') - ..add(serializers.serialize(object.requiresApprovingReviews, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresCodeOwnerReviews != null) { + value = object.requiresCodeOwnerReviews; + if (value != null) { result ..add('requiresCodeOwnerReviews') - ..add(serializers.serialize(object.requiresCodeOwnerReviews, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresCommitSignatures != null) { + value = object.requiresCommitSignatures; + if (value != null) { result ..add('requiresCommitSignatures') - ..add(serializers.serialize(object.requiresCommitSignatures, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresStatusChecks != null) { + value = object.requiresStatusChecks; + if (value != null) { result ..add('requiresStatusChecks') - ..add(serializers.serialize(object.requiresStatusChecks, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.requiresStrictStatusChecks != null) { + value = object.requiresStrictStatusChecks; + if (value != null) { result ..add('requiresStrictStatusChecks') - ..add(serializers.serialize(object.requiresStrictStatusChecks, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.restrictsPushes != null) { + value = object.restrictsPushes; + if (value != null) { result ..add('restrictsPushes') - ..add(serializers.serialize(object.restrictsPushes, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.restrictsReviewDismissals != null) { + value = object.restrictsReviewDismissals; + if (value != null) { result ..add('restrictsReviewDismissals') - ..add(serializers.serialize(object.restrictsReviewDismissals, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); + } + value = object.reviewDismissalActorIds; + if (value != null) { + result + ..add('reviewDismissalActorIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); } return result; } @override GUpdateBranchProtectionRuleInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateBranchProtectionRuleInputBuilder(); @@ -14138,7 +14431,7 @@ class _$GUpdateBranchProtectionRuleInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'branchProtectionRuleId': result.branchProtectionRuleId = serializers.deserialize(value, @@ -14162,8 +14455,8 @@ class _$GUpdateBranchProtectionRuleInputSerializer break; case 'pushActorIds': result.pushActorIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'requiredApprovingReviewCount': @@ -14173,8 +14466,8 @@ class _$GUpdateBranchProtectionRuleInputSerializer case 'requiredStatusCheckContexts': result.requiredStatusCheckContexts.replace(serializers.deserialize( value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'requiresApprovingReviews': @@ -14207,8 +14500,8 @@ class _$GUpdateBranchProtectionRuleInputSerializer break; case 'reviewDismissalActorIds': result.reviewDismissalActorIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; } @@ -14232,10 +14525,10 @@ class _$GUpdateEnterpriseActionExecutionCapabilitySettingInputSerializer 'GUpdateEnterpriseActionExecutionCapabilitySettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseActionExecutionCapabilitySettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'capability', serializers.serialize(object.capability, specifiedType: const FullType(GActionExecutionCapabilitySetting)), @@ -14243,10 +14536,12 @@ class _$GUpdateEnterpriseActionExecutionCapabilitySettingInputSerializer serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14254,7 +14549,7 @@ class _$GUpdateEnterpriseActionExecutionCapabilitySettingInputSerializer @override GUpdateEnterpriseActionExecutionCapabilitySettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder(); @@ -14263,7 +14558,7 @@ class _$GUpdateEnterpriseActionExecutionCapabilitySettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'capability': result.capability = serializers.deserialize(value, @@ -14297,10 +14592,10 @@ class _$GUpdateEnterpriseAdministratorRoleInputSerializer final String wireName = 'GUpdateEnterpriseAdministratorRoleInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateEnterpriseAdministratorRoleInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14311,10 +14606,12 @@ class _$GUpdateEnterpriseAdministratorRoleInputSerializer serializers.serialize(object.role, specifiedType: const FullType(GEnterpriseAdministratorRole)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14322,7 +14619,7 @@ class _$GUpdateEnterpriseAdministratorRoleInputSerializer @override GUpdateEnterpriseAdministratorRoleInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseAdministratorRoleInputBuilder(); @@ -14330,7 +14627,7 @@ class _$GUpdateEnterpriseAdministratorRoleInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14370,10 +14667,10 @@ class _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputSerializer 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14382,10 +14679,12 @@ class _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14393,7 +14692,7 @@ class _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputSerializer @override GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder(); @@ -14402,7 +14701,7 @@ class _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14439,10 +14738,10 @@ class _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInputSerializer 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseDefaultRepositoryPermissionSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14451,10 +14750,12 @@ class _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInputSerializer specifiedType: const FullType( GEnterpriseDefaultRepositoryPermissionSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14462,7 +14763,7 @@ class _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInputSerializer @override GUpdateEnterpriseDefaultRepositoryPermissionSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder(); @@ -14471,7 +14772,7 @@ class _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14508,10 +14809,10 @@ class _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputSeriali 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14520,10 +14821,12 @@ class _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputSeriali specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14531,7 +14834,7 @@ class _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputSeriali @override GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder(); @@ -14540,7 +14843,7 @@ class _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputSeriali while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14577,49 +14880,55 @@ class _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputSerializer 'GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.membersCanCreateInternalRepositories != null) { + value = object.membersCanCreateInternalRepositories; + if (value != null) { result ..add('membersCanCreateInternalRepositories') - ..add(serializers.serialize(object.membersCanCreateInternalRepositories, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.membersCanCreatePrivateRepositories != null) { + value = object.membersCanCreatePrivateRepositories; + if (value != null) { result ..add('membersCanCreatePrivateRepositories') - ..add(serializers.serialize(object.membersCanCreatePrivateRepositories, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.membersCanCreatePublicRepositories != null) { + value = object.membersCanCreatePublicRepositories; + if (value != null) { result ..add('membersCanCreatePublicRepositories') - ..add(serializers.serialize(object.membersCanCreatePublicRepositories, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.membersCanCreateRepositoriesPolicyEnabled != null) { + value = object.membersCanCreateRepositoriesPolicyEnabled; + if (value != null) { result ..add('membersCanCreateRepositoriesPolicyEnabled') - ..add(serializers.serialize( - object.membersCanCreateRepositoriesPolicyEnabled, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.settingValue != null) { + value = object.settingValue; + if (value != null) { result ..add('settingValue') - ..add(serializers.serialize(object.settingValue, + ..add(serializers.serialize(value, specifiedType: const FullType( GEnterpriseMembersCanCreateRepositoriesSettingValue))); } @@ -14628,7 +14937,7 @@ class _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputSerializer @override GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder(); @@ -14637,7 +14946,7 @@ class _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14689,10 +14998,10 @@ class _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInputSerializer final String wireName = 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanDeleteIssuesSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14701,10 +15010,12 @@ class _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14712,7 +15023,7 @@ class _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInputSerializer @override GUpdateEnterpriseMembersCanDeleteIssuesSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder(); @@ -14721,7 +15032,7 @@ class _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14758,10 +15069,10 @@ class _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputSerializer 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14770,10 +15081,12 @@ class _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14781,7 +15094,7 @@ class _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputSerializer @override GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder(); @@ -14790,7 +15103,7 @@ class _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14827,10 +15140,10 @@ class _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputSerializer 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14839,10 +15152,12 @@ class _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14850,7 +15165,7 @@ class _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputSerializer @override GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder(); @@ -14859,7 +15174,7 @@ class _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14896,10 +15211,10 @@ class _$GUpdateEnterpriseMembersCanMakePurchasesSettingInputSerializer 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanMakePurchasesSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14908,10 +15223,12 @@ class _$GUpdateEnterpriseMembersCanMakePurchasesSettingInputSerializer specifiedType: const FullType(GEnterpriseMembersCanMakePurchasesSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14919,7 +15236,7 @@ class _$GUpdateEnterpriseMembersCanMakePurchasesSettingInputSerializer @override GUpdateEnterpriseMembersCanMakePurchasesSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder(); @@ -14928,7 +15245,7 @@ class _$GUpdateEnterpriseMembersCanMakePurchasesSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -14965,10 +15282,10 @@ class _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputSerializer 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -14977,10 +15294,12 @@ class _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -14988,7 +15307,7 @@ class _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputSerializer @override GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder(); @@ -14997,7 +15316,7 @@ class _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15034,10 +15353,10 @@ class _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputSerializer 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -15046,10 +15365,12 @@ class _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15057,7 +15378,7 @@ class _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputSerializer @override GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder(); @@ -15066,7 +15387,7 @@ class _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15102,10 +15423,10 @@ class _$GUpdateEnterpriseOrganizationProjectsSettingInputSerializer final String wireName = 'GUpdateEnterpriseOrganizationProjectsSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseOrganizationProjectsSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -15114,10 +15435,12 @@ class _$GUpdateEnterpriseOrganizationProjectsSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15125,7 +15448,7 @@ class _$GUpdateEnterpriseOrganizationProjectsSettingInputSerializer @override GUpdateEnterpriseOrganizationProjectsSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseOrganizationProjectsSettingInputBuilder(); @@ -15134,7 +15457,7 @@ class _$GUpdateEnterpriseOrganizationProjectsSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15168,42 +15491,48 @@ class _$GUpdateEnterpriseProfileInputSerializer final String wireName = 'GUpdateEnterpriseProfileInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateEnterpriseProfileInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.description != null) { + value = object.description; + if (value != null) { result ..add('description') - ..add(serializers.serialize(object.description, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.location != null) { + value = object.location; + if (value != null) { result ..add('location') - ..add(serializers.serialize(object.location, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.name != null) { + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.websiteUrl != null) { + value = object.websiteUrl; + if (value != null) { result ..add('websiteUrl') - ..add(serializers.serialize(object.websiteUrl, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15211,7 +15540,7 @@ class _$GUpdateEnterpriseProfileInputSerializer @override GUpdateEnterpriseProfileInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseProfileInputBuilder(); @@ -15219,7 +15548,7 @@ class _$GUpdateEnterpriseProfileInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15264,10 +15593,10 @@ class _$GUpdateEnterpriseRepositoryProjectsSettingInputSerializer final String wireName = 'GUpdateEnterpriseRepositoryProjectsSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseRepositoryProjectsSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -15276,10 +15605,12 @@ class _$GUpdateEnterpriseRepositoryProjectsSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15287,7 +15618,7 @@ class _$GUpdateEnterpriseRepositoryProjectsSettingInputSerializer @override GUpdateEnterpriseRepositoryProjectsSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseRepositoryProjectsSettingInputBuilder(); @@ -15295,7 +15626,7 @@ class _$GUpdateEnterpriseRepositoryProjectsSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15330,10 +15661,10 @@ class _$GUpdateEnterpriseTeamDiscussionsSettingInputSerializer final String wireName = 'GUpdateEnterpriseTeamDiscussionsSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseTeamDiscussionsSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -15342,10 +15673,12 @@ class _$GUpdateEnterpriseTeamDiscussionsSettingInputSerializer specifiedType: const FullType(GEnterpriseEnabledDisabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15353,7 +15686,7 @@ class _$GUpdateEnterpriseTeamDiscussionsSettingInputSerializer @override GUpdateEnterpriseTeamDiscussionsSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseTeamDiscussionsSettingInputBuilder(); @@ -15361,7 +15694,7 @@ class _$GUpdateEnterpriseTeamDiscussionsSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15398,10 +15731,10 @@ class _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputSerializer 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput'; @override - Iterable serialize(Serializers serializers, + Iterable serialize(Serializers serializers, GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'enterpriseId', serializers.serialize(object.enterpriseId, specifiedType: const FullType(String)), @@ -15409,10 +15742,12 @@ class _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputSerializer serializers.serialize(object.settingValue, specifiedType: const FullType(GEnterpriseEnabledSettingValue)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15420,7 +15755,7 @@ class _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputSerializer @override GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder(); @@ -15429,7 +15764,7 @@ class _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15462,19 +15797,21 @@ class _$GUpdateIssueCommentInputSerializer final String wireName = 'GUpdateIssueCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateIssueCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15482,7 +15819,7 @@ class _$GUpdateIssueCommentInputSerializer @override GUpdateIssueCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateIssueCommentInputBuilder(); @@ -15490,7 +15827,7 @@ class _$GUpdateIssueCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -15519,52 +15856,70 @@ class _$GUpdateIssueInputSerializer final String wireName = 'GUpdateIssueInput'; @override - Iterable serialize(Serializers serializers, GUpdateIssueInput object, + Iterable serialize(Serializers serializers, GUpdateIssueInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'assigneeIds', - serializers.serialize(object.assigneeIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), - 'labelIds', - serializers.serialize(object.labelIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'projectIds', - serializers.serialize(object.projectIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.body != null) { + Object? value; + value = object.assigneeIds; + if (value != null) { + result + ..add('assigneeIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.milestoneId != null) { + value = object.labelIds; + if (value != null) { + result + ..add('labelIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.milestoneId; + if (value != null) { result ..add('milestoneId') - ..add(serializers.serialize(object.milestoneId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.state != null) { + value = object.projectIds; + if (value != null) { + result + ..add('projectIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.state; + if (value != null) { result ..add('state') - ..add(serializers.serialize(object.state, + ..add(serializers.serialize(value, specifiedType: const FullType(GIssueState))); } - if (object.title != null) { + value = object.title; + if (value != null) { result ..add('title') - ..add(serializers.serialize(object.title, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15572,7 +15927,7 @@ class _$GUpdateIssueInputSerializer @override GUpdateIssueInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateIssueInputBuilder(); @@ -15580,12 +15935,12 @@ class _$GUpdateIssueInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'assigneeIds': result.assigneeIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'body': @@ -15602,8 +15957,8 @@ class _$GUpdateIssueInputSerializer break; case 'labelIds': result.labelIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'milestoneId': @@ -15612,8 +15967,8 @@ class _$GUpdateIssueInputSerializer break; case 'projectIds': result.projectIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'state': @@ -15642,30 +15997,34 @@ class _$GUpdateProjectCardInputSerializer final String wireName = 'GUpdateProjectCardInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateProjectCardInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectCardId', serializers.serialize(object.projectCardId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.isArchived != null) { + value = object.isArchived; + if (value != null) { result ..add('isArchived') - ..add(serializers.serialize(object.isArchived, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.note != null) { + value = object.note; + if (value != null) { result ..add('note') - ..add(serializers.serialize(object.note, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15673,7 +16032,7 @@ class _$GUpdateProjectCardInputSerializer @override GUpdateProjectCardInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateProjectCardInputBuilder(); @@ -15681,7 +16040,7 @@ class _$GUpdateProjectCardInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15717,20 +16076,22 @@ class _$GUpdateProjectColumnInputSerializer final String wireName = 'GUpdateProjectColumnInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateProjectColumnInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'name', serializers.serialize(object.name, specifiedType: const FullType(String)), 'projectColumnId', serializers.serialize(object.projectColumnId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15738,7 +16099,7 @@ class _$GUpdateProjectColumnInputSerializer @override GUpdateProjectColumnInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateProjectColumnInputBuilder(); @@ -15746,7 +16107,7 @@ class _$GUpdateProjectColumnInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -15778,42 +16139,48 @@ class _$GUpdateProjectInputSerializer final String wireName = 'GUpdateProjectInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateProjectInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'projectId', serializers.serialize(object.projectId, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.name != null) { + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.public != null) { + value = object.public; + if (value != null) { result ..add('public') - ..add(serializers.serialize(object.public, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.state != null) { + value = object.state; + if (value != null) { result ..add('state') - ..add(serializers.serialize(object.state, + ..add(serializers.serialize(value, specifiedType: const FullType(GProjectState))); } return result; @@ -15821,7 +16188,7 @@ class _$GUpdateProjectInputSerializer @override GUpdateProjectInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateProjectInputBuilder(); @@ -15829,7 +16196,7 @@ class _$GUpdateProjectInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -15873,66 +16240,86 @@ class _$GUpdatePullRequestInputSerializer final String wireName = 'GUpdatePullRequestInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdatePullRequestInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'assigneeIds', - serializers.serialize(object.assigneeIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'labelIds', - serializers.serialize(object.labelIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), - 'projectIds', - serializers.serialize(object.projectIds, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])), + final result = [ 'pullRequestId', serializers.serialize(object.pullRequestId, specifiedType: const FullType(String)), ]; - if (object.baseRefName != null) { + Object? value; + value = object.assigneeIds; + if (value != null) { + result + ..add('assigneeIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.baseRefName; + if (value != null) { result ..add('baseRefName') - ..add(serializers.serialize(object.baseRefName, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.body != null) { + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maintainerCanModify != null) { + value = object.labelIds; + if (value != null) { + result + ..add('labelIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.maintainerCanModify; + if (value != null) { result ..add('maintainerCanModify') - ..add(serializers.serialize(object.maintainerCanModify, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.milestoneId != null) { + value = object.milestoneId; + if (value != null) { result ..add('milestoneId') - ..add(serializers.serialize(object.milestoneId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.state != null) { + value = object.projectIds; + if (value != null) { + result + ..add('projectIds') + ..add(serializers.serialize(value, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + value = object.state; + if (value != null) { result ..add('state') - ..add(serializers.serialize(object.state, + ..add(serializers.serialize(value, specifiedType: const FullType(GPullRequestUpdateState))); } - if (object.title != null) { + value = object.title; + if (value != null) { result ..add('title') - ..add(serializers.serialize(object.title, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -15940,7 +16327,7 @@ class _$GUpdatePullRequestInputSerializer @override GUpdatePullRequestInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdatePullRequestInputBuilder(); @@ -15948,12 +16335,12 @@ class _$GUpdatePullRequestInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'assigneeIds': result.assigneeIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'baseRefName': @@ -15970,8 +16357,8 @@ class _$GUpdatePullRequestInputSerializer break; case 'labelIds': result.labelIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'maintainerCanModify': @@ -15984,8 +16371,8 @@ class _$GUpdatePullRequestInputSerializer break; case 'projectIds': result.projectIds.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; case 'pullRequestId': @@ -16019,20 +16406,22 @@ class _$GUpdatePullRequestReviewCommentInputSerializer final String wireName = 'GUpdatePullRequestReviewCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdatePullRequestReviewCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'pullRequestReviewCommentId', serializers.serialize(object.pullRequestReviewCommentId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -16040,7 +16429,7 @@ class _$GUpdatePullRequestReviewCommentInputSerializer @override GUpdatePullRequestReviewCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdatePullRequestReviewCommentInputBuilder(); @@ -16048,7 +16437,7 @@ class _$GUpdatePullRequestReviewCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -16080,20 +16469,22 @@ class _$GUpdatePullRequestReviewInputSerializer final String wireName = 'GUpdatePullRequestReviewInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdatePullRequestReviewInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'pullRequestReviewId', serializers.serialize(object.pullRequestReviewId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -16101,7 +16492,7 @@ class _$GUpdatePullRequestReviewInputSerializer @override GUpdatePullRequestReviewInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdatePullRequestReviewInputBuilder(); @@ -16109,7 +16500,7 @@ class _$GUpdatePullRequestReviewInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -16138,9 +16529,9 @@ class _$GUpdateRefInputSerializer final String wireName = 'GUpdateRefInput'; @override - Iterable serialize(Serializers serializers, GUpdateRefInput object, + Iterable serialize(Serializers serializers, GUpdateRefInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'oid', serializers.serialize(object.oid, specifiedType: const FullType(GGitObjectID)), @@ -16148,24 +16539,27 @@ class _$GUpdateRefInputSerializer serializers.serialize(object.refId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.force != null) { + value = object.force; + if (value != null) { result ..add('force') - ..add(serializers.serialize(object.force, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GUpdateRefInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateRefInputBuilder(); @@ -16173,7 +16567,7 @@ class _$GUpdateRefInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -16185,7 +16579,7 @@ class _$GUpdateRefInputSerializer break; case 'oid': result.oid.replace(serializers.deserialize(value, - specifiedType: const FullType(GGitObjectID)) as GGitObjectID); + specifiedType: const FullType(GGitObjectID))! as GGitObjectID); break; case 'refId': result.refId = serializers.deserialize(value, @@ -16209,68 +16603,77 @@ class _$GUpdateRepositoryInputSerializer final String wireName = 'GUpdateRepositoryInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateRepositoryInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.description != null) { + value = object.description; + if (value != null) { result ..add('description') - ..add(serializers.serialize(object.description, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.hasIssuesEnabled != null) { + value = object.hasIssuesEnabled; + if (value != null) { result ..add('hasIssuesEnabled') - ..add(serializers.serialize(object.hasIssuesEnabled, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.hasProjectsEnabled != null) { + value = object.hasProjectsEnabled; + if (value != null) { result ..add('hasProjectsEnabled') - ..add(serializers.serialize(object.hasProjectsEnabled, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.hasWikiEnabled != null) { + value = object.hasWikiEnabled; + if (value != null) { result ..add('hasWikiEnabled') - ..add(serializers.serialize(object.hasWikiEnabled, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.homepageUrl != null) { + value = object.homepageUrl; + if (value != null) { result ..add('homepageUrl') - ..add(serializers.serialize(object.homepageUrl, - specifiedType: const FullType(GURI))); + ..add( + serializers.serialize(value, specifiedType: const FullType(GURI))); } - if (object.name != null) { + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.template != null) { + value = object.template; + if (value != null) { result ..add('template') - ..add(serializers.serialize(object.template, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } return result; } @override GUpdateRepositoryInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateRepositoryInputBuilder(); @@ -16278,7 +16681,7 @@ class _$GUpdateRepositoryInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -16302,7 +16705,7 @@ class _$GUpdateRepositoryInputSerializer break; case 'homepageUrl': result.homepageUrl.replace(serializers.deserialize(value, - specifiedType: const FullType(GURI)) as GURI); + specifiedType: const FullType(GURI))! as GURI); break; case 'name': result.name = serializers.deserialize(value, @@ -16334,10 +16737,10 @@ class _$GUpdateSubscriptionInputSerializer final String wireName = 'GUpdateSubscriptionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateSubscriptionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'state', serializers.serialize(object.state, specifiedType: const FullType(GSubscriptionState)), @@ -16345,10 +16748,12 @@ class _$GUpdateSubscriptionInputSerializer serializers.serialize(object.subscribableId, specifiedType: const FullType(String)), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -16356,7 +16761,7 @@ class _$GUpdateSubscriptionInputSerializer @override GUpdateSubscriptionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateSubscriptionInputBuilder(); @@ -16364,7 +16769,7 @@ class _$GUpdateSubscriptionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -16397,25 +16802,28 @@ class _$GUpdateTeamDiscussionCommentInputSerializer final String wireName = 'GUpdateTeamDiscussionCommentInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateTeamDiscussionCommentInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'body', serializers.serialize(object.body, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.bodyVersion != null) { + Object? value; + value = object.bodyVersion; + if (value != null) { result ..add('bodyVersion') - ..add(serializers.serialize(object.bodyVersion, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -16423,7 +16831,7 @@ class _$GUpdateTeamDiscussionCommentInputSerializer @override GUpdateTeamDiscussionCommentInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateTeamDiscussionCommentInputBuilder(); @@ -16431,7 +16839,7 @@ class _$GUpdateTeamDiscussionCommentInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -16467,41 +16875,47 @@ class _$GUpdateTeamDiscussionInputSerializer final String wireName = 'GUpdateTeamDiscussionInput'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GUpdateTeamDiscussionInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.body != null) { + Object? value; + value = object.body; + if (value != null) { result ..add('body') - ..add(serializers.serialize(object.body, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.bodyVersion != null) { + value = object.bodyVersion; + if (value != null) { result ..add('bodyVersion') - ..add(serializers.serialize(object.bodyVersion, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.clientMutationId != null) { + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.pinned != null) { + value = object.pinned; + if (value != null) { result ..add('pinned') - ..add(serializers.serialize(object.pinned, - specifiedType: const FullType(bool))); + ..add( + serializers.serialize(value, specifiedType: const FullType(bool))); } - if (object.title != null) { + value = object.title; + if (value != null) { result ..add('title') - ..add(serializers.serialize(object.title, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -16509,7 +16923,7 @@ class _$GUpdateTeamDiscussionInputSerializer @override GUpdateTeamDiscussionInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateTeamDiscussionInputBuilder(); @@ -16517,7 +16931,7 @@ class _$GUpdateTeamDiscussionInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'body': result.body = serializers.deserialize(value, @@ -16558,9 +16972,10 @@ class _$GUpdateTopicsInputSerializer final String wireName = 'GUpdateTopicsInput'; @override - Iterable serialize(Serializers serializers, GUpdateTopicsInput object, + Iterable serialize( + Serializers serializers, GUpdateTopicsInput object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'repositoryId', serializers.serialize(object.repositoryId, specifiedType: const FullType(String)), @@ -16569,10 +16984,12 @@ class _$GUpdateTopicsInputSerializer specifiedType: const FullType(BuiltList, const [const FullType(String)])), ]; - if (object.clientMutationId != null) { + Object? value; + value = object.clientMutationId; + if (value != null) { result ..add('clientMutationId') - ..add(serializers.serialize(object.clientMutationId, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -16580,7 +16997,7 @@ class _$GUpdateTopicsInputSerializer @override GUpdateTopicsInput deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUpdateTopicsInputBuilder(); @@ -16588,7 +17005,7 @@ class _$GUpdateTopicsInputSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'clientMutationId': result.clientMutationId = serializers.deserialize(value, @@ -16600,8 +17017,8 @@ class _$GUpdateTopicsInputSerializer break; case 'topicNames': result.topicNames.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) + specifiedType: const FullType( + BuiltList, const [const FullType(String)]))! as BuiltList); break; } @@ -16637,9 +17054,9 @@ class _$GUserStatusOrderSerializer final String wireName = 'GUserStatusOrder'; @override - Iterable serialize(Serializers serializers, GUserStatusOrder object, + Iterable serialize(Serializers serializers, GUserStatusOrder object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'direction', serializers.serialize(object.direction, specifiedType: const FullType(GOrderDirection)), @@ -16653,7 +17070,7 @@ class _$GUserStatusOrderSerializer @override GUserStatusOrder deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GUserStatusOrderBuilder(); @@ -16661,7 +17078,7 @@ class _$GUserStatusOrderSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'direction': result.direction = serializers.deserialize(value, @@ -16701,24 +17118,22 @@ class _$GUserStatusOrderFieldSerializer class _$GAcceptEnterpriseAdministratorInvitationInput extends GAcceptEnterpriseAdministratorInvitationInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String invitationId; factory _$GAcceptEnterpriseAdministratorInvitationInput( - [void Function(GAcceptEnterpriseAdministratorInvitationInputBuilder) + [void Function(GAcceptEnterpriseAdministratorInvitationInputBuilder)? updates]) => (new GAcceptEnterpriseAdministratorInvitationInputBuilder() ..update(updates)) .build(); _$GAcceptEnterpriseAdministratorInvitationInput._( - {this.clientMutationId, this.invitationId}) + {this.clientMutationId, required this.invitationId}) : super._() { - if (invitationId == null) { - throw new BuiltValueNullFieldError( - 'GAcceptEnterpriseAdministratorInvitationInput', 'invitationId'); - } + BuiltValueNullFieldError.checkNotNull(invitationId, + 'GAcceptEnterpriseAdministratorInvitationInput', 'invitationId'); } @override @@ -16758,23 +17173,24 @@ class GAcceptEnterpriseAdministratorInvitationInputBuilder implements Builder { - _$GAcceptEnterpriseAdministratorInvitationInput _$v; + _$GAcceptEnterpriseAdministratorInvitationInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _invitationId; - String get invitationId => _$this._invitationId; - set invitationId(String invitationId) => _$this._invitationId = invitationId; + String? _invitationId; + String? get invitationId => _$this._invitationId; + set invitationId(String? invitationId) => _$this._invitationId = invitationId; GAcceptEnterpriseAdministratorInvitationInputBuilder(); GAcceptEnterpriseAdministratorInvitationInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _invitationId = _$v.invitationId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _invitationId = $v.invitationId; _$v = null; } return this; @@ -16782,15 +17198,13 @@ class GAcceptEnterpriseAdministratorInvitationInputBuilder @override void replace(GAcceptEnterpriseAdministratorInvitationInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAcceptEnterpriseAdministratorInvitationInput; } @override void update( - void Function(GAcceptEnterpriseAdministratorInvitationInputBuilder) + void Function(GAcceptEnterpriseAdministratorInvitationInputBuilder)? updates) { if (updates != null) updates(this); } @@ -16799,7 +17213,11 @@ class GAcceptEnterpriseAdministratorInvitationInputBuilder _$GAcceptEnterpriseAdministratorInvitationInput build() { final _$result = _$v ?? new _$GAcceptEnterpriseAdministratorInvitationInput._( - clientMutationId: clientMutationId, invitationId: invitationId); + clientMutationId: clientMutationId, + invitationId: BuiltValueNullFieldError.checkNotNull( + invitationId, + 'GAcceptEnterpriseAdministratorInvitationInput', + 'invitationId')); replace(_$result); return _$result; } @@ -16807,26 +17225,23 @@ class GAcceptEnterpriseAdministratorInvitationInputBuilder class _$GAcceptTopicSuggestionInput extends GAcceptTopicSuggestionInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String name; @override final String repositoryId; factory _$GAcceptTopicSuggestionInput( - [void Function(GAcceptTopicSuggestionInputBuilder) updates]) => + [void Function(GAcceptTopicSuggestionInputBuilder)? updates]) => (new GAcceptTopicSuggestionInputBuilder()..update(updates)).build(); _$GAcceptTopicSuggestionInput._( - {this.clientMutationId, this.name, this.repositoryId}) + {this.clientMutationId, required this.name, required this.repositoryId}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GAcceptTopicSuggestionInput', 'name'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GAcceptTopicSuggestionInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GAcceptTopicSuggestionInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GAcceptTopicSuggestionInput', 'repositoryId'); } @override @@ -16867,28 +17282,29 @@ class GAcceptTopicSuggestionInputBuilder implements Builder { - _$GAcceptTopicSuggestionInput _$v; + _$GAcceptTopicSuggestionInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GAcceptTopicSuggestionInputBuilder(); GAcceptTopicSuggestionInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -16896,14 +17312,12 @@ class GAcceptTopicSuggestionInputBuilder @override void replace(GAcceptTopicSuggestionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAcceptTopicSuggestionInput; } @override - void update(void Function(GAcceptTopicSuggestionInputBuilder) updates) { + void update(void Function(GAcceptTopicSuggestionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -16912,8 +17326,10 @@ class GAcceptTopicSuggestionInputBuilder final _$result = _$v ?? new _$GAcceptTopicSuggestionInput._( clientMutationId: clientMutationId, - name: name, - repositoryId: repositoryId); + name: BuiltValueNullFieldError.checkNotNull( + name, 'GAcceptTopicSuggestionInput', 'name'), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GAcceptTopicSuggestionInput', 'repositoryId')); replace(_$result); return _$result; } @@ -16925,23 +17341,21 @@ class _$GAddAssigneesToAssignableInput extends GAddAssigneesToAssignableInput { @override final BuiltList assigneeIds; @override - final String clientMutationId; + final String? clientMutationId; factory _$GAddAssigneesToAssignableInput( - [void Function(GAddAssigneesToAssignableInputBuilder) updates]) => + [void Function(GAddAssigneesToAssignableInputBuilder)? updates]) => (new GAddAssigneesToAssignableInputBuilder()..update(updates)).build(); _$GAddAssigneesToAssignableInput._( - {this.assignableId, this.assigneeIds, this.clientMutationId}) + {required this.assignableId, + required this.assigneeIds, + this.clientMutationId}) : super._() { - if (assignableId == null) { - throw new BuiltValueNullFieldError( - 'GAddAssigneesToAssignableInput', 'assignableId'); - } - if (assigneeIds == null) { - throw new BuiltValueNullFieldError( - 'GAddAssigneesToAssignableInput', 'assigneeIds'); - } + BuiltValueNullFieldError.checkNotNull( + assignableId, 'GAddAssigneesToAssignableInput', 'assignableId'); + BuiltValueNullFieldError.checkNotNull( + assigneeIds, 'GAddAssigneesToAssignableInput', 'assigneeIds'); } @override @@ -16982,30 +17396,31 @@ class GAddAssigneesToAssignableInputBuilder implements Builder { - _$GAddAssigneesToAssignableInput _$v; + _$GAddAssigneesToAssignableInput? _$v; - String _assignableId; - String get assignableId => _$this._assignableId; - set assignableId(String assignableId) => _$this._assignableId = assignableId; + String? _assignableId; + String? get assignableId => _$this._assignableId; + set assignableId(String? assignableId) => _$this._assignableId = assignableId; - ListBuilder _assigneeIds; + ListBuilder? _assigneeIds; ListBuilder get assigneeIds => _$this._assigneeIds ??= new ListBuilder(); - set assigneeIds(ListBuilder assigneeIds) => + set assigneeIds(ListBuilder? assigneeIds) => _$this._assigneeIds = assigneeIds; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; GAddAssigneesToAssignableInputBuilder(); GAddAssigneesToAssignableInputBuilder get _$this { - if (_$v != null) { - _assignableId = _$v.assignableId; - _assigneeIds = _$v.assigneeIds?.toBuilder(); - _clientMutationId = _$v.clientMutationId; + final $v = _$v; + if ($v != null) { + _assignableId = $v.assignableId; + _assigneeIds = $v.assigneeIds.toBuilder(); + _clientMutationId = $v.clientMutationId; _$v = null; } return this; @@ -17013,14 +17428,12 @@ class GAddAssigneesToAssignableInputBuilder @override void replace(GAddAssigneesToAssignableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddAssigneesToAssignableInput; } @override - void update(void Function(GAddAssigneesToAssignableInputBuilder) updates) { + void update(void Function(GAddAssigneesToAssignableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17030,11 +17443,12 @@ class GAddAssigneesToAssignableInputBuilder try { _$result = _$v ?? new _$GAddAssigneesToAssignableInput._( - assignableId: assignableId, + assignableId: BuiltValueNullFieldError.checkNotNull(assignableId, + 'GAddAssigneesToAssignableInput', 'assignableId'), assigneeIds: assigneeIds.build(), clientMutationId: clientMutationId); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'assigneeIds'; assigneeIds.build(); @@ -17053,22 +17467,20 @@ class _$GAddCommentInput extends GAddCommentInput { @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override final String subjectId; factory _$GAddCommentInput( - [void Function(GAddCommentInputBuilder) updates]) => + [void Function(GAddCommentInputBuilder)? updates]) => (new GAddCommentInputBuilder()..update(updates)).build(); - _$GAddCommentInput._({this.body, this.clientMutationId, this.subjectId}) + _$GAddCommentInput._( + {required this.body, this.clientMutationId, required this.subjectId}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError('GAddCommentInput', 'body'); - } - if (subjectId == null) { - throw new BuiltValueNullFieldError('GAddCommentInput', 'subjectId'); - } + BuiltValueNullFieldError.checkNotNull(body, 'GAddCommentInput', 'body'); + BuiltValueNullFieldError.checkNotNull( + subjectId, 'GAddCommentInput', 'subjectId'); } @override @@ -17106,28 +17518,29 @@ class _$GAddCommentInput extends GAddCommentInput { class GAddCommentInputBuilder implements Builder { - _$GAddCommentInput _$v; + _$GAddCommentInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _subjectId; - String get subjectId => _$this._subjectId; - set subjectId(String subjectId) => _$this._subjectId = subjectId; + String? _subjectId; + String? get subjectId => _$this._subjectId; + set subjectId(String? subjectId) => _$this._subjectId = subjectId; GAddCommentInputBuilder(); GAddCommentInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _subjectId = _$v.subjectId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _subjectId = $v.subjectId; _$v = null; } return this; @@ -17135,14 +17548,12 @@ class GAddCommentInputBuilder @override void replace(GAddCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddCommentInput; } @override - void update(void Function(GAddCommentInputBuilder) updates) { + void update(void Function(GAddCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17150,9 +17561,11 @@ class GAddCommentInputBuilder _$GAddCommentInput build() { final _$result = _$v ?? new _$GAddCommentInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GAddCommentInput', 'body'), clientMutationId: clientMutationId, - subjectId: subjectId); + subjectId: BuiltValueNullFieldError.checkNotNull( + subjectId, 'GAddCommentInput', 'subjectId')); replace(_$result); return _$result; } @@ -17160,27 +17573,25 @@ class GAddCommentInputBuilder class _$GAddLabelsToLabelableInput extends GAddLabelsToLabelableInput { @override - final String clientMutationId; + final String? clientMutationId; @override final BuiltList labelIds; @override final String labelableId; factory _$GAddLabelsToLabelableInput( - [void Function(GAddLabelsToLabelableInputBuilder) updates]) => + [void Function(GAddLabelsToLabelableInputBuilder)? updates]) => (new GAddLabelsToLabelableInputBuilder()..update(updates)).build(); _$GAddLabelsToLabelableInput._( - {this.clientMutationId, this.labelIds, this.labelableId}) + {this.clientMutationId, + required this.labelIds, + required this.labelableId}) : super._() { - if (labelIds == null) { - throw new BuiltValueNullFieldError( - 'GAddLabelsToLabelableInput', 'labelIds'); - } - if (labelableId == null) { - throw new BuiltValueNullFieldError( - 'GAddLabelsToLabelableInput', 'labelableId'); - } + BuiltValueNullFieldError.checkNotNull( + labelIds, 'GAddLabelsToLabelableInput', 'labelIds'); + BuiltValueNullFieldError.checkNotNull( + labelableId, 'GAddLabelsToLabelableInput', 'labelableId'); } @override @@ -17220,29 +17631,30 @@ class _$GAddLabelsToLabelableInput extends GAddLabelsToLabelableInput { class GAddLabelsToLabelableInputBuilder implements Builder { - _$GAddLabelsToLabelableInput _$v; + _$GAddLabelsToLabelableInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - ListBuilder _labelIds; + ListBuilder? _labelIds; ListBuilder get labelIds => _$this._labelIds ??= new ListBuilder(); - set labelIds(ListBuilder labelIds) => _$this._labelIds = labelIds; + set labelIds(ListBuilder? labelIds) => _$this._labelIds = labelIds; - String _labelableId; - String get labelableId => _$this._labelableId; - set labelableId(String labelableId) => _$this._labelableId = labelableId; + String? _labelableId; + String? get labelableId => _$this._labelableId; + set labelableId(String? labelableId) => _$this._labelableId = labelableId; GAddLabelsToLabelableInputBuilder(); GAddLabelsToLabelableInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _labelIds = _$v.labelIds?.toBuilder(); - _labelableId = _$v.labelableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _labelIds = $v.labelIds.toBuilder(); + _labelableId = $v.labelableId; _$v = null; } return this; @@ -17250,14 +17662,12 @@ class GAddLabelsToLabelableInputBuilder @override void replace(GAddLabelsToLabelableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddLabelsToLabelableInput; } @override - void update(void Function(GAddLabelsToLabelableInputBuilder) updates) { + void update(void Function(GAddLabelsToLabelableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17269,9 +17679,10 @@ class GAddLabelsToLabelableInputBuilder new _$GAddLabelsToLabelableInput._( clientMutationId: clientMutationId, labelIds: labelIds.build(), - labelableId: labelableId); + labelableId: BuiltValueNullFieldError.checkNotNull( + labelableId, 'GAddLabelsToLabelableInput', 'labelableId')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'labelIds'; labelIds.build(); @@ -17288,25 +17699,26 @@ class GAddLabelsToLabelableInputBuilder class _$GAddProjectCardInput extends GAddProjectCardInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String contentId; + final String? contentId; @override - final String note; + final String? note; @override final String projectColumnId; factory _$GAddProjectCardInput( - [void Function(GAddProjectCardInputBuilder) updates]) => + [void Function(GAddProjectCardInputBuilder)? updates]) => (new GAddProjectCardInputBuilder()..update(updates)).build(); _$GAddProjectCardInput._( - {this.clientMutationId, this.contentId, this.note, this.projectColumnId}) + {this.clientMutationId, + this.contentId, + this.note, + required this.projectColumnId}) : super._() { - if (projectColumnId == null) { - throw new BuiltValueNullFieldError( - 'GAddProjectCardInput', 'projectColumnId'); - } + BuiltValueNullFieldError.checkNotNull( + projectColumnId, 'GAddProjectCardInput', 'projectColumnId'); } @override @@ -17349,34 +17761,35 @@ class _$GAddProjectCardInput extends GAddProjectCardInput { class GAddProjectCardInputBuilder implements Builder { - _$GAddProjectCardInput _$v; + _$GAddProjectCardInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _contentId; - String get contentId => _$this._contentId; - set contentId(String contentId) => _$this._contentId = contentId; + String? _contentId; + String? get contentId => _$this._contentId; + set contentId(String? contentId) => _$this._contentId = contentId; - String _note; - String get note => _$this._note; - set note(String note) => _$this._note = note; + String? _note; + String? get note => _$this._note; + set note(String? note) => _$this._note = note; - String _projectColumnId; - String get projectColumnId => _$this._projectColumnId; - set projectColumnId(String projectColumnId) => + String? _projectColumnId; + String? get projectColumnId => _$this._projectColumnId; + set projectColumnId(String? projectColumnId) => _$this._projectColumnId = projectColumnId; GAddProjectCardInputBuilder(); GAddProjectCardInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _contentId = _$v.contentId; - _note = _$v.note; - _projectColumnId = _$v.projectColumnId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _contentId = $v.contentId; + _note = $v.note; + _projectColumnId = $v.projectColumnId; _$v = null; } return this; @@ -17384,14 +17797,12 @@ class GAddProjectCardInputBuilder @override void replace(GAddProjectCardInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddProjectCardInput; } @override - void update(void Function(GAddProjectCardInputBuilder) updates) { + void update(void Function(GAddProjectCardInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17402,7 +17813,8 @@ class GAddProjectCardInputBuilder clientMutationId: clientMutationId, contentId: contentId, note: note, - projectColumnId: projectColumnId); + projectColumnId: BuiltValueNullFieldError.checkNotNull( + projectColumnId, 'GAddProjectCardInput', 'projectColumnId')); replace(_$result); return _$result; } @@ -17410,24 +17822,23 @@ class GAddProjectCardInputBuilder class _$GAddProjectColumnInput extends GAddProjectColumnInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String name; @override final String projectId; factory _$GAddProjectColumnInput( - [void Function(GAddProjectColumnInputBuilder) updates]) => + [void Function(GAddProjectColumnInputBuilder)? updates]) => (new GAddProjectColumnInputBuilder()..update(updates)).build(); - _$GAddProjectColumnInput._({this.clientMutationId, this.name, this.projectId}) + _$GAddProjectColumnInput._( + {this.clientMutationId, required this.name, required this.projectId}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GAddProjectColumnInput', 'name'); - } - if (projectId == null) { - throw new BuiltValueNullFieldError('GAddProjectColumnInput', 'projectId'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GAddProjectColumnInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + projectId, 'GAddProjectColumnInput', 'projectId'); } @override @@ -17466,28 +17877,29 @@ class _$GAddProjectColumnInput extends GAddProjectColumnInput { class GAddProjectColumnInputBuilder implements Builder { - _$GAddProjectColumnInput _$v; + _$GAddProjectColumnInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _projectId; - String get projectId => _$this._projectId; - set projectId(String projectId) => _$this._projectId = projectId; + String? _projectId; + String? get projectId => _$this._projectId; + set projectId(String? projectId) => _$this._projectId = projectId; GAddProjectColumnInputBuilder(); GAddProjectColumnInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _projectId = _$v.projectId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _projectId = $v.projectId; _$v = null; } return this; @@ -17495,14 +17907,12 @@ class GAddProjectColumnInputBuilder @override void replace(GAddProjectColumnInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddProjectColumnInput; } @override - void update(void Function(GAddProjectColumnInputBuilder) updates) { + void update(void Function(GAddProjectColumnInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17511,8 +17921,10 @@ class GAddProjectColumnInputBuilder final _$result = _$v ?? new _$GAddProjectColumnInput._( clientMutationId: clientMutationId, - name: name, - projectId: projectId); + name: BuiltValueNullFieldError.checkNotNull( + name, 'GAddProjectColumnInput', 'name'), + projectId: BuiltValueNullFieldError.checkNotNull( + projectId, 'GAddProjectColumnInput', 'projectId')); replace(_$result); return _$result; } @@ -17523,26 +17935,26 @@ class _$GAddPullRequestReviewCommentInput @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override - final GGitObjectID commitOID; + final GGitObjectID? commitOID; @override - final String inReplyTo; + final String? inReplyTo; @override - final String path; + final String? path; @override - final int position; + final int? position; @override - final String pullRequestId; + final String? pullRequestId; @override - final String pullRequestReviewId; + final String? pullRequestReviewId; factory _$GAddPullRequestReviewCommentInput( - [void Function(GAddPullRequestReviewCommentInputBuilder) updates]) => + [void Function(GAddPullRequestReviewCommentInputBuilder)? updates]) => (new GAddPullRequestReviewCommentInputBuilder()..update(updates)).build(); _$GAddPullRequestReviewCommentInput._( - {this.body, + {required this.body, this.clientMutationId, this.commitOID, this.inReplyTo, @@ -17551,10 +17963,8 @@ class _$GAddPullRequestReviewCommentInput this.pullRequestId, this.pullRequestReviewId}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError( - 'GAddPullRequestReviewCommentInput', 'body'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GAddPullRequestReviewCommentInput', 'body'); } @override @@ -17617,56 +18027,58 @@ class GAddPullRequestReviewCommentInputBuilder implements Builder { - _$GAddPullRequestReviewCommentInput _$v; + _$GAddPullRequestReviewCommentInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - GGitObjectIDBuilder _commitOID; + GGitObjectIDBuilder? _commitOID; GGitObjectIDBuilder get commitOID => _$this._commitOID ??= new GGitObjectIDBuilder(); - set commitOID(GGitObjectIDBuilder commitOID) => _$this._commitOID = commitOID; + set commitOID(GGitObjectIDBuilder? commitOID) => + _$this._commitOID = commitOID; - String _inReplyTo; - String get inReplyTo => _$this._inReplyTo; - set inReplyTo(String inReplyTo) => _$this._inReplyTo = inReplyTo; + String? _inReplyTo; + String? get inReplyTo => _$this._inReplyTo; + set inReplyTo(String? inReplyTo) => _$this._inReplyTo = inReplyTo; - String _path; - String get path => _$this._path; - set path(String path) => _$this._path = path; + String? _path; + String? get path => _$this._path; + set path(String? path) => _$this._path = path; - int _position; - int get position => _$this._position; - set position(int position) => _$this._position = position; + int? _position; + int? get position => _$this._position; + set position(int? position) => _$this._position = position; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; - String _pullRequestReviewId; - String get pullRequestReviewId => _$this._pullRequestReviewId; - set pullRequestReviewId(String pullRequestReviewId) => + String? _pullRequestReviewId; + String? get pullRequestReviewId => _$this._pullRequestReviewId; + set pullRequestReviewId(String? pullRequestReviewId) => _$this._pullRequestReviewId = pullRequestReviewId; GAddPullRequestReviewCommentInputBuilder(); GAddPullRequestReviewCommentInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _commitOID = _$v.commitOID?.toBuilder(); - _inReplyTo = _$v.inReplyTo; - _path = _$v.path; - _position = _$v.position; - _pullRequestId = _$v.pullRequestId; - _pullRequestReviewId = _$v.pullRequestReviewId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _commitOID = $v.commitOID?.toBuilder(); + _inReplyTo = $v.inReplyTo; + _path = $v.path; + _position = $v.position; + _pullRequestId = $v.pullRequestId; + _pullRequestReviewId = $v.pullRequestReviewId; _$v = null; } return this; @@ -17674,14 +18086,13 @@ class GAddPullRequestReviewCommentInputBuilder @override void replace(GAddPullRequestReviewCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddPullRequestReviewCommentInput; } @override - void update(void Function(GAddPullRequestReviewCommentInputBuilder) updates) { + void update( + void Function(GAddPullRequestReviewCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17691,7 +18102,8 @@ class GAddPullRequestReviewCommentInputBuilder try { _$result = _$v ?? new _$GAddPullRequestReviewCommentInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GAddPullRequestReviewCommentInput', 'body'), clientMutationId: clientMutationId, commitOID: _commitOID?.build(), inReplyTo: inReplyTo, @@ -17700,7 +18112,7 @@ class GAddPullRequestReviewCommentInputBuilder pullRequestId: pullRequestId, pullRequestReviewId: pullRequestReviewId); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'commitOID'; _commitOID?.build(); @@ -17717,20 +18129,20 @@ class GAddPullRequestReviewCommentInputBuilder class _$GAddPullRequestReviewInput extends GAddPullRequestReviewInput { @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override - final BuiltList comments; + final BuiltList? comments; @override - final GGitObjectID commitOID; + final GGitObjectID? commitOID; @override - final GPullRequestReviewEvent event; + final GPullRequestReviewEvent? event; @override final String pullRequestId; factory _$GAddPullRequestReviewInput( - [void Function(GAddPullRequestReviewInputBuilder) updates]) => + [void Function(GAddPullRequestReviewInputBuilder)? updates]) => (new GAddPullRequestReviewInputBuilder()..update(updates)).build(); _$GAddPullRequestReviewInput._( @@ -17739,12 +18151,10 @@ class _$GAddPullRequestReviewInput extends GAddPullRequestReviewInput { this.comments, this.commitOID, this.event, - this.pullRequestId}) + required this.pullRequestId}) : super._() { - if (pullRequestId == null) { - throw new BuiltValueNullFieldError( - 'GAddPullRequestReviewInput', 'pullRequestId'); - } + BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GAddPullRequestReviewInput', 'pullRequestId'); } @override @@ -17796,47 +18206,49 @@ class _$GAddPullRequestReviewInput extends GAddPullRequestReviewInput { class GAddPullRequestReviewInputBuilder implements Builder { - _$GAddPullRequestReviewInput _$v; + _$GAddPullRequestReviewInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - ListBuilder _comments; + ListBuilder? _comments; ListBuilder get comments => _$this._comments ??= new ListBuilder(); - set comments(ListBuilder comments) => + set comments(ListBuilder? comments) => _$this._comments = comments; - GGitObjectIDBuilder _commitOID; + GGitObjectIDBuilder? _commitOID; GGitObjectIDBuilder get commitOID => _$this._commitOID ??= new GGitObjectIDBuilder(); - set commitOID(GGitObjectIDBuilder commitOID) => _$this._commitOID = commitOID; + set commitOID(GGitObjectIDBuilder? commitOID) => + _$this._commitOID = commitOID; - GPullRequestReviewEvent _event; - GPullRequestReviewEvent get event => _$this._event; - set event(GPullRequestReviewEvent event) => _$this._event = event; + GPullRequestReviewEvent? _event; + GPullRequestReviewEvent? get event => _$this._event; + set event(GPullRequestReviewEvent? event) => _$this._event = event; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; GAddPullRequestReviewInputBuilder(); GAddPullRequestReviewInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _comments = _$v.comments?.toBuilder(); - _commitOID = _$v.commitOID?.toBuilder(); - _event = _$v.event; - _pullRequestId = _$v.pullRequestId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _comments = $v.comments?.toBuilder(); + _commitOID = $v.commitOID?.toBuilder(); + _event = $v.event; + _pullRequestId = $v.pullRequestId; _$v = null; } return this; @@ -17844,14 +18256,12 @@ class GAddPullRequestReviewInputBuilder @override void replace(GAddPullRequestReviewInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddPullRequestReviewInput; } @override - void update(void Function(GAddPullRequestReviewInputBuilder) updates) { + void update(void Function(GAddPullRequestReviewInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17866,9 +18276,12 @@ class GAddPullRequestReviewInputBuilder comments: _comments?.build(), commitOID: _commitOID?.build(), event: event, - pullRequestId: pullRequestId); + pullRequestId: BuiltValueNullFieldError.checkNotNull( + pullRequestId, + 'GAddPullRequestReviewInput', + 'pullRequestId')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'comments'; _comments?.build(); @@ -17887,24 +18300,23 @@ class GAddPullRequestReviewInputBuilder class _$GAddReactionInput extends GAddReactionInput { @override - final String clientMutationId; + final String? clientMutationId; @override final GReactionContent content; @override final String subjectId; factory _$GAddReactionInput( - [void Function(GAddReactionInputBuilder) updates]) => + [void Function(GAddReactionInputBuilder)? updates]) => (new GAddReactionInputBuilder()..update(updates)).build(); - _$GAddReactionInput._({this.clientMutationId, this.content, this.subjectId}) + _$GAddReactionInput._( + {this.clientMutationId, required this.content, required this.subjectId}) : super._() { - if (content == null) { - throw new BuiltValueNullFieldError('GAddReactionInput', 'content'); - } - if (subjectId == null) { - throw new BuiltValueNullFieldError('GAddReactionInput', 'subjectId'); - } + BuiltValueNullFieldError.checkNotNull( + content, 'GAddReactionInput', 'content'); + BuiltValueNullFieldError.checkNotNull( + subjectId, 'GAddReactionInput', 'subjectId'); } @override @@ -17942,28 +18354,29 @@ class _$GAddReactionInput extends GAddReactionInput { class GAddReactionInputBuilder implements Builder { - _$GAddReactionInput _$v; + _$GAddReactionInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - GReactionContent _content; - GReactionContent get content => _$this._content; - set content(GReactionContent content) => _$this._content = content; + GReactionContent? _content; + GReactionContent? get content => _$this._content; + set content(GReactionContent? content) => _$this._content = content; - String _subjectId; - String get subjectId => _$this._subjectId; - set subjectId(String subjectId) => _$this._subjectId = subjectId; + String? _subjectId; + String? get subjectId => _$this._subjectId; + set subjectId(String? subjectId) => _$this._subjectId = subjectId; GAddReactionInputBuilder(); GAddReactionInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _content = _$v.content; - _subjectId = _$v.subjectId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _content = $v.content; + _subjectId = $v.subjectId; _$v = null; } return this; @@ -17971,14 +18384,12 @@ class GAddReactionInputBuilder @override void replace(GAddReactionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddReactionInput; } @override - void update(void Function(GAddReactionInputBuilder) updates) { + void update(void Function(GAddReactionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -17987,8 +18398,10 @@ class GAddReactionInputBuilder final _$result = _$v ?? new _$GAddReactionInput._( clientMutationId: clientMutationId, - content: content, - subjectId: subjectId); + content: BuiltValueNullFieldError.checkNotNull( + content, 'GAddReactionInput', 'content'), + subjectId: BuiltValueNullFieldError.checkNotNull( + subjectId, 'GAddReactionInput', 'subjectId')); replace(_$result); return _$result; } @@ -17996,17 +18409,17 @@ class GAddReactionInputBuilder class _$GAddStarInput extends GAddStarInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String starrableId; - factory _$GAddStarInput([void Function(GAddStarInputBuilder) updates]) => + factory _$GAddStarInput([void Function(GAddStarInputBuilder)? updates]) => (new GAddStarInputBuilder()..update(updates)).build(); - _$GAddStarInput._({this.clientMutationId, this.starrableId}) : super._() { - if (starrableId == null) { - throw new BuiltValueNullFieldError('GAddStarInput', 'starrableId'); - } + _$GAddStarInput._({this.clientMutationId, required this.starrableId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + starrableId, 'GAddStarInput', 'starrableId'); } @override @@ -18040,23 +18453,24 @@ class _$GAddStarInput extends GAddStarInput { class GAddStarInputBuilder implements Builder { - _$GAddStarInput _$v; + _$GAddStarInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _starrableId; - String get starrableId => _$this._starrableId; - set starrableId(String starrableId) => _$this._starrableId = starrableId; + String? _starrableId; + String? get starrableId => _$this._starrableId; + set starrableId(String? starrableId) => _$this._starrableId = starrableId; GAddStarInputBuilder(); GAddStarInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _starrableId = _$v.starrableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _starrableId = $v.starrableId; _$v = null; } return this; @@ -18064,14 +18478,12 @@ class GAddStarInputBuilder @override void replace(GAddStarInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAddStarInput; } @override - void update(void Function(GAddStarInputBuilder) updates) { + void update(void Function(GAddStarInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18079,7 +18491,9 @@ class GAddStarInputBuilder _$GAddStarInput build() { final _$result = _$v ?? new _$GAddStarInput._( - clientMutationId: clientMutationId, starrableId: starrableId); + clientMutationId: clientMutationId, + starrableId: BuiltValueNullFieldError.checkNotNull( + starrableId, 'GAddStarInput', 'starrableId')); replace(_$result); return _$result; } @@ -18087,20 +18501,19 @@ class GAddStarInputBuilder class _$GArchiveRepositoryInput extends GArchiveRepositoryInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String repositoryId; factory _$GArchiveRepositoryInput( - [void Function(GArchiveRepositoryInputBuilder) updates]) => + [void Function(GArchiveRepositoryInputBuilder)? updates]) => (new GArchiveRepositoryInputBuilder()..update(updates)).build(); - _$GArchiveRepositoryInput._({this.clientMutationId, this.repositoryId}) + _$GArchiveRepositoryInput._( + {this.clientMutationId, required this.repositoryId}) : super._() { - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GArchiveRepositoryInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GArchiveRepositoryInput', 'repositoryId'); } @override @@ -18137,23 +18550,24 @@ class _$GArchiveRepositoryInput extends GArchiveRepositoryInput { class GArchiveRepositoryInputBuilder implements Builder { - _$GArchiveRepositoryInput _$v; + _$GArchiveRepositoryInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GArchiveRepositoryInputBuilder(); GArchiveRepositoryInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -18161,14 +18575,12 @@ class GArchiveRepositoryInputBuilder @override void replace(GArchiveRepositoryInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GArchiveRepositoryInput; } @override - void update(void Function(GArchiveRepositoryInputBuilder) updates) { + void update(void Function(GArchiveRepositoryInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18176,7 +18588,9 @@ class GArchiveRepositoryInputBuilder _$GArchiveRepositoryInput build() { final _$result = _$v ?? new _$GArchiveRepositoryInput._( - clientMutationId: clientMutationId, repositoryId: repositoryId); + clientMutationId: clientMutationId, + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GArchiveRepositoryInput', 'repositoryId')); replace(_$result); return _$result; } @@ -18184,11 +18598,11 @@ class GArchiveRepositoryInputBuilder class _$GAuditLogOrder extends GAuditLogOrder { @override - final GOrderDirection direction; + final GOrderDirection? direction; @override - final GAuditLogOrderField field; + final GAuditLogOrderField? field; - factory _$GAuditLogOrder([void Function(GAuditLogOrderBuilder) updates]) => + factory _$GAuditLogOrder([void Function(GAuditLogOrderBuilder)? updates]) => (new GAuditLogOrderBuilder()..update(updates)).build(); _$GAuditLogOrder._({this.direction, this.field}) : super._(); @@ -18225,22 +18639,23 @@ class _$GAuditLogOrder extends GAuditLogOrder { class GAuditLogOrderBuilder implements Builder { - _$GAuditLogOrder _$v; + _$GAuditLogOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GAuditLogOrderField _field; - GAuditLogOrderField get field => _$this._field; - set field(GAuditLogOrderField field) => _$this._field = field; + GAuditLogOrderField? _field; + GAuditLogOrderField? get field => _$this._field; + set field(GAuditLogOrderField? field) => _$this._field = field; GAuditLogOrderBuilder(); GAuditLogOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -18248,14 +18663,12 @@ class GAuditLogOrderBuilder @override void replace(GAuditLogOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAuditLogOrder; } @override - void update(void Function(GAuditLogOrderBuilder) updates) { + void update(void Function(GAuditLogOrderBuilder)? updates) { if (updates != null) updates(this); } @@ -18271,23 +18684,21 @@ class GAuditLogOrderBuilder class _$GCancelEnterpriseAdminInvitationInput extends GCancelEnterpriseAdminInvitationInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String invitationId; factory _$GCancelEnterpriseAdminInvitationInput( - [void Function(GCancelEnterpriseAdminInvitationInputBuilder) + [void Function(GCancelEnterpriseAdminInvitationInputBuilder)? updates]) => (new GCancelEnterpriseAdminInvitationInputBuilder()..update(updates)) .build(); _$GCancelEnterpriseAdminInvitationInput._( - {this.clientMutationId, this.invitationId}) + {this.clientMutationId, required this.invitationId}) : super._() { - if (invitationId == null) { - throw new BuiltValueNullFieldError( - 'GCancelEnterpriseAdminInvitationInput', 'invitationId'); - } + BuiltValueNullFieldError.checkNotNull( + invitationId, 'GCancelEnterpriseAdminInvitationInput', 'invitationId'); } @override @@ -18326,23 +18737,24 @@ class GCancelEnterpriseAdminInvitationInputBuilder implements Builder { - _$GCancelEnterpriseAdminInvitationInput _$v; + _$GCancelEnterpriseAdminInvitationInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _invitationId; - String get invitationId => _$this._invitationId; - set invitationId(String invitationId) => _$this._invitationId = invitationId; + String? _invitationId; + String? get invitationId => _$this._invitationId; + set invitationId(String? invitationId) => _$this._invitationId = invitationId; GCancelEnterpriseAdminInvitationInputBuilder(); GCancelEnterpriseAdminInvitationInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _invitationId = _$v.invitationId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _invitationId = $v.invitationId; _$v = null; } return this; @@ -18350,15 +18762,13 @@ class GCancelEnterpriseAdminInvitationInputBuilder @override void replace(GCancelEnterpriseAdminInvitationInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCancelEnterpriseAdminInvitationInput; } @override void update( - void Function(GCancelEnterpriseAdminInvitationInputBuilder) updates) { + void Function(GCancelEnterpriseAdminInvitationInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18366,7 +18776,9 @@ class GCancelEnterpriseAdminInvitationInputBuilder _$GCancelEnterpriseAdminInvitationInput build() { final _$result = _$v ?? new _$GCancelEnterpriseAdminInvitationInput._( - clientMutationId: clientMutationId, invitationId: invitationId); + clientMutationId: clientMutationId, + invitationId: BuiltValueNullFieldError.checkNotNull(invitationId, + 'GCancelEnterpriseAdminInvitationInput', 'invitationId')); replace(_$result); return _$result; } @@ -18374,20 +18786,20 @@ class GCancelEnterpriseAdminInvitationInputBuilder class _$GChangeUserStatusInput extends GChangeUserStatusInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String emoji; + final String? emoji; @override - final GDateTime expiresAt; + final GDateTime? expiresAt; @override - final bool limitedAvailability; + final bool? limitedAvailability; @override - final String message; + final String? message; @override - final String organizationId; + final String? organizationId; factory _$GChangeUserStatusInput( - [void Function(GChangeUserStatusInputBuilder) updates]) => + [void Function(GChangeUserStatusInputBuilder)? updates]) => (new GChangeUserStatusInputBuilder()..update(updates)).build(); _$GChangeUserStatusInput._( @@ -18447,46 +18859,47 @@ class _$GChangeUserStatusInput extends GChangeUserStatusInput { class GChangeUserStatusInputBuilder implements Builder { - _$GChangeUserStatusInput _$v; + _$GChangeUserStatusInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _emoji; - String get emoji => _$this._emoji; - set emoji(String emoji) => _$this._emoji = emoji; + String? _emoji; + String? get emoji => _$this._emoji; + set emoji(String? emoji) => _$this._emoji = emoji; - GDateTimeBuilder _expiresAt; + GDateTimeBuilder? _expiresAt; GDateTimeBuilder get expiresAt => _$this._expiresAt ??= new GDateTimeBuilder(); - set expiresAt(GDateTimeBuilder expiresAt) => _$this._expiresAt = expiresAt; + set expiresAt(GDateTimeBuilder? expiresAt) => _$this._expiresAt = expiresAt; - bool _limitedAvailability; - bool get limitedAvailability => _$this._limitedAvailability; - set limitedAvailability(bool limitedAvailability) => + bool? _limitedAvailability; + bool? get limitedAvailability => _$this._limitedAvailability; + set limitedAvailability(bool? limitedAvailability) => _$this._limitedAvailability = limitedAvailability; - String _message; - String get message => _$this._message; - set message(String message) => _$this._message = message; + String? _message; + String? get message => _$this._message; + set message(String? message) => _$this._message = message; - String _organizationId; - String get organizationId => _$this._organizationId; - set organizationId(String organizationId) => + String? _organizationId; + String? get organizationId => _$this._organizationId; + set organizationId(String? organizationId) => _$this._organizationId = organizationId; GChangeUserStatusInputBuilder(); GChangeUserStatusInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _emoji = _$v.emoji; - _expiresAt = _$v.expiresAt?.toBuilder(); - _limitedAvailability = _$v.limitedAvailability; - _message = _$v.message; - _organizationId = _$v.organizationId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _emoji = $v.emoji; + _expiresAt = $v.expiresAt?.toBuilder(); + _limitedAvailability = $v.limitedAvailability; + _message = $v.message; + _organizationId = $v.organizationId; _$v = null; } return this; @@ -18494,14 +18907,12 @@ class GChangeUserStatusInputBuilder @override void replace(GChangeUserStatusInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GChangeUserStatusInput; } @override - void update(void Function(GChangeUserStatusInputBuilder) updates) { + void update(void Function(GChangeUserStatusInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18518,7 +18929,7 @@ class GChangeUserStatusInputBuilder message: message, organizationId: organizationId); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'expiresAt'; _expiresAt?.build(); @@ -18535,20 +18946,19 @@ class GChangeUserStatusInputBuilder class _$GClearLabelsFromLabelableInput extends GClearLabelsFromLabelableInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String labelableId; factory _$GClearLabelsFromLabelableInput( - [void Function(GClearLabelsFromLabelableInputBuilder) updates]) => + [void Function(GClearLabelsFromLabelableInputBuilder)? updates]) => (new GClearLabelsFromLabelableInputBuilder()..update(updates)).build(); - _$GClearLabelsFromLabelableInput._({this.clientMutationId, this.labelableId}) + _$GClearLabelsFromLabelableInput._( + {this.clientMutationId, required this.labelableId}) : super._() { - if (labelableId == null) { - throw new BuiltValueNullFieldError( - 'GClearLabelsFromLabelableInput', 'labelableId'); - } + BuiltValueNullFieldError.checkNotNull( + labelableId, 'GClearLabelsFromLabelableInput', 'labelableId'); } @override @@ -18586,23 +18996,24 @@ class GClearLabelsFromLabelableInputBuilder implements Builder { - _$GClearLabelsFromLabelableInput _$v; + _$GClearLabelsFromLabelableInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _labelableId; - String get labelableId => _$this._labelableId; - set labelableId(String labelableId) => _$this._labelableId = labelableId; + String? _labelableId; + String? get labelableId => _$this._labelableId; + set labelableId(String? labelableId) => _$this._labelableId = labelableId; GClearLabelsFromLabelableInputBuilder(); GClearLabelsFromLabelableInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _labelableId = _$v.labelableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _labelableId = $v.labelableId; _$v = null; } return this; @@ -18610,14 +19021,12 @@ class GClearLabelsFromLabelableInputBuilder @override void replace(GClearLabelsFromLabelableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GClearLabelsFromLabelableInput; } @override - void update(void Function(GClearLabelsFromLabelableInputBuilder) updates) { + void update(void Function(GClearLabelsFromLabelableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18625,7 +19034,9 @@ class GClearLabelsFromLabelableInputBuilder _$GClearLabelsFromLabelableInput build() { final _$result = _$v ?? new _$GClearLabelsFromLabelableInput._( - clientMutationId: clientMutationId, labelableId: labelableId); + clientMutationId: clientMutationId, + labelableId: BuiltValueNullFieldError.checkNotNull( + labelableId, 'GClearLabelsFromLabelableInput', 'labelableId')); replace(_$result); return _$result; } @@ -18633,46 +19044,40 @@ class GClearLabelsFromLabelableInputBuilder class _$GCloneProjectInput extends GCloneProjectInput { @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override final bool includeWorkflows; @override final String name; @override - final bool public; + final bool? public; @override final String sourceId; @override final String targetOwnerId; factory _$GCloneProjectInput( - [void Function(GCloneProjectInputBuilder) updates]) => + [void Function(GCloneProjectInputBuilder)? updates]) => (new GCloneProjectInputBuilder()..update(updates)).build(); _$GCloneProjectInput._( {this.body, this.clientMutationId, - this.includeWorkflows, - this.name, + required this.includeWorkflows, + required this.name, this.public, - this.sourceId, - this.targetOwnerId}) + required this.sourceId, + required this.targetOwnerId}) : super._() { - if (includeWorkflows == null) { - throw new BuiltValueNullFieldError( - 'GCloneProjectInput', 'includeWorkflows'); - } - if (name == null) { - throw new BuiltValueNullFieldError('GCloneProjectInput', 'name'); - } - if (sourceId == null) { - throw new BuiltValueNullFieldError('GCloneProjectInput', 'sourceId'); - } - if (targetOwnerId == null) { - throw new BuiltValueNullFieldError('GCloneProjectInput', 'targetOwnerId'); - } + BuiltValueNullFieldError.checkNotNull( + includeWorkflows, 'GCloneProjectInput', 'includeWorkflows'); + BuiltValueNullFieldError.checkNotNull(name, 'GCloneProjectInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + sourceId, 'GCloneProjectInput', 'sourceId'); + BuiltValueNullFieldError.checkNotNull( + targetOwnerId, 'GCloneProjectInput', 'targetOwnerId'); } @override @@ -18727,50 +19132,51 @@ class _$GCloneProjectInput extends GCloneProjectInput { class GCloneProjectInputBuilder implements Builder { - _$GCloneProjectInput _$v; + _$GCloneProjectInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - bool _includeWorkflows; - bool get includeWorkflows => _$this._includeWorkflows; - set includeWorkflows(bool includeWorkflows) => + bool? _includeWorkflows; + bool? get includeWorkflows => _$this._includeWorkflows; + set includeWorkflows(bool? includeWorkflows) => _$this._includeWorkflows = includeWorkflows; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - bool _public; - bool get public => _$this._public; - set public(bool public) => _$this._public = public; + bool? _public; + bool? get public => _$this._public; + set public(bool? public) => _$this._public = public; - String _sourceId; - String get sourceId => _$this._sourceId; - set sourceId(String sourceId) => _$this._sourceId = sourceId; + String? _sourceId; + String? get sourceId => _$this._sourceId; + set sourceId(String? sourceId) => _$this._sourceId = sourceId; - String _targetOwnerId; - String get targetOwnerId => _$this._targetOwnerId; - set targetOwnerId(String targetOwnerId) => + String? _targetOwnerId; + String? get targetOwnerId => _$this._targetOwnerId; + set targetOwnerId(String? targetOwnerId) => _$this._targetOwnerId = targetOwnerId; GCloneProjectInputBuilder(); GCloneProjectInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _includeWorkflows = _$v.includeWorkflows; - _name = _$v.name; - _public = _$v.public; - _sourceId = _$v.sourceId; - _targetOwnerId = _$v.targetOwnerId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _includeWorkflows = $v.includeWorkflows; + _name = $v.name; + _public = $v.public; + _sourceId = $v.sourceId; + _targetOwnerId = $v.targetOwnerId; _$v = null; } return this; @@ -18778,14 +19184,12 @@ class GCloneProjectInputBuilder @override void replace(GCloneProjectInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCloneProjectInput; } @override - void update(void Function(GCloneProjectInputBuilder) updates) { + void update(void Function(GCloneProjectInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18795,11 +19199,15 @@ class GCloneProjectInputBuilder new _$GCloneProjectInput._( body: body, clientMutationId: clientMutationId, - includeWorkflows: includeWorkflows, - name: name, + includeWorkflows: BuiltValueNullFieldError.checkNotNull( + includeWorkflows, 'GCloneProjectInput', 'includeWorkflows'), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GCloneProjectInput', 'name'), public: public, - sourceId: sourceId, - targetOwnerId: targetOwnerId); + sourceId: BuiltValueNullFieldError.checkNotNull( + sourceId, 'GCloneProjectInput', 'sourceId'), + targetOwnerId: BuiltValueNullFieldError.checkNotNull( + targetOwnerId, 'GCloneProjectInput', 'targetOwnerId')); replace(_$result); return _$result; } @@ -18807,9 +19215,9 @@ class GCloneProjectInputBuilder class _$GCloneTemplateRepositoryInput extends GCloneTemplateRepositoryInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String description; + final String? description; @override final String name; @override @@ -18820,33 +19228,25 @@ class _$GCloneTemplateRepositoryInput extends GCloneTemplateRepositoryInput { final GRepositoryVisibility visibility; factory _$GCloneTemplateRepositoryInput( - [void Function(GCloneTemplateRepositoryInputBuilder) updates]) => + [void Function(GCloneTemplateRepositoryInputBuilder)? updates]) => (new GCloneTemplateRepositoryInputBuilder()..update(updates)).build(); _$GCloneTemplateRepositoryInput._( {this.clientMutationId, this.description, - this.name, - this.ownerId, - this.repositoryId, - this.visibility}) + required this.name, + required this.ownerId, + required this.repositoryId, + required this.visibility}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError( - 'GCloneTemplateRepositoryInput', 'name'); - } - if (ownerId == null) { - throw new BuiltValueNullFieldError( - 'GCloneTemplateRepositoryInput', 'ownerId'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GCloneTemplateRepositoryInput', 'repositoryId'); - } - if (visibility == null) { - throw new BuiltValueNullFieldError( - 'GCloneTemplateRepositoryInput', 'visibility'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GCloneTemplateRepositoryInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + ownerId, 'GCloneTemplateRepositoryInput', 'ownerId'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCloneTemplateRepositoryInput', 'repositoryId'); + BuiltValueNullFieldError.checkNotNull( + visibility, 'GCloneTemplateRepositoryInput', 'visibility'); } @override @@ -18901,44 +19301,45 @@ class GCloneTemplateRepositoryInputBuilder implements Builder { - _$GCloneTemplateRepositoryInput _$v; + _$GCloneTemplateRepositoryInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _description; - String get description => _$this._description; - set description(String description) => _$this._description = description; + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _ownerId; - String get ownerId => _$this._ownerId; - set ownerId(String ownerId) => _$this._ownerId = ownerId; + String? _ownerId; + String? get ownerId => _$this._ownerId; + set ownerId(String? ownerId) => _$this._ownerId = ownerId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - GRepositoryVisibility _visibility; - GRepositoryVisibility get visibility => _$this._visibility; - set visibility(GRepositoryVisibility visibility) => + GRepositoryVisibility? _visibility; + GRepositoryVisibility? get visibility => _$this._visibility; + set visibility(GRepositoryVisibility? visibility) => _$this._visibility = visibility; GCloneTemplateRepositoryInputBuilder(); GCloneTemplateRepositoryInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _description = _$v.description; - _name = _$v.name; - _ownerId = _$v.ownerId; - _repositoryId = _$v.repositoryId; - _visibility = _$v.visibility; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _description = $v.description; + _name = $v.name; + _ownerId = $v.ownerId; + _repositoryId = $v.repositoryId; + _visibility = $v.visibility; _$v = null; } return this; @@ -18946,14 +19347,12 @@ class GCloneTemplateRepositoryInputBuilder @override void replace(GCloneTemplateRepositoryInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCloneTemplateRepositoryInput; } @override - void update(void Function(GCloneTemplateRepositoryInputBuilder) updates) { + void update(void Function(GCloneTemplateRepositoryInputBuilder)? updates) { if (updates != null) updates(this); } @@ -18963,10 +19362,14 @@ class GCloneTemplateRepositoryInputBuilder new _$GCloneTemplateRepositoryInput._( clientMutationId: clientMutationId, description: description, - name: name, - ownerId: ownerId, - repositoryId: repositoryId, - visibility: visibility); + name: BuiltValueNullFieldError.checkNotNull( + name, 'GCloneTemplateRepositoryInput', 'name'), + ownerId: BuiltValueNullFieldError.checkNotNull( + ownerId, 'GCloneTemplateRepositoryInput', 'ownerId'), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCloneTemplateRepositoryInput', 'repositoryId'), + visibility: BuiltValueNullFieldError.checkNotNull( + visibility, 'GCloneTemplateRepositoryInput', 'visibility')); replace(_$result); return _$result; } @@ -18974,18 +19377,18 @@ class GCloneTemplateRepositoryInputBuilder class _$GCloseIssueInput extends GCloseIssueInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String issueId; factory _$GCloseIssueInput( - [void Function(GCloseIssueInputBuilder) updates]) => + [void Function(GCloseIssueInputBuilder)? updates]) => (new GCloseIssueInputBuilder()..update(updates)).build(); - _$GCloseIssueInput._({this.clientMutationId, this.issueId}) : super._() { - if (issueId == null) { - throw new BuiltValueNullFieldError('GCloseIssueInput', 'issueId'); - } + _$GCloseIssueInput._({this.clientMutationId, required this.issueId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + issueId, 'GCloseIssueInput', 'issueId'); } @override @@ -19020,23 +19423,24 @@ class _$GCloseIssueInput extends GCloseIssueInput { class GCloseIssueInputBuilder implements Builder { - _$GCloseIssueInput _$v; + _$GCloseIssueInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _issueId; - String get issueId => _$this._issueId; - set issueId(String issueId) => _$this._issueId = issueId; + String? _issueId; + String? get issueId => _$this._issueId; + set issueId(String? issueId) => _$this._issueId = issueId; GCloseIssueInputBuilder(); GCloseIssueInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _issueId = _$v.issueId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _issueId = $v.issueId; _$v = null; } return this; @@ -19044,14 +19448,12 @@ class GCloseIssueInputBuilder @override void replace(GCloseIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCloseIssueInput; } @override - void update(void Function(GCloseIssueInputBuilder) updates) { + void update(void Function(GCloseIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -19059,7 +19461,9 @@ class GCloseIssueInputBuilder _$GCloseIssueInput build() { final _$result = _$v ?? new _$GCloseIssueInput._( - clientMutationId: clientMutationId, issueId: issueId); + clientMutationId: clientMutationId, + issueId: BuiltValueNullFieldError.checkNotNull( + issueId, 'GCloseIssueInput', 'issueId')); replace(_$result); return _$result; } @@ -19067,20 +19471,19 @@ class GCloseIssueInputBuilder class _$GClosePullRequestInput extends GClosePullRequestInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String pullRequestId; factory _$GClosePullRequestInput( - [void Function(GClosePullRequestInputBuilder) updates]) => + [void Function(GClosePullRequestInputBuilder)? updates]) => (new GClosePullRequestInputBuilder()..update(updates)).build(); - _$GClosePullRequestInput._({this.clientMutationId, this.pullRequestId}) + _$GClosePullRequestInput._( + {this.clientMutationId, required this.pullRequestId}) : super._() { - if (pullRequestId == null) { - throw new BuiltValueNullFieldError( - 'GClosePullRequestInput', 'pullRequestId'); - } + BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GClosePullRequestInput', 'pullRequestId'); } @override @@ -19116,24 +19519,25 @@ class _$GClosePullRequestInput extends GClosePullRequestInput { class GClosePullRequestInputBuilder implements Builder { - _$GClosePullRequestInput _$v; + _$GClosePullRequestInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; GClosePullRequestInputBuilder(); GClosePullRequestInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _pullRequestId = _$v.pullRequestId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _pullRequestId = $v.pullRequestId; _$v = null; } return this; @@ -19141,14 +19545,12 @@ class GClosePullRequestInputBuilder @override void replace(GClosePullRequestInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GClosePullRequestInput; } @override - void update(void Function(GClosePullRequestInputBuilder) updates) { + void update(void Function(GClosePullRequestInputBuilder)? updates) { if (updates != null) updates(this); } @@ -19156,7 +19558,9 @@ class GClosePullRequestInputBuilder _$GClosePullRequestInput build() { final _$result = _$v ?? new _$GClosePullRequestInput._( - clientMutationId: clientMutationId, pullRequestId: pullRequestId); + clientMutationId: clientMutationId, + pullRequestId: BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GClosePullRequestInput', 'pullRequestId')); replace(_$result); return _$result; } @@ -19164,18 +19568,14 @@ class GClosePullRequestInputBuilder class _$GCommitAuthor extends GCommitAuthor { @override - final BuiltList emails; + final BuiltList? emails; @override - final String id; + final String? id; - factory _$GCommitAuthor([void Function(GCommitAuthorBuilder) updates]) => + factory _$GCommitAuthor([void Function(GCommitAuthorBuilder)? updates]) => (new GCommitAuthorBuilder()..update(updates)).build(); - _$GCommitAuthor._({this.emails, this.id}) : super._() { - if (emails == null) { - throw new BuiltValueNullFieldError('GCommitAuthor', 'emails'); - } - } + _$GCommitAuthor._({this.emails, this.id}) : super._(); @override GCommitAuthor rebuild(void Function(GCommitAuthorBuilder) updates) => @@ -19206,23 +19606,24 @@ class _$GCommitAuthor extends GCommitAuthor { class GCommitAuthorBuilder implements Builder { - _$GCommitAuthor _$v; + _$GCommitAuthor? _$v; - ListBuilder _emails; + ListBuilder? _emails; ListBuilder get emails => _$this._emails ??= new ListBuilder(); - set emails(ListBuilder emails) => _$this._emails = emails; + set emails(ListBuilder? emails) => _$this._emails = emails; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GCommitAuthorBuilder(); GCommitAuthorBuilder get _$this { - if (_$v != null) { - _emails = _$v.emails?.toBuilder(); - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _emails = $v.emails?.toBuilder(); + _id = $v.id; _$v = null; } return this; @@ -19230,14 +19631,12 @@ class GCommitAuthorBuilder @override void replace(GCommitAuthor other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCommitAuthor; } @override - void update(void Function(GCommitAuthorBuilder) updates) { + void update(void Function(GCommitAuthorBuilder)? updates) { if (updates != null) updates(this); } @@ -19245,12 +19644,12 @@ class GCommitAuthorBuilder _$GCommitAuthor build() { _$GCommitAuthor _$result; try { - _$result = _$v ?? new _$GCommitAuthor._(emails: emails.build(), id: id); + _$result = _$v ?? new _$GCommitAuthor._(emails: _emails?.build(), id: id); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'emails'; - emails.build(); + _emails?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GCommitAuthor', _$failedField, e.toString()); @@ -19269,17 +19668,15 @@ class _$GCommitContributionOrder extends GCommitContributionOrder { final GCommitContributionOrderField field; factory _$GCommitContributionOrder( - [void Function(GCommitContributionOrderBuilder) updates]) => + [void Function(GCommitContributionOrderBuilder)? updates]) => (new GCommitContributionOrderBuilder()..update(updates)).build(); - _$GCommitContributionOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GCommitContributionOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GCommitContributionOrder', 'field'); - } + _$GCommitContributionOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GCommitContributionOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GCommitContributionOrder', 'field'); } @override @@ -19316,22 +19713,23 @@ class _$GCommitContributionOrder extends GCommitContributionOrder { class GCommitContributionOrderBuilder implements Builder { - _$GCommitContributionOrder _$v; + _$GCommitContributionOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GCommitContributionOrderField _field; - GCommitContributionOrderField get field => _$this._field; - set field(GCommitContributionOrderField field) => _$this._field = field; + GCommitContributionOrderField? _field; + GCommitContributionOrderField? get field => _$this._field; + set field(GCommitContributionOrderField? field) => _$this._field = field; GCommitContributionOrderBuilder(); GCommitContributionOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -19339,21 +19737,23 @@ class GCommitContributionOrderBuilder @override void replace(GCommitContributionOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCommitContributionOrder; } @override - void update(void Function(GCommitContributionOrderBuilder) updates) { + void update(void Function(GCommitContributionOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GCommitContributionOrder build() { final _$result = _$v ?? - new _$GCommitContributionOrder._(direction: direction, field: field); + new _$GCommitContributionOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GCommitContributionOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GCommitContributionOrder', 'field')); replace(_$result); return _$result; } @@ -19363,16 +19763,15 @@ class _$GContributionOrder extends GContributionOrder { @override final GOrderDirection direction; @override - final GContributionOrderField field; + final GContributionOrderField? field; factory _$GContributionOrder( - [void Function(GContributionOrderBuilder) updates]) => + [void Function(GContributionOrderBuilder)? updates]) => (new GContributionOrderBuilder()..update(updates)).build(); - _$GContributionOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GContributionOrder', 'direction'); - } + _$GContributionOrder._({required this.direction, this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GContributionOrder', 'direction'); } @override @@ -19408,22 +19807,23 @@ class _$GContributionOrder extends GContributionOrder { class GContributionOrderBuilder implements Builder { - _$GContributionOrder _$v; + _$GContributionOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GContributionOrderField _field; - GContributionOrderField get field => _$this._field; - set field(GContributionOrderField field) => _$this._field = field; + GContributionOrderField? _field; + GContributionOrderField? get field => _$this._field; + set field(GContributionOrderField? field) => _$this._field = field; GContributionOrderBuilder(); GContributionOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -19431,21 +19831,22 @@ class GContributionOrderBuilder @override void replace(GContributionOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GContributionOrder; } @override - void update(void Function(GContributionOrderBuilder) updates) { + void update(void Function(GContributionOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GContributionOrder build() { - final _$result = - _$v ?? new _$GContributionOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GContributionOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GContributionOrder', 'direction'), + field: field); replace(_$result); return _$result; } @@ -19454,18 +19855,18 @@ class GContributionOrderBuilder class _$GConvertProjectCardNoteToIssueInput extends GConvertProjectCardNoteToIssueInput { @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override final String projectCardId; @override final String repositoryId; @override - final String title; + final String? title; factory _$GConvertProjectCardNoteToIssueInput( - [void Function(GConvertProjectCardNoteToIssueInputBuilder) + [void Function(GConvertProjectCardNoteToIssueInputBuilder)? updates]) => (new GConvertProjectCardNoteToIssueInputBuilder()..update(updates)) .build(); @@ -19473,18 +19874,14 @@ class _$GConvertProjectCardNoteToIssueInput _$GConvertProjectCardNoteToIssueInput._( {this.body, this.clientMutationId, - this.projectCardId, - this.repositoryId, + required this.projectCardId, + required this.repositoryId, this.title}) : super._() { - if (projectCardId == null) { - throw new BuiltValueNullFieldError( - 'GConvertProjectCardNoteToIssueInput', 'projectCardId'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GConvertProjectCardNoteToIssueInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + projectCardId, 'GConvertProjectCardNoteToIssueInput', 'projectCardId'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GConvertProjectCardNoteToIssueInput', 'repositoryId'); } @override @@ -19533,39 +19930,40 @@ class GConvertProjectCardNoteToIssueInputBuilder implements Builder { - _$GConvertProjectCardNoteToIssueInput _$v; + _$GConvertProjectCardNoteToIssueInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _projectCardId; - String get projectCardId => _$this._projectCardId; - set projectCardId(String projectCardId) => + String? _projectCardId; + String? get projectCardId => _$this._projectCardId; + set projectCardId(String? projectCardId) => _$this._projectCardId = projectCardId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GConvertProjectCardNoteToIssueInputBuilder(); GConvertProjectCardNoteToIssueInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _projectCardId = _$v.projectCardId; - _repositoryId = _$v.repositoryId; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _projectCardId = $v.projectCardId; + _repositoryId = $v.repositoryId; + _title = $v.title; _$v = null; } return this; @@ -19573,15 +19971,13 @@ class GConvertProjectCardNoteToIssueInputBuilder @override void replace(GConvertProjectCardNoteToIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GConvertProjectCardNoteToIssueInput; } @override void update( - void Function(GConvertProjectCardNoteToIssueInputBuilder) updates) { + void Function(GConvertProjectCardNoteToIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -19591,8 +19987,10 @@ class GConvertProjectCardNoteToIssueInputBuilder new _$GConvertProjectCardNoteToIssueInput._( body: body, clientMutationId: clientMutationId, - projectCardId: projectCardId, - repositoryId: repositoryId, + projectCardId: BuiltValueNullFieldError.checkNotNull(projectCardId, + 'GConvertProjectCardNoteToIssueInput', 'projectCardId'), + repositoryId: BuiltValueNullFieldError.checkNotNull(repositoryId, + 'GConvertProjectCardNoteToIssueInput', 'repositoryId'), title: title); replace(_$result); return _$result; @@ -19602,49 +20000,49 @@ class GConvertProjectCardNoteToIssueInputBuilder class _$GCreateBranchProtectionRuleInput extends GCreateBranchProtectionRuleInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final bool dismissesStaleReviews; + final bool? dismissesStaleReviews; @override - final bool isAdminEnforced; + final bool? isAdminEnforced; @override final String pattern; @override - final BuiltList pushActorIds; + final BuiltList? pushActorIds; @override final String repositoryId; @override - final int requiredApprovingReviewCount; + final int? requiredApprovingReviewCount; @override - final BuiltList requiredStatusCheckContexts; + final BuiltList? requiredStatusCheckContexts; @override - final bool requiresApprovingReviews; + final bool? requiresApprovingReviews; @override - final bool requiresCodeOwnerReviews; + final bool? requiresCodeOwnerReviews; @override - final bool requiresCommitSignatures; + final bool? requiresCommitSignatures; @override - final bool requiresStatusChecks; + final bool? requiresStatusChecks; @override - final bool requiresStrictStatusChecks; + final bool? requiresStrictStatusChecks; @override - final bool restrictsPushes; + final bool? restrictsPushes; @override - final bool restrictsReviewDismissals; + final bool? restrictsReviewDismissals; @override - final BuiltList reviewDismissalActorIds; + final BuiltList? reviewDismissalActorIds; factory _$GCreateBranchProtectionRuleInput( - [void Function(GCreateBranchProtectionRuleInputBuilder) updates]) => + [void Function(GCreateBranchProtectionRuleInputBuilder)? updates]) => (new GCreateBranchProtectionRuleInputBuilder()..update(updates)).build(); _$GCreateBranchProtectionRuleInput._( {this.clientMutationId, this.dismissesStaleReviews, this.isAdminEnforced, - this.pattern, + required this.pattern, this.pushActorIds, - this.repositoryId, + required this.repositoryId, this.requiredApprovingReviewCount, this.requiredStatusCheckContexts, this.requiresApprovingReviews, @@ -19656,26 +20054,10 @@ class _$GCreateBranchProtectionRuleInput this.restrictsReviewDismissals, this.reviewDismissalActorIds}) : super._() { - if (pattern == null) { - throw new BuiltValueNullFieldError( - 'GCreateBranchProtectionRuleInput', 'pattern'); - } - if (pushActorIds == null) { - throw new BuiltValueNullFieldError( - 'GCreateBranchProtectionRuleInput', 'pushActorIds'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GCreateBranchProtectionRuleInput', 'repositoryId'); - } - if (requiredStatusCheckContexts == null) { - throw new BuiltValueNullFieldError( - 'GCreateBranchProtectionRuleInput', 'requiredStatusCheckContexts'); - } - if (reviewDismissalActorIds == null) { - throw new BuiltValueNullFieldError( - 'GCreateBranchProtectionRuleInput', 'reviewDismissalActorIds'); - } + BuiltValueNullFieldError.checkNotNull( + pattern, 'GCreateBranchProtectionRuleInput', 'pattern'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreateBranchProtectionRuleInput', 'repositoryId'); } @override @@ -19777,111 +20159,112 @@ class GCreateBranchProtectionRuleInputBuilder implements Builder { - _$GCreateBranchProtectionRuleInput _$v; + _$GCreateBranchProtectionRuleInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - bool _dismissesStaleReviews; - bool get dismissesStaleReviews => _$this._dismissesStaleReviews; - set dismissesStaleReviews(bool dismissesStaleReviews) => + bool? _dismissesStaleReviews; + bool? get dismissesStaleReviews => _$this._dismissesStaleReviews; + set dismissesStaleReviews(bool? dismissesStaleReviews) => _$this._dismissesStaleReviews = dismissesStaleReviews; - bool _isAdminEnforced; - bool get isAdminEnforced => _$this._isAdminEnforced; - set isAdminEnforced(bool isAdminEnforced) => + bool? _isAdminEnforced; + bool? get isAdminEnforced => _$this._isAdminEnforced; + set isAdminEnforced(bool? isAdminEnforced) => _$this._isAdminEnforced = isAdminEnforced; - String _pattern; - String get pattern => _$this._pattern; - set pattern(String pattern) => _$this._pattern = pattern; + String? _pattern; + String? get pattern => _$this._pattern; + set pattern(String? pattern) => _$this._pattern = pattern; - ListBuilder _pushActorIds; + ListBuilder? _pushActorIds; ListBuilder get pushActorIds => _$this._pushActorIds ??= new ListBuilder(); - set pushActorIds(ListBuilder pushActorIds) => + set pushActorIds(ListBuilder? pushActorIds) => _$this._pushActorIds = pushActorIds; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - int _requiredApprovingReviewCount; - int get requiredApprovingReviewCount => _$this._requiredApprovingReviewCount; - set requiredApprovingReviewCount(int requiredApprovingReviewCount) => + int? _requiredApprovingReviewCount; + int? get requiredApprovingReviewCount => _$this._requiredApprovingReviewCount; + set requiredApprovingReviewCount(int? requiredApprovingReviewCount) => _$this._requiredApprovingReviewCount = requiredApprovingReviewCount; - ListBuilder _requiredStatusCheckContexts; + ListBuilder? _requiredStatusCheckContexts; ListBuilder get requiredStatusCheckContexts => _$this._requiredStatusCheckContexts ??= new ListBuilder(); set requiredStatusCheckContexts( - ListBuilder requiredStatusCheckContexts) => + ListBuilder? requiredStatusCheckContexts) => _$this._requiredStatusCheckContexts = requiredStatusCheckContexts; - bool _requiresApprovingReviews; - bool get requiresApprovingReviews => _$this._requiresApprovingReviews; - set requiresApprovingReviews(bool requiresApprovingReviews) => + bool? _requiresApprovingReviews; + bool? get requiresApprovingReviews => _$this._requiresApprovingReviews; + set requiresApprovingReviews(bool? requiresApprovingReviews) => _$this._requiresApprovingReviews = requiresApprovingReviews; - bool _requiresCodeOwnerReviews; - bool get requiresCodeOwnerReviews => _$this._requiresCodeOwnerReviews; - set requiresCodeOwnerReviews(bool requiresCodeOwnerReviews) => + bool? _requiresCodeOwnerReviews; + bool? get requiresCodeOwnerReviews => _$this._requiresCodeOwnerReviews; + set requiresCodeOwnerReviews(bool? requiresCodeOwnerReviews) => _$this._requiresCodeOwnerReviews = requiresCodeOwnerReviews; - bool _requiresCommitSignatures; - bool get requiresCommitSignatures => _$this._requiresCommitSignatures; - set requiresCommitSignatures(bool requiresCommitSignatures) => + bool? _requiresCommitSignatures; + bool? get requiresCommitSignatures => _$this._requiresCommitSignatures; + set requiresCommitSignatures(bool? requiresCommitSignatures) => _$this._requiresCommitSignatures = requiresCommitSignatures; - bool _requiresStatusChecks; - bool get requiresStatusChecks => _$this._requiresStatusChecks; - set requiresStatusChecks(bool requiresStatusChecks) => + bool? _requiresStatusChecks; + bool? get requiresStatusChecks => _$this._requiresStatusChecks; + set requiresStatusChecks(bool? requiresStatusChecks) => _$this._requiresStatusChecks = requiresStatusChecks; - bool _requiresStrictStatusChecks; - bool get requiresStrictStatusChecks => _$this._requiresStrictStatusChecks; - set requiresStrictStatusChecks(bool requiresStrictStatusChecks) => + bool? _requiresStrictStatusChecks; + bool? get requiresStrictStatusChecks => _$this._requiresStrictStatusChecks; + set requiresStrictStatusChecks(bool? requiresStrictStatusChecks) => _$this._requiresStrictStatusChecks = requiresStrictStatusChecks; - bool _restrictsPushes; - bool get restrictsPushes => _$this._restrictsPushes; - set restrictsPushes(bool restrictsPushes) => + bool? _restrictsPushes; + bool? get restrictsPushes => _$this._restrictsPushes; + set restrictsPushes(bool? restrictsPushes) => _$this._restrictsPushes = restrictsPushes; - bool _restrictsReviewDismissals; - bool get restrictsReviewDismissals => _$this._restrictsReviewDismissals; - set restrictsReviewDismissals(bool restrictsReviewDismissals) => + bool? _restrictsReviewDismissals; + bool? get restrictsReviewDismissals => _$this._restrictsReviewDismissals; + set restrictsReviewDismissals(bool? restrictsReviewDismissals) => _$this._restrictsReviewDismissals = restrictsReviewDismissals; - ListBuilder _reviewDismissalActorIds; + ListBuilder? _reviewDismissalActorIds; ListBuilder get reviewDismissalActorIds => _$this._reviewDismissalActorIds ??= new ListBuilder(); - set reviewDismissalActorIds(ListBuilder reviewDismissalActorIds) => + set reviewDismissalActorIds(ListBuilder? reviewDismissalActorIds) => _$this._reviewDismissalActorIds = reviewDismissalActorIds; GCreateBranchProtectionRuleInputBuilder(); GCreateBranchProtectionRuleInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _dismissesStaleReviews = _$v.dismissesStaleReviews; - _isAdminEnforced = _$v.isAdminEnforced; - _pattern = _$v.pattern; - _pushActorIds = _$v.pushActorIds?.toBuilder(); - _repositoryId = _$v.repositoryId; - _requiredApprovingReviewCount = _$v.requiredApprovingReviewCount; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _dismissesStaleReviews = $v.dismissesStaleReviews; + _isAdminEnforced = $v.isAdminEnforced; + _pattern = $v.pattern; + _pushActorIds = $v.pushActorIds?.toBuilder(); + _repositoryId = $v.repositoryId; + _requiredApprovingReviewCount = $v.requiredApprovingReviewCount; _requiredStatusCheckContexts = - _$v.requiredStatusCheckContexts?.toBuilder(); - _requiresApprovingReviews = _$v.requiresApprovingReviews; - _requiresCodeOwnerReviews = _$v.requiresCodeOwnerReviews; - _requiresCommitSignatures = _$v.requiresCommitSignatures; - _requiresStatusChecks = _$v.requiresStatusChecks; - _requiresStrictStatusChecks = _$v.requiresStrictStatusChecks; - _restrictsPushes = _$v.restrictsPushes; - _restrictsReviewDismissals = _$v.restrictsReviewDismissals; - _reviewDismissalActorIds = _$v.reviewDismissalActorIds?.toBuilder(); + $v.requiredStatusCheckContexts?.toBuilder(); + _requiresApprovingReviews = $v.requiresApprovingReviews; + _requiresCodeOwnerReviews = $v.requiresCodeOwnerReviews; + _requiresCommitSignatures = $v.requiresCommitSignatures; + _requiresStatusChecks = $v.requiresStatusChecks; + _requiresStrictStatusChecks = $v.requiresStrictStatusChecks; + _restrictsPushes = $v.restrictsPushes; + _restrictsReviewDismissals = $v.restrictsReviewDismissals; + _reviewDismissalActorIds = $v.reviewDismissalActorIds?.toBuilder(); _$v = null; } return this; @@ -19889,14 +20272,12 @@ class GCreateBranchProtectionRuleInputBuilder @override void replace(GCreateBranchProtectionRuleInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateBranchProtectionRuleInput; } @override - void update(void Function(GCreateBranchProtectionRuleInputBuilder) updates) { + void update(void Function(GCreateBranchProtectionRuleInputBuilder)? updates) { if (updates != null) updates(this); } @@ -19909,11 +20290,14 @@ class GCreateBranchProtectionRuleInputBuilder clientMutationId: clientMutationId, dismissesStaleReviews: dismissesStaleReviews, isAdminEnforced: isAdminEnforced, - pattern: pattern, - pushActorIds: pushActorIds.build(), - repositoryId: repositoryId, + pattern: BuiltValueNullFieldError.checkNotNull( + pattern, 'GCreateBranchProtectionRuleInput', 'pattern'), + pushActorIds: _pushActorIds?.build(), + repositoryId: BuiltValueNullFieldError.checkNotNull(repositoryId, + 'GCreateBranchProtectionRuleInput', 'repositoryId'), requiredApprovingReviewCount: requiredApprovingReviewCount, - requiredStatusCheckContexts: requiredStatusCheckContexts.build(), + requiredStatusCheckContexts: + _requiredStatusCheckContexts?.build(), requiresApprovingReviews: requiresApprovingReviews, requiresCodeOwnerReviews: requiresCodeOwnerReviews, requiresCommitSignatures: requiresCommitSignatures, @@ -19921,18 +20305,18 @@ class GCreateBranchProtectionRuleInputBuilder requiresStrictStatusChecks: requiresStrictStatusChecks, restrictsPushes: restrictsPushes, restrictsReviewDismissals: restrictsReviewDismissals, - reviewDismissalActorIds: reviewDismissalActorIds.build()); + reviewDismissalActorIds: _reviewDismissalActorIds?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'pushActorIds'; - pushActorIds.build(); + _pushActorIds?.build(); _$failedField = 'requiredStatusCheckContexts'; - requiredStatusCheckContexts.build(); + _requiredStatusCheckContexts?.build(); _$failedField = 'reviewDismissalActorIds'; - reviewDismissalActorIds.build(); + _reviewDismissalActorIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GCreateBranchProtectionRuleInput', _$failedField, e.toString()); @@ -19951,7 +20335,7 @@ class _$GCreateEnterpriseOrganizationInput @override final String billingEmail; @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -19960,38 +20344,29 @@ class _$GCreateEnterpriseOrganizationInput final String profileName; factory _$GCreateEnterpriseOrganizationInput( - [void Function(GCreateEnterpriseOrganizationInputBuilder) updates]) => + [void Function(GCreateEnterpriseOrganizationInputBuilder)? + updates]) => (new GCreateEnterpriseOrganizationInputBuilder()..update(updates)) .build(); _$GCreateEnterpriseOrganizationInput._( - {this.adminLogins, - this.billingEmail, + {required this.adminLogins, + required this.billingEmail, this.clientMutationId, - this.enterpriseId, - this.login, - this.profileName}) + required this.enterpriseId, + required this.login, + required this.profileName}) : super._() { - if (adminLogins == null) { - throw new BuiltValueNullFieldError( - 'GCreateEnterpriseOrganizationInput', 'adminLogins'); - } - if (billingEmail == null) { - throw new BuiltValueNullFieldError( - 'GCreateEnterpriseOrganizationInput', 'billingEmail'); - } - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GCreateEnterpriseOrganizationInput', 'enterpriseId'); - } - if (login == null) { - throw new BuiltValueNullFieldError( - 'GCreateEnterpriseOrganizationInput', 'login'); - } - if (profileName == null) { - throw new BuiltValueNullFieldError( - 'GCreateEnterpriseOrganizationInput', 'profileName'); - } + BuiltValueNullFieldError.checkNotNull( + adminLogins, 'GCreateEnterpriseOrganizationInput', 'adminLogins'); + BuiltValueNullFieldError.checkNotNull( + billingEmail, 'GCreateEnterpriseOrganizationInput', 'billingEmail'); + BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GCreateEnterpriseOrganizationInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + login, 'GCreateEnterpriseOrganizationInput', 'login'); + BuiltValueNullFieldError.checkNotNull( + profileName, 'GCreateEnterpriseOrganizationInput', 'profileName'); } @override @@ -20044,45 +20419,46 @@ class GCreateEnterpriseOrganizationInputBuilder implements Builder { - _$GCreateEnterpriseOrganizationInput _$v; + _$GCreateEnterpriseOrganizationInput? _$v; - ListBuilder _adminLogins; + ListBuilder? _adminLogins; ListBuilder get adminLogins => _$this._adminLogins ??= new ListBuilder(); - set adminLogins(ListBuilder adminLogins) => + set adminLogins(ListBuilder? adminLogins) => _$this._adminLogins = adminLogins; - String _billingEmail; - String get billingEmail => _$this._billingEmail; - set billingEmail(String billingEmail) => _$this._billingEmail = billingEmail; + String? _billingEmail; + String? get billingEmail => _$this._billingEmail; + set billingEmail(String? billingEmail) => _$this._billingEmail = billingEmail; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - String _login; - String get login => _$this._login; - set login(String login) => _$this._login = login; + String? _login; + String? get login => _$this._login; + set login(String? login) => _$this._login = login; - String _profileName; - String get profileName => _$this._profileName; - set profileName(String profileName) => _$this._profileName = profileName; + String? _profileName; + String? get profileName => _$this._profileName; + set profileName(String? profileName) => _$this._profileName = profileName; GCreateEnterpriseOrganizationInputBuilder(); GCreateEnterpriseOrganizationInputBuilder get _$this { - if (_$v != null) { - _adminLogins = _$v.adminLogins?.toBuilder(); - _billingEmail = _$v.billingEmail; - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _login = _$v.login; - _profileName = _$v.profileName; + final $v = _$v; + if ($v != null) { + _adminLogins = $v.adminLogins.toBuilder(); + _billingEmail = $v.billingEmail; + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _login = $v.login; + _profileName = $v.profileName; _$v = null; } return this; @@ -20090,15 +20466,13 @@ class GCreateEnterpriseOrganizationInputBuilder @override void replace(GCreateEnterpriseOrganizationInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateEnterpriseOrganizationInput; } @override void update( - void Function(GCreateEnterpriseOrganizationInputBuilder) updates) { + void Function(GCreateEnterpriseOrganizationInputBuilder)? updates) { if (updates != null) updates(this); } @@ -20109,13 +20483,17 @@ class GCreateEnterpriseOrganizationInputBuilder _$result = _$v ?? new _$GCreateEnterpriseOrganizationInput._( adminLogins: adminLogins.build(), - billingEmail: billingEmail, + billingEmail: BuiltValueNullFieldError.checkNotNull(billingEmail, + 'GCreateEnterpriseOrganizationInput', 'billingEmail'), clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - login: login, - profileName: profileName); + enterpriseId: BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GCreateEnterpriseOrganizationInput', 'enterpriseId'), + login: BuiltValueNullFieldError.checkNotNull( + login, 'GCreateEnterpriseOrganizationInput', 'login'), + profileName: BuiltValueNullFieldError.checkNotNull(profileName, + 'GCreateEnterpriseOrganizationInput', 'profileName')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'adminLogins'; adminLogins.build(); @@ -20132,24 +20510,24 @@ class GCreateEnterpriseOrganizationInputBuilder class _$GCreateIssueInput extends GCreateIssueInput { @override - final BuiltList assigneeIds; + final BuiltList? assigneeIds; @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override - final BuiltList labelIds; + final BuiltList? labelIds; @override - final String milestoneId; + final String? milestoneId; @override - final BuiltList projectIds; + final BuiltList? projectIds; @override final String repositoryId; @override final String title; factory _$GCreateIssueInput( - [void Function(GCreateIssueInputBuilder) updates]) => + [void Function(GCreateIssueInputBuilder)? updates]) => (new GCreateIssueInputBuilder()..update(updates)).build(); _$GCreateIssueInput._( @@ -20159,24 +20537,12 @@ class _$GCreateIssueInput extends GCreateIssueInput { this.labelIds, this.milestoneId, this.projectIds, - this.repositoryId, - this.title}) + required this.repositoryId, + required this.title}) : super._() { - if (assigneeIds == null) { - throw new BuiltValueNullFieldError('GCreateIssueInput', 'assigneeIds'); - } - if (labelIds == null) { - throw new BuiltValueNullFieldError('GCreateIssueInput', 'labelIds'); - } - if (projectIds == null) { - throw new BuiltValueNullFieldError('GCreateIssueInput', 'projectIds'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError('GCreateIssueInput', 'repositoryId'); - } - if (title == null) { - throw new BuiltValueNullFieldError('GCreateIssueInput', 'title'); - } + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreateIssueInput', 'repositoryId'); + BuiltValueNullFieldError.checkNotNull(title, 'GCreateIssueInput', 'title'); } @override @@ -20234,58 +20600,59 @@ class _$GCreateIssueInput extends GCreateIssueInput { class GCreateIssueInputBuilder implements Builder { - _$GCreateIssueInput _$v; + _$GCreateIssueInput? _$v; - ListBuilder _assigneeIds; + ListBuilder? _assigneeIds; ListBuilder get assigneeIds => _$this._assigneeIds ??= new ListBuilder(); - set assigneeIds(ListBuilder assigneeIds) => + set assigneeIds(ListBuilder? assigneeIds) => _$this._assigneeIds = assigneeIds; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - ListBuilder _labelIds; + ListBuilder? _labelIds; ListBuilder get labelIds => _$this._labelIds ??= new ListBuilder(); - set labelIds(ListBuilder labelIds) => _$this._labelIds = labelIds; + set labelIds(ListBuilder? labelIds) => _$this._labelIds = labelIds; - String _milestoneId; - String get milestoneId => _$this._milestoneId; - set milestoneId(String milestoneId) => _$this._milestoneId = milestoneId; + String? _milestoneId; + String? get milestoneId => _$this._milestoneId; + set milestoneId(String? milestoneId) => _$this._milestoneId = milestoneId; - ListBuilder _projectIds; + ListBuilder? _projectIds; ListBuilder get projectIds => _$this._projectIds ??= new ListBuilder(); - set projectIds(ListBuilder projectIds) => + set projectIds(ListBuilder? projectIds) => _$this._projectIds = projectIds; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GCreateIssueInputBuilder(); GCreateIssueInputBuilder get _$this { - if (_$v != null) { - _assigneeIds = _$v.assigneeIds?.toBuilder(); - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _labelIds = _$v.labelIds?.toBuilder(); - _milestoneId = _$v.milestoneId; - _projectIds = _$v.projectIds?.toBuilder(); - _repositoryId = _$v.repositoryId; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _assigneeIds = $v.assigneeIds?.toBuilder(); + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _labelIds = $v.labelIds?.toBuilder(); + _milestoneId = $v.milestoneId; + _projectIds = $v.projectIds?.toBuilder(); + _repositoryId = $v.repositoryId; + _title = $v.title; _$v = null; } return this; @@ -20293,14 +20660,12 @@ class GCreateIssueInputBuilder @override void replace(GCreateIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateIssueInput; } @override - void update(void Function(GCreateIssueInputBuilder) updates) { + void update(void Function(GCreateIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -20310,25 +20675,27 @@ class GCreateIssueInputBuilder try { _$result = _$v ?? new _$GCreateIssueInput._( - assigneeIds: assigneeIds.build(), + assigneeIds: _assigneeIds?.build(), body: body, clientMutationId: clientMutationId, - labelIds: labelIds.build(), + labelIds: _labelIds?.build(), milestoneId: milestoneId, - projectIds: projectIds.build(), - repositoryId: repositoryId, - title: title); + projectIds: _projectIds?.build(), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreateIssueInput', 'repositoryId'), + title: BuiltValueNullFieldError.checkNotNull( + title, 'GCreateIssueInput', 'title')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'assigneeIds'; - assigneeIds.build(); + _assigneeIds?.build(); _$failedField = 'labelIds'; - labelIds.build(); + _labelIds?.build(); _$failedField = 'projectIds'; - projectIds.build(); + _projectIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GCreateIssueInput', _$failedField, e.toString()); @@ -20342,40 +20709,33 @@ class GCreateIssueInputBuilder class _$GCreateProjectInput extends GCreateProjectInput { @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override final String name; @override final String ownerId; @override - final BuiltList repositoryIds; + final BuiltList? repositoryIds; @override - final GProjectTemplate template; + final GProjectTemplate? template; factory _$GCreateProjectInput( - [void Function(GCreateProjectInputBuilder) updates]) => + [void Function(GCreateProjectInputBuilder)? updates]) => (new GCreateProjectInputBuilder()..update(updates)).build(); _$GCreateProjectInput._( {this.body, this.clientMutationId, - this.name, - this.ownerId, + required this.name, + required this.ownerId, this.repositoryIds, this.template}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GCreateProjectInput', 'name'); - } - if (ownerId == null) { - throw new BuiltValueNullFieldError('GCreateProjectInput', 'ownerId'); - } - if (repositoryIds == null) { - throw new BuiltValueNullFieldError( - 'GCreateProjectInput', 'repositoryIds'); - } + BuiltValueNullFieldError.checkNotNull(name, 'GCreateProjectInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + ownerId, 'GCreateProjectInput', 'ownerId'); } @override @@ -20426,45 +20786,46 @@ class _$GCreateProjectInput extends GCreateProjectInput { class GCreateProjectInputBuilder implements Builder { - _$GCreateProjectInput _$v; + _$GCreateProjectInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _ownerId; - String get ownerId => _$this._ownerId; - set ownerId(String ownerId) => _$this._ownerId = ownerId; + String? _ownerId; + String? get ownerId => _$this._ownerId; + set ownerId(String? ownerId) => _$this._ownerId = ownerId; - ListBuilder _repositoryIds; + ListBuilder? _repositoryIds; ListBuilder get repositoryIds => _$this._repositoryIds ??= new ListBuilder(); - set repositoryIds(ListBuilder repositoryIds) => + set repositoryIds(ListBuilder? repositoryIds) => _$this._repositoryIds = repositoryIds; - GProjectTemplate _template; - GProjectTemplate get template => _$this._template; - set template(GProjectTemplate template) => _$this._template = template; + GProjectTemplate? _template; + GProjectTemplate? get template => _$this._template; + set template(GProjectTemplate? template) => _$this._template = template; GCreateProjectInputBuilder(); GCreateProjectInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _ownerId = _$v.ownerId; - _repositoryIds = _$v.repositoryIds?.toBuilder(); - _template = _$v.template; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _ownerId = $v.ownerId; + _repositoryIds = $v.repositoryIds?.toBuilder(); + _template = $v.template; _$v = null; } return this; @@ -20472,14 +20833,12 @@ class GCreateProjectInputBuilder @override void replace(GCreateProjectInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateProjectInput; } @override - void update(void Function(GCreateProjectInputBuilder) updates) { + void update(void Function(GCreateProjectInputBuilder)? updates) { if (updates != null) updates(this); } @@ -20491,15 +20850,17 @@ class GCreateProjectInputBuilder new _$GCreateProjectInput._( body: body, clientMutationId: clientMutationId, - name: name, - ownerId: ownerId, - repositoryIds: repositoryIds.build(), + name: BuiltValueNullFieldError.checkNotNull( + name, 'GCreateProjectInput', 'name'), + ownerId: BuiltValueNullFieldError.checkNotNull( + ownerId, 'GCreateProjectInput', 'ownerId'), + repositoryIds: _repositoryIds?.build(), template: template); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'repositoryIds'; - repositoryIds.build(); + _repositoryIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GCreateProjectInput', _$failedField, e.toString()); @@ -20515,46 +20876,39 @@ class _$GCreatePullRequestInput extends GCreatePullRequestInput { @override final String baseRefName; @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override final String headRefName; @override - final bool maintainerCanModify; + final bool? maintainerCanModify; @override final String repositoryId; @override final String title; factory _$GCreatePullRequestInput( - [void Function(GCreatePullRequestInputBuilder) updates]) => + [void Function(GCreatePullRequestInputBuilder)? updates]) => (new GCreatePullRequestInputBuilder()..update(updates)).build(); _$GCreatePullRequestInput._( - {this.baseRefName, + {required this.baseRefName, this.body, this.clientMutationId, - this.headRefName, + required this.headRefName, this.maintainerCanModify, - this.repositoryId, - this.title}) + required this.repositoryId, + required this.title}) : super._() { - if (baseRefName == null) { - throw new BuiltValueNullFieldError( - 'GCreatePullRequestInput', 'baseRefName'); - } - if (headRefName == null) { - throw new BuiltValueNullFieldError( - 'GCreatePullRequestInput', 'headRefName'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GCreatePullRequestInput', 'repositoryId'); - } - if (title == null) { - throw new BuiltValueNullFieldError('GCreatePullRequestInput', 'title'); - } + BuiltValueNullFieldError.checkNotNull( + baseRefName, 'GCreatePullRequestInput', 'baseRefName'); + BuiltValueNullFieldError.checkNotNull( + headRefName, 'GCreatePullRequestInput', 'headRefName'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreatePullRequestInput', 'repositoryId'); + BuiltValueNullFieldError.checkNotNull( + title, 'GCreatePullRequestInput', 'title'); } @override @@ -20610,49 +20964,50 @@ class _$GCreatePullRequestInput extends GCreatePullRequestInput { class GCreatePullRequestInputBuilder implements Builder { - _$GCreatePullRequestInput _$v; + _$GCreatePullRequestInput? _$v; - String _baseRefName; - String get baseRefName => _$this._baseRefName; - set baseRefName(String baseRefName) => _$this._baseRefName = baseRefName; + String? _baseRefName; + String? get baseRefName => _$this._baseRefName; + set baseRefName(String? baseRefName) => _$this._baseRefName = baseRefName; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _headRefName; - String get headRefName => _$this._headRefName; - set headRefName(String headRefName) => _$this._headRefName = headRefName; + String? _headRefName; + String? get headRefName => _$this._headRefName; + set headRefName(String? headRefName) => _$this._headRefName = headRefName; - bool _maintainerCanModify; - bool get maintainerCanModify => _$this._maintainerCanModify; - set maintainerCanModify(bool maintainerCanModify) => + bool? _maintainerCanModify; + bool? get maintainerCanModify => _$this._maintainerCanModify; + set maintainerCanModify(bool? maintainerCanModify) => _$this._maintainerCanModify = maintainerCanModify; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GCreatePullRequestInputBuilder(); GCreatePullRequestInputBuilder get _$this { - if (_$v != null) { - _baseRefName = _$v.baseRefName; - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _headRefName = _$v.headRefName; - _maintainerCanModify = _$v.maintainerCanModify; - _repositoryId = _$v.repositoryId; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _baseRefName = $v.baseRefName; + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _headRefName = $v.headRefName; + _maintainerCanModify = $v.maintainerCanModify; + _repositoryId = $v.repositoryId; + _title = $v.title; _$v = null; } return this; @@ -20660,14 +21015,12 @@ class GCreatePullRequestInputBuilder @override void replace(GCreatePullRequestInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreatePullRequestInput; } @override - void update(void Function(GCreatePullRequestInputBuilder) updates) { + void update(void Function(GCreatePullRequestInputBuilder)? updates) { if (updates != null) updates(this); } @@ -20675,13 +21028,17 @@ class GCreatePullRequestInputBuilder _$GCreatePullRequestInput build() { final _$result = _$v ?? new _$GCreatePullRequestInput._( - baseRefName: baseRefName, + baseRefName: BuiltValueNullFieldError.checkNotNull( + baseRefName, 'GCreatePullRequestInput', 'baseRefName'), body: body, clientMutationId: clientMutationId, - headRefName: headRefName, + headRefName: BuiltValueNullFieldError.checkNotNull( + headRefName, 'GCreatePullRequestInput', 'headRefName'), maintainerCanModify: maintainerCanModify, - repositoryId: repositoryId, - title: title); + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreatePullRequestInput', 'repositoryId'), + title: BuiltValueNullFieldError.checkNotNull( + title, 'GCreatePullRequestInput', 'title')); replace(_$result); return _$result; } @@ -20689,7 +21046,7 @@ class GCreatePullRequestInputBuilder class _$GCreateRefInput extends GCreateRefInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String name; @override @@ -20697,21 +21054,19 @@ class _$GCreateRefInput extends GCreateRefInput { @override final String repositoryId; - factory _$GCreateRefInput([void Function(GCreateRefInputBuilder) updates]) => + factory _$GCreateRefInput([void Function(GCreateRefInputBuilder)? updates]) => (new GCreateRefInputBuilder()..update(updates)).build(); _$GCreateRefInput._( - {this.clientMutationId, this.name, this.oid, this.repositoryId}) + {this.clientMutationId, + required this.name, + required this.oid, + required this.repositoryId}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GCreateRefInput', 'name'); - } - if (oid == null) { - throw new BuiltValueNullFieldError('GCreateRefInput', 'oid'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError('GCreateRefInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull(name, 'GCreateRefInput', 'name'); + BuiltValueNullFieldError.checkNotNull(oid, 'GCreateRefInput', 'oid'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreateRefInput', 'repositoryId'); } @override @@ -20753,33 +21108,34 @@ class _$GCreateRefInput extends GCreateRefInput { class GCreateRefInputBuilder implements Builder { - _$GCreateRefInput _$v; + _$GCreateRefInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - GGitObjectIDBuilder _oid; + GGitObjectIDBuilder? _oid; GGitObjectIDBuilder get oid => _$this._oid ??= new GGitObjectIDBuilder(); - set oid(GGitObjectIDBuilder oid) => _$this._oid = oid; + set oid(GGitObjectIDBuilder? oid) => _$this._oid = oid; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GCreateRefInputBuilder(); GCreateRefInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _oid = _$v.oid?.toBuilder(); - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _oid = $v.oid.toBuilder(); + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -20787,14 +21143,12 @@ class GCreateRefInputBuilder @override void replace(GCreateRefInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateRefInput; } @override - void update(void Function(GCreateRefInputBuilder) updates) { + void update(void Function(GCreateRefInputBuilder)? updates) { if (updates != null) updates(this); } @@ -20805,11 +21159,13 @@ class GCreateRefInputBuilder _$result = _$v ?? new _$GCreateRefInput._( clientMutationId: clientMutationId, - name: name, + name: BuiltValueNullFieldError.checkNotNull( + name, 'GCreateRefInput', 'name'), oid: oid.build(), - repositoryId: repositoryId); + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GCreateRefInput', 'repositoryId')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'oid'; oid.build(); @@ -20826,28 +21182,28 @@ class GCreateRefInputBuilder class _$GCreateRepositoryInput extends GCreateRepositoryInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String description; + final String? description; @override - final bool hasIssuesEnabled; + final bool? hasIssuesEnabled; @override - final bool hasWikiEnabled; + final bool? hasWikiEnabled; @override - final GURI homepageUrl; + final GURI? homepageUrl; @override final String name; @override - final String ownerId; + final String? ownerId; @override - final String teamId; + final String? teamId; @override - final bool template; + final bool? template; @override final GRepositoryVisibility visibility; factory _$GCreateRepositoryInput( - [void Function(GCreateRepositoryInputBuilder) updates]) => + [void Function(GCreateRepositoryInputBuilder)? updates]) => (new GCreateRepositoryInputBuilder()..update(updates)).build(); _$GCreateRepositoryInput._( @@ -20856,19 +21212,16 @@ class _$GCreateRepositoryInput extends GCreateRepositoryInput { this.hasIssuesEnabled, this.hasWikiEnabled, this.homepageUrl, - this.name, + required this.name, this.ownerId, this.teamId, this.template, - this.visibility}) + required this.visibility}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GCreateRepositoryInput', 'name'); - } - if (visibility == null) { - throw new BuiltValueNullFieldError( - 'GCreateRepositoryInput', 'visibility'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GCreateRepositoryInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + visibility, 'GCreateRepositoryInput', 'visibility'); } @override @@ -20937,66 +21290,68 @@ class _$GCreateRepositoryInput extends GCreateRepositoryInput { class GCreateRepositoryInputBuilder implements Builder { - _$GCreateRepositoryInput _$v; + _$GCreateRepositoryInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _description; - String get description => _$this._description; - set description(String description) => _$this._description = description; + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; - bool _hasIssuesEnabled; - bool get hasIssuesEnabled => _$this._hasIssuesEnabled; - set hasIssuesEnabled(bool hasIssuesEnabled) => + bool? _hasIssuesEnabled; + bool? get hasIssuesEnabled => _$this._hasIssuesEnabled; + set hasIssuesEnabled(bool? hasIssuesEnabled) => _$this._hasIssuesEnabled = hasIssuesEnabled; - bool _hasWikiEnabled; - bool get hasWikiEnabled => _$this._hasWikiEnabled; - set hasWikiEnabled(bool hasWikiEnabled) => + bool? _hasWikiEnabled; + bool? get hasWikiEnabled => _$this._hasWikiEnabled; + set hasWikiEnabled(bool? hasWikiEnabled) => _$this._hasWikiEnabled = hasWikiEnabled; - GURIBuilder _homepageUrl; + GURIBuilder? _homepageUrl; GURIBuilder get homepageUrl => _$this._homepageUrl ??= new GURIBuilder(); - set homepageUrl(GURIBuilder homepageUrl) => _$this._homepageUrl = homepageUrl; + set homepageUrl(GURIBuilder? homepageUrl) => + _$this._homepageUrl = homepageUrl; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _ownerId; - String get ownerId => _$this._ownerId; - set ownerId(String ownerId) => _$this._ownerId = ownerId; + String? _ownerId; + String? get ownerId => _$this._ownerId; + set ownerId(String? ownerId) => _$this._ownerId = ownerId; - String _teamId; - String get teamId => _$this._teamId; - set teamId(String teamId) => _$this._teamId = teamId; + String? _teamId; + String? get teamId => _$this._teamId; + set teamId(String? teamId) => _$this._teamId = teamId; - bool _template; - bool get template => _$this._template; - set template(bool template) => _$this._template = template; + bool? _template; + bool? get template => _$this._template; + set template(bool? template) => _$this._template = template; - GRepositoryVisibility _visibility; - GRepositoryVisibility get visibility => _$this._visibility; - set visibility(GRepositoryVisibility visibility) => + GRepositoryVisibility? _visibility; + GRepositoryVisibility? get visibility => _$this._visibility; + set visibility(GRepositoryVisibility? visibility) => _$this._visibility = visibility; GCreateRepositoryInputBuilder(); GCreateRepositoryInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _description = _$v.description; - _hasIssuesEnabled = _$v.hasIssuesEnabled; - _hasWikiEnabled = _$v.hasWikiEnabled; - _homepageUrl = _$v.homepageUrl?.toBuilder(); - _name = _$v.name; - _ownerId = _$v.ownerId; - _teamId = _$v.teamId; - _template = _$v.template; - _visibility = _$v.visibility; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _description = $v.description; + _hasIssuesEnabled = $v.hasIssuesEnabled; + _hasWikiEnabled = $v.hasWikiEnabled; + _homepageUrl = $v.homepageUrl?.toBuilder(); + _name = $v.name; + _ownerId = $v.ownerId; + _teamId = $v.teamId; + _template = $v.template; + _visibility = $v.visibility; _$v = null; } return this; @@ -21004,14 +21359,12 @@ class GCreateRepositoryInputBuilder @override void replace(GCreateRepositoryInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateRepositoryInput; } @override - void update(void Function(GCreateRepositoryInputBuilder) updates) { + void update(void Function(GCreateRepositoryInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21026,13 +21379,15 @@ class GCreateRepositoryInputBuilder hasIssuesEnabled: hasIssuesEnabled, hasWikiEnabled: hasWikiEnabled, homepageUrl: _homepageUrl?.build(), - name: name, + name: BuiltValueNullFieldError.checkNotNull( + name, 'GCreateRepositoryInput', 'name'), ownerId: ownerId, teamId: teamId, template: template, - visibility: visibility); + visibility: BuiltValueNullFieldError.checkNotNull( + visibility, 'GCreateRepositoryInput', 'visibility')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'homepageUrl'; _homepageUrl?.build(); @@ -21052,25 +21407,21 @@ class _$GCreateTeamDiscussionCommentInput @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override final String discussionId; factory _$GCreateTeamDiscussionCommentInput( - [void Function(GCreateTeamDiscussionCommentInputBuilder) updates]) => + [void Function(GCreateTeamDiscussionCommentInputBuilder)? updates]) => (new GCreateTeamDiscussionCommentInputBuilder()..update(updates)).build(); _$GCreateTeamDiscussionCommentInput._( - {this.body, this.clientMutationId, this.discussionId}) + {required this.body, this.clientMutationId, required this.discussionId}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError( - 'GCreateTeamDiscussionCommentInput', 'body'); - } - if (discussionId == null) { - throw new BuiltValueNullFieldError( - 'GCreateTeamDiscussionCommentInput', 'discussionId'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GCreateTeamDiscussionCommentInput', 'body'); + BuiltValueNullFieldError.checkNotNull( + discussionId, 'GCreateTeamDiscussionCommentInput', 'discussionId'); } @override @@ -21111,28 +21462,29 @@ class GCreateTeamDiscussionCommentInputBuilder implements Builder { - _$GCreateTeamDiscussionCommentInput _$v; + _$GCreateTeamDiscussionCommentInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _discussionId; - String get discussionId => _$this._discussionId; - set discussionId(String discussionId) => _$this._discussionId = discussionId; + String? _discussionId; + String? get discussionId => _$this._discussionId; + set discussionId(String? discussionId) => _$this._discussionId = discussionId; GCreateTeamDiscussionCommentInputBuilder(); GCreateTeamDiscussionCommentInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _discussionId = _$v.discussionId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _discussionId = $v.discussionId; _$v = null; } return this; @@ -21140,14 +21492,13 @@ class GCreateTeamDiscussionCommentInputBuilder @override void replace(GCreateTeamDiscussionCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateTeamDiscussionCommentInput; } @override - void update(void Function(GCreateTeamDiscussionCommentInputBuilder) updates) { + void update( + void Function(GCreateTeamDiscussionCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21155,9 +21506,11 @@ class GCreateTeamDiscussionCommentInputBuilder _$GCreateTeamDiscussionCommentInput build() { final _$result = _$v ?? new _$GCreateTeamDiscussionCommentInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GCreateTeamDiscussionCommentInput', 'body'), clientMutationId: clientMutationId, - discussionId: discussionId); + discussionId: BuiltValueNullFieldError.checkNotNull(discussionId, + 'GCreateTeamDiscussionCommentInput', 'discussionId')); replace(_$result); return _$result; } @@ -21167,31 +21520,31 @@ class _$GCreateTeamDiscussionInput extends GCreateTeamDiscussionInput { @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override - final bool private; + final bool? private; @override final String teamId; @override final String title; factory _$GCreateTeamDiscussionInput( - [void Function(GCreateTeamDiscussionInputBuilder) updates]) => + [void Function(GCreateTeamDiscussionInputBuilder)? updates]) => (new GCreateTeamDiscussionInputBuilder()..update(updates)).build(); _$GCreateTeamDiscussionInput._( - {this.body, this.clientMutationId, this.private, this.teamId, this.title}) + {required this.body, + this.clientMutationId, + this.private, + required this.teamId, + required this.title}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError('GCreateTeamDiscussionInput', 'body'); - } - if (teamId == null) { - throw new BuiltValueNullFieldError( - 'GCreateTeamDiscussionInput', 'teamId'); - } - if (title == null) { - throw new BuiltValueNullFieldError('GCreateTeamDiscussionInput', 'title'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GCreateTeamDiscussionInput', 'body'); + BuiltValueNullFieldError.checkNotNull( + teamId, 'GCreateTeamDiscussionInput', 'teamId'); + BuiltValueNullFieldError.checkNotNull( + title, 'GCreateTeamDiscussionInput', 'title'); } @override @@ -21239,38 +21592,39 @@ class _$GCreateTeamDiscussionInput extends GCreateTeamDiscussionInput { class GCreateTeamDiscussionInputBuilder implements Builder { - _$GCreateTeamDiscussionInput _$v; + _$GCreateTeamDiscussionInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - bool _private; - bool get private => _$this._private; - set private(bool private) => _$this._private = private; + bool? _private; + bool? get private => _$this._private; + set private(bool? private) => _$this._private = private; - String _teamId; - String get teamId => _$this._teamId; - set teamId(String teamId) => _$this._teamId = teamId; + String? _teamId; + String? get teamId => _$this._teamId; + set teamId(String? teamId) => _$this._teamId = teamId; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GCreateTeamDiscussionInputBuilder(); GCreateTeamDiscussionInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _private = _$v.private; - _teamId = _$v.teamId; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _private = $v.private; + _teamId = $v.teamId; + _title = $v.title; _$v = null; } return this; @@ -21278,14 +21632,12 @@ class GCreateTeamDiscussionInputBuilder @override void replace(GCreateTeamDiscussionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GCreateTeamDiscussionInput; } @override - void update(void Function(GCreateTeamDiscussionInputBuilder) updates) { + void update(void Function(GCreateTeamDiscussionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21293,11 +21645,14 @@ class GCreateTeamDiscussionInputBuilder _$GCreateTeamDiscussionInput build() { final _$result = _$v ?? new _$GCreateTeamDiscussionInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GCreateTeamDiscussionInput', 'body'), clientMutationId: clientMutationId, private: private, - teamId: teamId, - title: title); + teamId: BuiltValueNullFieldError.checkNotNull( + teamId, 'GCreateTeamDiscussionInput', 'teamId'), + title: BuiltValueNullFieldError.checkNotNull( + title, 'GCreateTeamDiscussionInput', 'title')); replace(_$result); return _$result; } @@ -21307,13 +21662,11 @@ class _$GDate extends GDate { @override final String value; - factory _$GDate([void Function(GDateBuilder) updates]) => + factory _$GDate([void Function(GDateBuilder)? updates]) => (new GDateBuilder()..update(updates)).build(); - _$GDate._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GDate', 'value'); - } + _$GDate._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GDate', 'value'); } @override @@ -21342,17 +21695,18 @@ class _$GDate extends GDate { } class GDateBuilder implements Builder { - _$GDate _$v; + _$GDate? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GDateBuilder(); GDateBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -21360,20 +21714,21 @@ class GDateBuilder implements Builder { @override void replace(GDate other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDate; } @override - void update(void Function(GDateBuilder) updates) { + void update(void Function(GDateBuilder)? updates) { if (updates != null) updates(this); } @override _$GDate build() { - final _$result = _$v ?? new _$GDate._(value: value); + final _$result = _$v ?? + new _$GDate._( + value: + BuiltValueNullFieldError.checkNotNull(value, 'GDate', 'value')); replace(_$result); return _$result; } @@ -21383,13 +21738,11 @@ class _$GDateTime extends GDateTime { @override final String value; - factory _$GDateTime([void Function(GDateTimeBuilder) updates]) => + factory _$GDateTime([void Function(GDateTimeBuilder)? updates]) => (new GDateTimeBuilder()..update(updates)).build(); - _$GDateTime._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GDateTime', 'value'); - } + _$GDateTime._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GDateTime', 'value'); } @override @@ -21418,17 +21771,18 @@ class _$GDateTime extends GDateTime { } class GDateTimeBuilder implements Builder { - _$GDateTime _$v; + _$GDateTime? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GDateTimeBuilder(); GDateTimeBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -21436,20 +21790,21 @@ class GDateTimeBuilder implements Builder { @override void replace(GDateTime other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDateTime; } @override - void update(void Function(GDateTimeBuilder) updates) { + void update(void Function(GDateTimeBuilder)? updates) { if (updates != null) updates(this); } @override _$GDateTime build() { - final _$result = _$v ?? new _$GDateTime._(value: value); + final _$result = _$v ?? + new _$GDateTime._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GDateTime', 'value')); replace(_$result); return _$result; } @@ -21457,7 +21812,7 @@ class GDateTimeBuilder implements Builder { class _$GDeclineTopicSuggestionInput extends GDeclineTopicSuggestionInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String name; @override @@ -21466,24 +21821,21 @@ class _$GDeclineTopicSuggestionInput extends GDeclineTopicSuggestionInput { final String repositoryId; factory _$GDeclineTopicSuggestionInput( - [void Function(GDeclineTopicSuggestionInputBuilder) updates]) => + [void Function(GDeclineTopicSuggestionInputBuilder)? updates]) => (new GDeclineTopicSuggestionInputBuilder()..update(updates)).build(); _$GDeclineTopicSuggestionInput._( - {this.clientMutationId, this.name, this.reason, this.repositoryId}) + {this.clientMutationId, + required this.name, + required this.reason, + required this.repositoryId}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError( - 'GDeclineTopicSuggestionInput', 'name'); - } - if (reason == null) { - throw new BuiltValueNullFieldError( - 'GDeclineTopicSuggestionInput', 'reason'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GDeclineTopicSuggestionInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GDeclineTopicSuggestionInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + reason, 'GDeclineTopicSuggestionInput', 'reason'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GDeclineTopicSuggestionInput', 'repositoryId'); } @override @@ -21528,33 +21880,34 @@ class GDeclineTopicSuggestionInputBuilder implements Builder { - _$GDeclineTopicSuggestionInput _$v; + _$GDeclineTopicSuggestionInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - GTopicSuggestionDeclineReason _reason; - GTopicSuggestionDeclineReason get reason => _$this._reason; - set reason(GTopicSuggestionDeclineReason reason) => _$this._reason = reason; + GTopicSuggestionDeclineReason? _reason; + GTopicSuggestionDeclineReason? get reason => _$this._reason; + set reason(GTopicSuggestionDeclineReason? reason) => _$this._reason = reason; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GDeclineTopicSuggestionInputBuilder(); GDeclineTopicSuggestionInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _reason = _$v.reason; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _reason = $v.reason; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -21562,14 +21915,12 @@ class GDeclineTopicSuggestionInputBuilder @override void replace(GDeclineTopicSuggestionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeclineTopicSuggestionInput; } @override - void update(void Function(GDeclineTopicSuggestionInputBuilder) updates) { + void update(void Function(GDeclineTopicSuggestionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21578,9 +21929,12 @@ class GDeclineTopicSuggestionInputBuilder final _$result = _$v ?? new _$GDeclineTopicSuggestionInput._( clientMutationId: clientMutationId, - name: name, - reason: reason, - repositoryId: repositoryId); + name: BuiltValueNullFieldError.checkNotNull( + name, 'GDeclineTopicSuggestionInput', 'name'), + reason: BuiltValueNullFieldError.checkNotNull( + reason, 'GDeclineTopicSuggestionInput', 'reason'), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GDeclineTopicSuggestionInput', 'repositoryId')); replace(_$result); return _$result; } @@ -21591,19 +21945,17 @@ class _$GDeleteBranchProtectionRuleInput @override final String branchProtectionRuleId; @override - final String clientMutationId; + final String? clientMutationId; factory _$GDeleteBranchProtectionRuleInput( - [void Function(GDeleteBranchProtectionRuleInputBuilder) updates]) => + [void Function(GDeleteBranchProtectionRuleInputBuilder)? updates]) => (new GDeleteBranchProtectionRuleInputBuilder()..update(updates)).build(); _$GDeleteBranchProtectionRuleInput._( - {this.branchProtectionRuleId, this.clientMutationId}) + {required this.branchProtectionRuleId, this.clientMutationId}) : super._() { - if (branchProtectionRuleId == null) { - throw new BuiltValueNullFieldError( - 'GDeleteBranchProtectionRuleInput', 'branchProtectionRuleId'); - } + BuiltValueNullFieldError.checkNotNull(branchProtectionRuleId, + 'GDeleteBranchProtectionRuleInput', 'branchProtectionRuleId'); } @override @@ -21642,24 +21994,25 @@ class GDeleteBranchProtectionRuleInputBuilder implements Builder { - _$GDeleteBranchProtectionRuleInput _$v; + _$GDeleteBranchProtectionRuleInput? _$v; - String _branchProtectionRuleId; - String get branchProtectionRuleId => _$this._branchProtectionRuleId; - set branchProtectionRuleId(String branchProtectionRuleId) => + String? _branchProtectionRuleId; + String? get branchProtectionRuleId => _$this._branchProtectionRuleId; + set branchProtectionRuleId(String? branchProtectionRuleId) => _$this._branchProtectionRuleId = branchProtectionRuleId; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; GDeleteBranchProtectionRuleInputBuilder(); GDeleteBranchProtectionRuleInputBuilder get _$this { - if (_$v != null) { - _branchProtectionRuleId = _$v.branchProtectionRuleId; - _clientMutationId = _$v.clientMutationId; + final $v = _$v; + if ($v != null) { + _branchProtectionRuleId = $v.branchProtectionRuleId; + _clientMutationId = $v.clientMutationId; _$v = null; } return this; @@ -21667,14 +22020,12 @@ class GDeleteBranchProtectionRuleInputBuilder @override void replace(GDeleteBranchProtectionRuleInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteBranchProtectionRuleInput; } @override - void update(void Function(GDeleteBranchProtectionRuleInputBuilder) updates) { + void update(void Function(GDeleteBranchProtectionRuleInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21682,7 +22033,10 @@ class GDeleteBranchProtectionRuleInputBuilder _$GDeleteBranchProtectionRuleInput build() { final _$result = _$v ?? new _$GDeleteBranchProtectionRuleInput._( - branchProtectionRuleId: branchProtectionRuleId, + branchProtectionRuleId: BuiltValueNullFieldError.checkNotNull( + branchProtectionRuleId, + 'GDeleteBranchProtectionRuleInput', + 'branchProtectionRuleId'), clientMutationId: clientMutationId); replace(_$result); return _$result; @@ -21691,18 +22045,17 @@ class GDeleteBranchProtectionRuleInputBuilder class _$GDeleteDeploymentInput extends GDeleteDeploymentInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GDeleteDeploymentInput( - [void Function(GDeleteDeploymentInputBuilder) updates]) => + [void Function(GDeleteDeploymentInputBuilder)? updates]) => (new GDeleteDeploymentInputBuilder()..update(updates)).build(); - _$GDeleteDeploymentInput._({this.clientMutationId, this.id}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('GDeleteDeploymentInput', 'id'); - } + _$GDeleteDeploymentInput._({this.clientMutationId, required this.id}) + : super._() { + BuiltValueNullFieldError.checkNotNull(id, 'GDeleteDeploymentInput', 'id'); } @override @@ -21738,23 +22091,24 @@ class _$GDeleteDeploymentInput extends GDeleteDeploymentInput { class GDeleteDeploymentInputBuilder implements Builder { - _$GDeleteDeploymentInput _$v; + _$GDeleteDeploymentInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GDeleteDeploymentInputBuilder(); GDeleteDeploymentInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -21762,14 +22116,12 @@ class GDeleteDeploymentInputBuilder @override void replace(GDeleteDeploymentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteDeploymentInput; } @override - void update(void Function(GDeleteDeploymentInputBuilder) updates) { + void update(void Function(GDeleteDeploymentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21777,7 +22129,9 @@ class GDeleteDeploymentInputBuilder _$GDeleteDeploymentInput build() { final _$result = _$v ?? new _$GDeleteDeploymentInput._( - clientMutationId: clientMutationId, id: id); + clientMutationId: clientMutationId, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GDeleteDeploymentInput', 'id')); replace(_$result); return _$result; } @@ -21785,18 +22139,17 @@ class GDeleteDeploymentInputBuilder class _$GDeleteIssueCommentInput extends GDeleteIssueCommentInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GDeleteIssueCommentInput( - [void Function(GDeleteIssueCommentInputBuilder) updates]) => + [void Function(GDeleteIssueCommentInputBuilder)? updates]) => (new GDeleteIssueCommentInputBuilder()..update(updates)).build(); - _$GDeleteIssueCommentInput._({this.clientMutationId, this.id}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('GDeleteIssueCommentInput', 'id'); - } + _$GDeleteIssueCommentInput._({this.clientMutationId, required this.id}) + : super._() { + BuiltValueNullFieldError.checkNotNull(id, 'GDeleteIssueCommentInput', 'id'); } @override @@ -21833,23 +22186,24 @@ class _$GDeleteIssueCommentInput extends GDeleteIssueCommentInput { class GDeleteIssueCommentInputBuilder implements Builder { - _$GDeleteIssueCommentInput _$v; + _$GDeleteIssueCommentInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GDeleteIssueCommentInputBuilder(); GDeleteIssueCommentInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -21857,14 +22211,12 @@ class GDeleteIssueCommentInputBuilder @override void replace(GDeleteIssueCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteIssueCommentInput; } @override - void update(void Function(GDeleteIssueCommentInputBuilder) updates) { + void update(void Function(GDeleteIssueCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21872,7 +22224,9 @@ class GDeleteIssueCommentInputBuilder _$GDeleteIssueCommentInput build() { final _$result = _$v ?? new _$GDeleteIssueCommentInput._( - clientMutationId: clientMutationId, id: id); + clientMutationId: clientMutationId, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GDeleteIssueCommentInput', 'id')); replace(_$result); return _$result; } @@ -21880,18 +22234,18 @@ class GDeleteIssueCommentInputBuilder class _$GDeleteIssueInput extends GDeleteIssueInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String issueId; factory _$GDeleteIssueInput( - [void Function(GDeleteIssueInputBuilder) updates]) => + [void Function(GDeleteIssueInputBuilder)? updates]) => (new GDeleteIssueInputBuilder()..update(updates)).build(); - _$GDeleteIssueInput._({this.clientMutationId, this.issueId}) : super._() { - if (issueId == null) { - throw new BuiltValueNullFieldError('GDeleteIssueInput', 'issueId'); - } + _$GDeleteIssueInput._({this.clientMutationId, required this.issueId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + issueId, 'GDeleteIssueInput', 'issueId'); } @override @@ -21926,23 +22280,24 @@ class _$GDeleteIssueInput extends GDeleteIssueInput { class GDeleteIssueInputBuilder implements Builder { - _$GDeleteIssueInput _$v; + _$GDeleteIssueInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _issueId; - String get issueId => _$this._issueId; - set issueId(String issueId) => _$this._issueId = issueId; + String? _issueId; + String? get issueId => _$this._issueId; + set issueId(String? issueId) => _$this._issueId = issueId; GDeleteIssueInputBuilder(); GDeleteIssueInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _issueId = _$v.issueId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _issueId = $v.issueId; _$v = null; } return this; @@ -21950,14 +22305,12 @@ class GDeleteIssueInputBuilder @override void replace(GDeleteIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteIssueInput; } @override - void update(void Function(GDeleteIssueInputBuilder) updates) { + void update(void Function(GDeleteIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -21965,7 +22318,9 @@ class GDeleteIssueInputBuilder _$GDeleteIssueInput build() { final _$result = _$v ?? new _$GDeleteIssueInput._( - clientMutationId: clientMutationId, issueId: issueId); + clientMutationId: clientMutationId, + issueId: BuiltValueNullFieldError.checkNotNull( + issueId, 'GDeleteIssueInput', 'issueId')); replace(_$result); return _$result; } @@ -21975,17 +22330,16 @@ class _$GDeleteProjectCardInput extends GDeleteProjectCardInput { @override final String cardId; @override - final String clientMutationId; + final String? clientMutationId; factory _$GDeleteProjectCardInput( - [void Function(GDeleteProjectCardInputBuilder) updates]) => + [void Function(GDeleteProjectCardInputBuilder)? updates]) => (new GDeleteProjectCardInputBuilder()..update(updates)).build(); - _$GDeleteProjectCardInput._({this.cardId, this.clientMutationId}) + _$GDeleteProjectCardInput._({required this.cardId, this.clientMutationId}) : super._() { - if (cardId == null) { - throw new BuiltValueNullFieldError('GDeleteProjectCardInput', 'cardId'); - } + BuiltValueNullFieldError.checkNotNull( + cardId, 'GDeleteProjectCardInput', 'cardId'); } @override @@ -22022,23 +22376,24 @@ class _$GDeleteProjectCardInput extends GDeleteProjectCardInput { class GDeleteProjectCardInputBuilder implements Builder { - _$GDeleteProjectCardInput _$v; + _$GDeleteProjectCardInput? _$v; - String _cardId; - String get cardId => _$this._cardId; - set cardId(String cardId) => _$this._cardId = cardId; + String? _cardId; + String? get cardId => _$this._cardId; + set cardId(String? cardId) => _$this._cardId = cardId; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; GDeleteProjectCardInputBuilder(); GDeleteProjectCardInputBuilder get _$this { - if (_$v != null) { - _cardId = _$v.cardId; - _clientMutationId = _$v.clientMutationId; + final $v = _$v; + if ($v != null) { + _cardId = $v.cardId; + _clientMutationId = $v.clientMutationId; _$v = null; } return this; @@ -22046,14 +22401,12 @@ class GDeleteProjectCardInputBuilder @override void replace(GDeleteProjectCardInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteProjectCardInput; } @override - void update(void Function(GDeleteProjectCardInputBuilder) updates) { + void update(void Function(GDeleteProjectCardInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22061,7 +22414,9 @@ class GDeleteProjectCardInputBuilder _$GDeleteProjectCardInput build() { final _$result = _$v ?? new _$GDeleteProjectCardInput._( - cardId: cardId, clientMutationId: clientMutationId); + cardId: BuiltValueNullFieldError.checkNotNull( + cardId, 'GDeleteProjectCardInput', 'cardId'), + clientMutationId: clientMutationId); replace(_$result); return _$result; } @@ -22069,20 +22424,18 @@ class GDeleteProjectCardInputBuilder class _$GDeleteProjectColumnInput extends GDeleteProjectColumnInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String columnId; factory _$GDeleteProjectColumnInput( - [void Function(GDeleteProjectColumnInputBuilder) updates]) => + [void Function(GDeleteProjectColumnInputBuilder)? updates]) => (new GDeleteProjectColumnInputBuilder()..update(updates)).build(); - _$GDeleteProjectColumnInput._({this.clientMutationId, this.columnId}) + _$GDeleteProjectColumnInput._({this.clientMutationId, required this.columnId}) : super._() { - if (columnId == null) { - throw new BuiltValueNullFieldError( - 'GDeleteProjectColumnInput', 'columnId'); - } + BuiltValueNullFieldError.checkNotNull( + columnId, 'GDeleteProjectColumnInput', 'columnId'); } @override @@ -22119,23 +22472,24 @@ class _$GDeleteProjectColumnInput extends GDeleteProjectColumnInput { class GDeleteProjectColumnInputBuilder implements Builder { - _$GDeleteProjectColumnInput _$v; + _$GDeleteProjectColumnInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _columnId; - String get columnId => _$this._columnId; - set columnId(String columnId) => _$this._columnId = columnId; + String? _columnId; + String? get columnId => _$this._columnId; + set columnId(String? columnId) => _$this._columnId = columnId; GDeleteProjectColumnInputBuilder(); GDeleteProjectColumnInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _columnId = _$v.columnId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _columnId = $v.columnId; _$v = null; } return this; @@ -22143,14 +22497,12 @@ class GDeleteProjectColumnInputBuilder @override void replace(GDeleteProjectColumnInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteProjectColumnInput; } @override - void update(void Function(GDeleteProjectColumnInputBuilder) updates) { + void update(void Function(GDeleteProjectColumnInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22158,7 +22510,9 @@ class GDeleteProjectColumnInputBuilder _$GDeleteProjectColumnInput build() { final _$result = _$v ?? new _$GDeleteProjectColumnInput._( - clientMutationId: clientMutationId, columnId: columnId); + clientMutationId: clientMutationId, + columnId: BuiltValueNullFieldError.checkNotNull( + columnId, 'GDeleteProjectColumnInput', 'columnId')); replace(_$result); return _$result; } @@ -22166,18 +22520,18 @@ class GDeleteProjectColumnInputBuilder class _$GDeleteProjectInput extends GDeleteProjectInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String projectId; factory _$GDeleteProjectInput( - [void Function(GDeleteProjectInputBuilder) updates]) => + [void Function(GDeleteProjectInputBuilder)? updates]) => (new GDeleteProjectInputBuilder()..update(updates)).build(); - _$GDeleteProjectInput._({this.clientMutationId, this.projectId}) : super._() { - if (projectId == null) { - throw new BuiltValueNullFieldError('GDeleteProjectInput', 'projectId'); - } + _$GDeleteProjectInput._({this.clientMutationId, required this.projectId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + projectId, 'GDeleteProjectInput', 'projectId'); } @override @@ -22213,23 +22567,24 @@ class _$GDeleteProjectInput extends GDeleteProjectInput { class GDeleteProjectInputBuilder implements Builder { - _$GDeleteProjectInput _$v; + _$GDeleteProjectInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _projectId; - String get projectId => _$this._projectId; - set projectId(String projectId) => _$this._projectId = projectId; + String? _projectId; + String? get projectId => _$this._projectId; + set projectId(String? projectId) => _$this._projectId = projectId; GDeleteProjectInputBuilder(); GDeleteProjectInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _projectId = _$v.projectId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _projectId = $v.projectId; _$v = null; } return this; @@ -22237,14 +22592,12 @@ class GDeleteProjectInputBuilder @override void replace(GDeleteProjectInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteProjectInput; } @override - void update(void Function(GDeleteProjectInputBuilder) updates) { + void update(void Function(GDeleteProjectInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22252,7 +22605,9 @@ class GDeleteProjectInputBuilder _$GDeleteProjectInput build() { final _$result = _$v ?? new _$GDeleteProjectInput._( - clientMutationId: clientMutationId, projectId: projectId); + clientMutationId: clientMutationId, + projectId: BuiltValueNullFieldError.checkNotNull( + projectId, 'GDeleteProjectInput', 'projectId')); replace(_$result); return _$result; } @@ -22261,22 +22616,21 @@ class GDeleteProjectInputBuilder class _$GDeletePullRequestReviewCommentInput extends GDeletePullRequestReviewCommentInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GDeletePullRequestReviewCommentInput( - [void Function(GDeletePullRequestReviewCommentInputBuilder) + [void Function(GDeletePullRequestReviewCommentInputBuilder)? updates]) => (new GDeletePullRequestReviewCommentInputBuilder()..update(updates)) .build(); - _$GDeletePullRequestReviewCommentInput._({this.clientMutationId, this.id}) + _$GDeletePullRequestReviewCommentInput._( + {this.clientMutationId, required this.id}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError( - 'GDeletePullRequestReviewCommentInput', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + id, 'GDeletePullRequestReviewCommentInput', 'id'); } @override @@ -22314,23 +22668,24 @@ class GDeletePullRequestReviewCommentInputBuilder implements Builder { - _$GDeletePullRequestReviewCommentInput _$v; + _$GDeletePullRequestReviewCommentInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GDeletePullRequestReviewCommentInputBuilder(); GDeletePullRequestReviewCommentInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -22338,15 +22693,13 @@ class GDeletePullRequestReviewCommentInputBuilder @override void replace(GDeletePullRequestReviewCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeletePullRequestReviewCommentInput; } @override void update( - void Function(GDeletePullRequestReviewCommentInputBuilder) updates) { + void Function(GDeletePullRequestReviewCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22354,7 +22707,9 @@ class GDeletePullRequestReviewCommentInputBuilder _$GDeletePullRequestReviewCommentInput build() { final _$result = _$v ?? new _$GDeletePullRequestReviewCommentInput._( - clientMutationId: clientMutationId, id: id); + clientMutationId: clientMutationId, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GDeletePullRequestReviewCommentInput', 'id')); replace(_$result); return _$result; } @@ -22362,21 +22717,19 @@ class GDeletePullRequestReviewCommentInputBuilder class _$GDeletePullRequestReviewInput extends GDeletePullRequestReviewInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String pullRequestReviewId; factory _$GDeletePullRequestReviewInput( - [void Function(GDeletePullRequestReviewInputBuilder) updates]) => + [void Function(GDeletePullRequestReviewInputBuilder)? updates]) => (new GDeletePullRequestReviewInputBuilder()..update(updates)).build(); _$GDeletePullRequestReviewInput._( - {this.clientMutationId, this.pullRequestReviewId}) + {this.clientMutationId, required this.pullRequestReviewId}) : super._() { - if (pullRequestReviewId == null) { - throw new BuiltValueNullFieldError( - 'GDeletePullRequestReviewInput', 'pullRequestReviewId'); - } + BuiltValueNullFieldError.checkNotNull(pullRequestReviewId, + 'GDeletePullRequestReviewInput', 'pullRequestReviewId'); } @override @@ -22415,24 +22768,25 @@ class GDeletePullRequestReviewInputBuilder implements Builder { - _$GDeletePullRequestReviewInput _$v; + _$GDeletePullRequestReviewInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _pullRequestReviewId; - String get pullRequestReviewId => _$this._pullRequestReviewId; - set pullRequestReviewId(String pullRequestReviewId) => + String? _pullRequestReviewId; + String? get pullRequestReviewId => _$this._pullRequestReviewId; + set pullRequestReviewId(String? pullRequestReviewId) => _$this._pullRequestReviewId = pullRequestReviewId; GDeletePullRequestReviewInputBuilder(); GDeletePullRequestReviewInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _pullRequestReviewId = _$v.pullRequestReviewId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _pullRequestReviewId = $v.pullRequestReviewId; _$v = null; } return this; @@ -22440,14 +22794,12 @@ class GDeletePullRequestReviewInputBuilder @override void replace(GDeletePullRequestReviewInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeletePullRequestReviewInput; } @override - void update(void Function(GDeletePullRequestReviewInputBuilder) updates) { + void update(void Function(GDeletePullRequestReviewInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22456,7 +22808,10 @@ class GDeletePullRequestReviewInputBuilder final _$result = _$v ?? new _$GDeletePullRequestReviewInput._( clientMutationId: clientMutationId, - pullRequestReviewId: pullRequestReviewId); + pullRequestReviewId: BuiltValueNullFieldError.checkNotNull( + pullRequestReviewId, + 'GDeletePullRequestReviewInput', + 'pullRequestReviewId')); replace(_$result); return _$result; } @@ -22464,17 +22819,16 @@ class GDeletePullRequestReviewInputBuilder class _$GDeleteRefInput extends GDeleteRefInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String refId; - factory _$GDeleteRefInput([void Function(GDeleteRefInputBuilder) updates]) => + factory _$GDeleteRefInput([void Function(GDeleteRefInputBuilder)? updates]) => (new GDeleteRefInputBuilder()..update(updates)).build(); - _$GDeleteRefInput._({this.clientMutationId, this.refId}) : super._() { - if (refId == null) { - throw new BuiltValueNullFieldError('GDeleteRefInput', 'refId'); - } + _$GDeleteRefInput._({this.clientMutationId, required this.refId}) + : super._() { + BuiltValueNullFieldError.checkNotNull(refId, 'GDeleteRefInput', 'refId'); } @override @@ -22509,23 +22863,24 @@ class _$GDeleteRefInput extends GDeleteRefInput { class GDeleteRefInputBuilder implements Builder { - _$GDeleteRefInput _$v; + _$GDeleteRefInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _refId; - String get refId => _$this._refId; - set refId(String refId) => _$this._refId = refId; + String? _refId; + String? get refId => _$this._refId; + set refId(String? refId) => _$this._refId = refId; GDeleteRefInputBuilder(); GDeleteRefInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _refId = _$v.refId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _refId = $v.refId; _$v = null; } return this; @@ -22533,14 +22888,12 @@ class GDeleteRefInputBuilder @override void replace(GDeleteRefInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteRefInput; } @override - void update(void Function(GDeleteRefInputBuilder) updates) { + void update(void Function(GDeleteRefInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22548,7 +22901,9 @@ class GDeleteRefInputBuilder _$GDeleteRefInput build() { final _$result = _$v ?? new _$GDeleteRefInput._( - clientMutationId: clientMutationId, refId: refId); + clientMutationId: clientMutationId, + refId: BuiltValueNullFieldError.checkNotNull( + refId, 'GDeleteRefInput', 'refId')); replace(_$result); return _$result; } @@ -22557,20 +22912,19 @@ class GDeleteRefInputBuilder class _$GDeleteTeamDiscussionCommentInput extends GDeleteTeamDiscussionCommentInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GDeleteTeamDiscussionCommentInput( - [void Function(GDeleteTeamDiscussionCommentInputBuilder) updates]) => + [void Function(GDeleteTeamDiscussionCommentInputBuilder)? updates]) => (new GDeleteTeamDiscussionCommentInputBuilder()..update(updates)).build(); - _$GDeleteTeamDiscussionCommentInput._({this.clientMutationId, this.id}) + _$GDeleteTeamDiscussionCommentInput._( + {this.clientMutationId, required this.id}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError( - 'GDeleteTeamDiscussionCommentInput', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + id, 'GDeleteTeamDiscussionCommentInput', 'id'); } @override @@ -22608,23 +22962,24 @@ class GDeleteTeamDiscussionCommentInputBuilder implements Builder { - _$GDeleteTeamDiscussionCommentInput _$v; + _$GDeleteTeamDiscussionCommentInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GDeleteTeamDiscussionCommentInputBuilder(); GDeleteTeamDiscussionCommentInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -22632,14 +22987,13 @@ class GDeleteTeamDiscussionCommentInputBuilder @override void replace(GDeleteTeamDiscussionCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteTeamDiscussionCommentInput; } @override - void update(void Function(GDeleteTeamDiscussionCommentInputBuilder) updates) { + void update( + void Function(GDeleteTeamDiscussionCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22647,7 +23001,9 @@ class GDeleteTeamDiscussionCommentInputBuilder _$GDeleteTeamDiscussionCommentInput build() { final _$result = _$v ?? new _$GDeleteTeamDiscussionCommentInput._( - clientMutationId: clientMutationId, id: id); + clientMutationId: clientMutationId, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GDeleteTeamDiscussionCommentInput', 'id')); replace(_$result); return _$result; } @@ -22655,18 +23011,18 @@ class GDeleteTeamDiscussionCommentInputBuilder class _$GDeleteTeamDiscussionInput extends GDeleteTeamDiscussionInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GDeleteTeamDiscussionInput( - [void Function(GDeleteTeamDiscussionInputBuilder) updates]) => + [void Function(GDeleteTeamDiscussionInputBuilder)? updates]) => (new GDeleteTeamDiscussionInputBuilder()..update(updates)).build(); - _$GDeleteTeamDiscussionInput._({this.clientMutationId, this.id}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('GDeleteTeamDiscussionInput', 'id'); - } + _$GDeleteTeamDiscussionInput._({this.clientMutationId, required this.id}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + id, 'GDeleteTeamDiscussionInput', 'id'); } @override @@ -22703,23 +23059,24 @@ class _$GDeleteTeamDiscussionInput extends GDeleteTeamDiscussionInput { class GDeleteTeamDiscussionInputBuilder implements Builder { - _$GDeleteTeamDiscussionInput _$v; + _$GDeleteTeamDiscussionInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GDeleteTeamDiscussionInputBuilder(); GDeleteTeamDiscussionInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -22727,14 +23084,12 @@ class GDeleteTeamDiscussionInputBuilder @override void replace(GDeleteTeamDiscussionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeleteTeamDiscussionInput; } @override - void update(void Function(GDeleteTeamDiscussionInputBuilder) updates) { + void update(void Function(GDeleteTeamDiscussionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22742,7 +23097,9 @@ class GDeleteTeamDiscussionInputBuilder _$GDeleteTeamDiscussionInput build() { final _$result = _$v ?? new _$GDeleteTeamDiscussionInput._( - clientMutationId: clientMutationId, id: id); + clientMutationId: clientMutationId, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GDeleteTeamDiscussionInput', 'id')); replace(_$result); return _$result; } @@ -22755,16 +23112,14 @@ class _$GDeploymentOrder extends GDeploymentOrder { final GDeploymentOrderField field; factory _$GDeploymentOrder( - [void Function(GDeploymentOrderBuilder) updates]) => + [void Function(GDeploymentOrderBuilder)? updates]) => (new GDeploymentOrderBuilder()..update(updates)).build(); - _$GDeploymentOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GDeploymentOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GDeploymentOrder', 'field'); - } + _$GDeploymentOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GDeploymentOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GDeploymentOrder', 'field'); } @override @@ -22799,22 +23154,23 @@ class _$GDeploymentOrder extends GDeploymentOrder { class GDeploymentOrderBuilder implements Builder { - _$GDeploymentOrder _$v; + _$GDeploymentOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GDeploymentOrderField _field; - GDeploymentOrderField get field => _$this._field; - set field(GDeploymentOrderField field) => _$this._field = field; + GDeploymentOrderField? _field; + GDeploymentOrderField? get field => _$this._field; + set field(GDeploymentOrderField? field) => _$this._field = field; GDeploymentOrderBuilder(); GDeploymentOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -22822,21 +23178,23 @@ class GDeploymentOrderBuilder @override void replace(GDeploymentOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDeploymentOrder; } @override - void update(void Function(GDeploymentOrderBuilder) updates) { + void update(void Function(GDeploymentOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GDeploymentOrder build() { - final _$result = - _$v ?? new _$GDeploymentOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GDeploymentOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GDeploymentOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GDeploymentOrder', 'field')); replace(_$result); return _$result; } @@ -22844,27 +23202,25 @@ class GDeploymentOrderBuilder class _$GDismissPullRequestReviewInput extends GDismissPullRequestReviewInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String message; @override final String pullRequestReviewId; factory _$GDismissPullRequestReviewInput( - [void Function(GDismissPullRequestReviewInputBuilder) updates]) => + [void Function(GDismissPullRequestReviewInputBuilder)? updates]) => (new GDismissPullRequestReviewInputBuilder()..update(updates)).build(); _$GDismissPullRequestReviewInput._( - {this.clientMutationId, this.message, this.pullRequestReviewId}) + {this.clientMutationId, + required this.message, + required this.pullRequestReviewId}) : super._() { - if (message == null) { - throw new BuiltValueNullFieldError( - 'GDismissPullRequestReviewInput', 'message'); - } - if (pullRequestReviewId == null) { - throw new BuiltValueNullFieldError( - 'GDismissPullRequestReviewInput', 'pullRequestReviewId'); - } + BuiltValueNullFieldError.checkNotNull( + message, 'GDismissPullRequestReviewInput', 'message'); + BuiltValueNullFieldError.checkNotNull(pullRequestReviewId, + 'GDismissPullRequestReviewInput', 'pullRequestReviewId'); } @override @@ -22905,29 +23261,30 @@ class GDismissPullRequestReviewInputBuilder implements Builder { - _$GDismissPullRequestReviewInput _$v; + _$GDismissPullRequestReviewInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _message; - String get message => _$this._message; - set message(String message) => _$this._message = message; + String? _message; + String? get message => _$this._message; + set message(String? message) => _$this._message = message; - String _pullRequestReviewId; - String get pullRequestReviewId => _$this._pullRequestReviewId; - set pullRequestReviewId(String pullRequestReviewId) => + String? _pullRequestReviewId; + String? get pullRequestReviewId => _$this._pullRequestReviewId; + set pullRequestReviewId(String? pullRequestReviewId) => _$this._pullRequestReviewId = pullRequestReviewId; GDismissPullRequestReviewInputBuilder(); GDismissPullRequestReviewInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _message = _$v.message; - _pullRequestReviewId = _$v.pullRequestReviewId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _message = $v.message; + _pullRequestReviewId = $v.pullRequestReviewId; _$v = null; } return this; @@ -22935,14 +23292,12 @@ class GDismissPullRequestReviewInputBuilder @override void replace(GDismissPullRequestReviewInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDismissPullRequestReviewInput; } @override - void update(void Function(GDismissPullRequestReviewInputBuilder) updates) { + void update(void Function(GDismissPullRequestReviewInputBuilder)? updates) { if (updates != null) updates(this); } @@ -22951,8 +23306,12 @@ class GDismissPullRequestReviewInputBuilder final _$result = _$v ?? new _$GDismissPullRequestReviewInput._( clientMutationId: clientMutationId, - message: message, - pullRequestReviewId: pullRequestReviewId); + message: BuiltValueNullFieldError.checkNotNull( + message, 'GDismissPullRequestReviewInput', 'message'), + pullRequestReviewId: BuiltValueNullFieldError.checkNotNull( + pullRequestReviewId, + 'GDismissPullRequestReviewInput', + 'pullRequestReviewId')); replace(_$result); return _$result; } @@ -22967,23 +23326,18 @@ class _$GDraftPullRequestReviewComment extends GDraftPullRequestReviewComment { final int position; factory _$GDraftPullRequestReviewComment( - [void Function(GDraftPullRequestReviewCommentBuilder) updates]) => + [void Function(GDraftPullRequestReviewCommentBuilder)? updates]) => (new GDraftPullRequestReviewCommentBuilder()..update(updates)).build(); - _$GDraftPullRequestReviewComment._({this.body, this.path, this.position}) + _$GDraftPullRequestReviewComment._( + {required this.body, required this.path, required this.position}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError( - 'GDraftPullRequestReviewComment', 'body'); - } - if (path == null) { - throw new BuiltValueNullFieldError( - 'GDraftPullRequestReviewComment', 'path'); - } - if (position == null) { - throw new BuiltValueNullFieldError( - 'GDraftPullRequestReviewComment', 'position'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GDraftPullRequestReviewComment', 'body'); + BuiltValueNullFieldError.checkNotNull( + path, 'GDraftPullRequestReviewComment', 'path'); + BuiltValueNullFieldError.checkNotNull( + position, 'GDraftPullRequestReviewComment', 'position'); } @override @@ -23024,27 +23378,28 @@ class GDraftPullRequestReviewCommentBuilder implements Builder { - _$GDraftPullRequestReviewComment _$v; + _$GDraftPullRequestReviewComment? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _path; - String get path => _$this._path; - set path(String path) => _$this._path = path; + String? _path; + String? get path => _$this._path; + set path(String? path) => _$this._path = path; - int _position; - int get position => _$this._position; - set position(int position) => _$this._position = position; + int? _position; + int? get position => _$this._position; + set position(int? position) => _$this._position = position; GDraftPullRequestReviewCommentBuilder(); GDraftPullRequestReviewCommentBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _path = _$v.path; - _position = _$v.position; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _path = $v.path; + _position = $v.position; _$v = null; } return this; @@ -23052,14 +23407,12 @@ class GDraftPullRequestReviewCommentBuilder @override void replace(GDraftPullRequestReviewComment other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GDraftPullRequestReviewComment; } @override - void update(void Function(GDraftPullRequestReviewCommentBuilder) updates) { + void update(void Function(GDraftPullRequestReviewCommentBuilder)? updates) { if (updates != null) updates(this); } @@ -23067,7 +23420,12 @@ class GDraftPullRequestReviewCommentBuilder _$GDraftPullRequestReviewComment build() { final _$result = _$v ?? new _$GDraftPullRequestReviewComment._( - body: body, path: path, position: position); + body: BuiltValueNullFieldError.checkNotNull( + body, 'GDraftPullRequestReviewComment', 'body'), + path: BuiltValueNullFieldError.checkNotNull( + path, 'GDraftPullRequestReviewComment', 'path'), + position: BuiltValueNullFieldError.checkNotNull( + position, 'GDraftPullRequestReviewComment', 'position')); replace(_$result); return _$result; } @@ -23081,21 +23439,18 @@ class _$GEnterpriseAdministratorInvitationOrder final GEnterpriseAdministratorInvitationOrderField field; factory _$GEnterpriseAdministratorInvitationOrder( - [void Function(GEnterpriseAdministratorInvitationOrderBuilder) + [void Function(GEnterpriseAdministratorInvitationOrderBuilder)? updates]) => (new GEnterpriseAdministratorInvitationOrderBuilder()..update(updates)) .build(); - _$GEnterpriseAdministratorInvitationOrder._({this.direction, this.field}) + _$GEnterpriseAdministratorInvitationOrder._( + {required this.direction, required this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseAdministratorInvitationOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseAdministratorInvitationOrder', 'field'); - } + BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseAdministratorInvitationOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseAdministratorInvitationOrder', 'field'); } @override @@ -23135,23 +23490,24 @@ class GEnterpriseAdministratorInvitationOrderBuilder implements Builder { - _$GEnterpriseAdministratorInvitationOrder _$v; + _$GEnterpriseAdministratorInvitationOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GEnterpriseAdministratorInvitationOrderField _field; - GEnterpriseAdministratorInvitationOrderField get field => _$this._field; - set field(GEnterpriseAdministratorInvitationOrderField field) => + GEnterpriseAdministratorInvitationOrderField? _field; + GEnterpriseAdministratorInvitationOrderField? get field => _$this._field; + set field(GEnterpriseAdministratorInvitationOrderField? field) => _$this._field = field; GEnterpriseAdministratorInvitationOrderBuilder(); GEnterpriseAdministratorInvitationOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23159,15 +23515,13 @@ class GEnterpriseAdministratorInvitationOrderBuilder @override void replace(GEnterpriseAdministratorInvitationOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GEnterpriseAdministratorInvitationOrder; } @override void update( - void Function(GEnterpriseAdministratorInvitationOrderBuilder) updates) { + void Function(GEnterpriseAdministratorInvitationOrderBuilder)? updates) { if (updates != null) updates(this); } @@ -23175,7 +23529,10 @@ class GEnterpriseAdministratorInvitationOrderBuilder _$GEnterpriseAdministratorInvitationOrder build() { final _$result = _$v ?? new _$GEnterpriseAdministratorInvitationOrder._( - direction: direction, field: field); + direction: BuiltValueNullFieldError.checkNotNull(direction, + 'GEnterpriseAdministratorInvitationOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseAdministratorInvitationOrder', 'field')); replace(_$result); return _$result; } @@ -23188,16 +23545,15 @@ class _$GEnterpriseMemberOrder extends GEnterpriseMemberOrder { final GEnterpriseMemberOrderField field; factory _$GEnterpriseMemberOrder( - [void Function(GEnterpriseMemberOrderBuilder) updates]) => + [void Function(GEnterpriseMemberOrderBuilder)? updates]) => (new GEnterpriseMemberOrderBuilder()..update(updates)).build(); - _$GEnterpriseMemberOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GEnterpriseMemberOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GEnterpriseMemberOrder', 'field'); - } + _$GEnterpriseMemberOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseMemberOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseMemberOrder', 'field'); } @override @@ -23233,22 +23589,23 @@ class _$GEnterpriseMemberOrder extends GEnterpriseMemberOrder { class GEnterpriseMemberOrderBuilder implements Builder { - _$GEnterpriseMemberOrder _$v; + _$GEnterpriseMemberOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GEnterpriseMemberOrderField _field; - GEnterpriseMemberOrderField get field => _$this._field; - set field(GEnterpriseMemberOrderField field) => _$this._field = field; + GEnterpriseMemberOrderField? _field; + GEnterpriseMemberOrderField? get field => _$this._field; + set field(GEnterpriseMemberOrderField? field) => _$this._field = field; GEnterpriseMemberOrderBuilder(); GEnterpriseMemberOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23256,21 +23613,23 @@ class GEnterpriseMemberOrderBuilder @override void replace(GEnterpriseMemberOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GEnterpriseMemberOrder; } @override - void update(void Function(GEnterpriseMemberOrderBuilder) updates) { + void update(void Function(GEnterpriseMemberOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GEnterpriseMemberOrder build() { final _$result = _$v ?? - new _$GEnterpriseMemberOrder._(direction: direction, field: field); + new _$GEnterpriseMemberOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseMemberOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseMemberOrder', 'field')); replace(_$result); return _$result; } @@ -23284,20 +23643,18 @@ class _$GEnterpriseServerInstallationOrder final GEnterpriseServerInstallationOrderField field; factory _$GEnterpriseServerInstallationOrder( - [void Function(GEnterpriseServerInstallationOrderBuilder) updates]) => + [void Function(GEnterpriseServerInstallationOrderBuilder)? + updates]) => (new GEnterpriseServerInstallationOrderBuilder()..update(updates)) .build(); - _$GEnterpriseServerInstallationOrder._({this.direction, this.field}) + _$GEnterpriseServerInstallationOrder._( + {required this.direction, required this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerInstallationOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerInstallationOrder', 'field'); - } + BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseServerInstallationOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerInstallationOrder', 'field'); } @override @@ -23335,23 +23692,24 @@ class GEnterpriseServerInstallationOrderBuilder implements Builder { - _$GEnterpriseServerInstallationOrder _$v; + _$GEnterpriseServerInstallationOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GEnterpriseServerInstallationOrderField _field; - GEnterpriseServerInstallationOrderField get field => _$this._field; - set field(GEnterpriseServerInstallationOrderField field) => + GEnterpriseServerInstallationOrderField? _field; + GEnterpriseServerInstallationOrderField? get field => _$this._field; + set field(GEnterpriseServerInstallationOrderField? field) => _$this._field = field; GEnterpriseServerInstallationOrderBuilder(); GEnterpriseServerInstallationOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23359,15 +23717,13 @@ class GEnterpriseServerInstallationOrderBuilder @override void replace(GEnterpriseServerInstallationOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GEnterpriseServerInstallationOrder; } @override void update( - void Function(GEnterpriseServerInstallationOrderBuilder) updates) { + void Function(GEnterpriseServerInstallationOrderBuilder)? updates) { if (updates != null) updates(this); } @@ -23375,7 +23731,10 @@ class GEnterpriseServerInstallationOrderBuilder _$GEnterpriseServerInstallationOrder build() { final _$result = _$v ?? new _$GEnterpriseServerInstallationOrder._( - direction: direction, field: field); + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseServerInstallationOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerInstallationOrder', 'field')); replace(_$result); return _$result; } @@ -23389,21 +23748,18 @@ class _$GEnterpriseServerUserAccountEmailOrder final GEnterpriseServerUserAccountEmailOrderField field; factory _$GEnterpriseServerUserAccountEmailOrder( - [void Function(GEnterpriseServerUserAccountEmailOrderBuilder) + [void Function(GEnterpriseServerUserAccountEmailOrderBuilder)? updates]) => (new GEnterpriseServerUserAccountEmailOrderBuilder()..update(updates)) .build(); - _$GEnterpriseServerUserAccountEmailOrder._({this.direction, this.field}) + _$GEnterpriseServerUserAccountEmailOrder._( + {required this.direction, required this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerUserAccountEmailOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerUserAccountEmailOrder', 'field'); - } + BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseServerUserAccountEmailOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerUserAccountEmailOrder', 'field'); } @override @@ -23443,23 +23799,24 @@ class GEnterpriseServerUserAccountEmailOrderBuilder implements Builder { - _$GEnterpriseServerUserAccountEmailOrder _$v; + _$GEnterpriseServerUserAccountEmailOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GEnterpriseServerUserAccountEmailOrderField _field; - GEnterpriseServerUserAccountEmailOrderField get field => _$this._field; - set field(GEnterpriseServerUserAccountEmailOrderField field) => + GEnterpriseServerUserAccountEmailOrderField? _field; + GEnterpriseServerUserAccountEmailOrderField? get field => _$this._field; + set field(GEnterpriseServerUserAccountEmailOrderField? field) => _$this._field = field; GEnterpriseServerUserAccountEmailOrderBuilder(); GEnterpriseServerUserAccountEmailOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23467,15 +23824,13 @@ class GEnterpriseServerUserAccountEmailOrderBuilder @override void replace(GEnterpriseServerUserAccountEmailOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GEnterpriseServerUserAccountEmailOrder; } @override void update( - void Function(GEnterpriseServerUserAccountEmailOrderBuilder) updates) { + void Function(GEnterpriseServerUserAccountEmailOrderBuilder)? updates) { if (updates != null) updates(this); } @@ -23483,7 +23838,10 @@ class GEnterpriseServerUserAccountEmailOrderBuilder _$GEnterpriseServerUserAccountEmailOrder build() { final _$result = _$v ?? new _$GEnterpriseServerUserAccountEmailOrder._( - direction: direction, field: field); + direction: BuiltValueNullFieldError.checkNotNull(direction, + 'GEnterpriseServerUserAccountEmailOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerUserAccountEmailOrder', 'field')); replace(_$result); return _$result; } @@ -23497,19 +23855,16 @@ class _$GEnterpriseServerUserAccountOrder final GEnterpriseServerUserAccountOrderField field; factory _$GEnterpriseServerUserAccountOrder( - [void Function(GEnterpriseServerUserAccountOrderBuilder) updates]) => + [void Function(GEnterpriseServerUserAccountOrderBuilder)? updates]) => (new GEnterpriseServerUserAccountOrderBuilder()..update(updates)).build(); - _$GEnterpriseServerUserAccountOrder._({this.direction, this.field}) + _$GEnterpriseServerUserAccountOrder._( + {required this.direction, required this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerUserAccountOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerUserAccountOrder', 'field'); - } + BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseServerUserAccountOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerUserAccountOrder', 'field'); } @override @@ -23547,23 +23902,24 @@ class GEnterpriseServerUserAccountOrderBuilder implements Builder { - _$GEnterpriseServerUserAccountOrder _$v; + _$GEnterpriseServerUserAccountOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GEnterpriseServerUserAccountOrderField _field; - GEnterpriseServerUserAccountOrderField get field => _$this._field; - set field(GEnterpriseServerUserAccountOrderField field) => + GEnterpriseServerUserAccountOrderField? _field; + GEnterpriseServerUserAccountOrderField? get field => _$this._field; + set field(GEnterpriseServerUserAccountOrderField? field) => _$this._field = field; GEnterpriseServerUserAccountOrderBuilder(); GEnterpriseServerUserAccountOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23571,14 +23927,13 @@ class GEnterpriseServerUserAccountOrderBuilder @override void replace(GEnterpriseServerUserAccountOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GEnterpriseServerUserAccountOrder; } @override - void update(void Function(GEnterpriseServerUserAccountOrderBuilder) updates) { + void update( + void Function(GEnterpriseServerUserAccountOrderBuilder)? updates) { if (updates != null) updates(this); } @@ -23586,7 +23941,10 @@ class GEnterpriseServerUserAccountOrderBuilder _$GEnterpriseServerUserAccountOrder build() { final _$result = _$v ?? new _$GEnterpriseServerUserAccountOrder._( - direction: direction, field: field); + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseServerUserAccountOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerUserAccountOrder', 'field')); replace(_$result); return _$result; } @@ -23600,21 +23958,18 @@ class _$GEnterpriseServerUserAccountsUploadOrder final GEnterpriseServerUserAccountsUploadOrderField field; factory _$GEnterpriseServerUserAccountsUploadOrder( - [void Function(GEnterpriseServerUserAccountsUploadOrderBuilder) + [void Function(GEnterpriseServerUserAccountsUploadOrderBuilder)? updates]) => (new GEnterpriseServerUserAccountsUploadOrderBuilder()..update(updates)) .build(); - _$GEnterpriseServerUserAccountsUploadOrder._({this.direction, this.field}) + _$GEnterpriseServerUserAccountsUploadOrder._( + {required this.direction, required this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerUserAccountsUploadOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GEnterpriseServerUserAccountsUploadOrder', 'field'); - } + BuiltValueNullFieldError.checkNotNull( + direction, 'GEnterpriseServerUserAccountsUploadOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerUserAccountsUploadOrder', 'field'); } @override @@ -23654,23 +24009,24 @@ class GEnterpriseServerUserAccountsUploadOrderBuilder implements Builder { - _$GEnterpriseServerUserAccountsUploadOrder _$v; + _$GEnterpriseServerUserAccountsUploadOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GEnterpriseServerUserAccountsUploadOrderField _field; - GEnterpriseServerUserAccountsUploadOrderField get field => _$this._field; - set field(GEnterpriseServerUserAccountsUploadOrderField field) => + GEnterpriseServerUserAccountsUploadOrderField? _field; + GEnterpriseServerUserAccountsUploadOrderField? get field => _$this._field; + set field(GEnterpriseServerUserAccountsUploadOrderField? field) => _$this._field = field; GEnterpriseServerUserAccountsUploadOrderBuilder(); GEnterpriseServerUserAccountsUploadOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23678,15 +24034,13 @@ class GEnterpriseServerUserAccountsUploadOrderBuilder @override void replace(GEnterpriseServerUserAccountsUploadOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GEnterpriseServerUserAccountsUploadOrder; } @override void update( - void Function(GEnterpriseServerUserAccountsUploadOrderBuilder) updates) { + void Function(GEnterpriseServerUserAccountsUploadOrderBuilder)? updates) { if (updates != null) updates(this); } @@ -23694,7 +24048,10 @@ class GEnterpriseServerUserAccountsUploadOrderBuilder _$GEnterpriseServerUserAccountsUploadOrder build() { final _$result = _$v ?? new _$GEnterpriseServerUserAccountsUploadOrder._( - direction: direction, field: field); + direction: BuiltValueNullFieldError.checkNotNull(direction, + 'GEnterpriseServerUserAccountsUploadOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GEnterpriseServerUserAccountsUploadOrder', 'field')); replace(_$result); return _$result; } @@ -23702,18 +24059,17 @@ class GEnterpriseServerUserAccountsUploadOrderBuilder class _$GFollowUserInput extends GFollowUserInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String userId; factory _$GFollowUserInput( - [void Function(GFollowUserInputBuilder) updates]) => + [void Function(GFollowUserInputBuilder)? updates]) => (new GFollowUserInputBuilder()..update(updates)).build(); - _$GFollowUserInput._({this.clientMutationId, this.userId}) : super._() { - if (userId == null) { - throw new BuiltValueNullFieldError('GFollowUserInput', 'userId'); - } + _$GFollowUserInput._({this.clientMutationId, required this.userId}) + : super._() { + BuiltValueNullFieldError.checkNotNull(userId, 'GFollowUserInput', 'userId'); } @override @@ -23748,23 +24104,24 @@ class _$GFollowUserInput extends GFollowUserInput { class GFollowUserInputBuilder implements Builder { - _$GFollowUserInput _$v; + _$GFollowUserInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _userId; - String get userId => _$this._userId; - set userId(String userId) => _$this._userId = userId; + String? _userId; + String? get userId => _$this._userId; + set userId(String? userId) => _$this._userId = userId; GFollowUserInputBuilder(); GFollowUserInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _userId = _$v.userId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _userId = $v.userId; _$v = null; } return this; @@ -23772,14 +24129,12 @@ class GFollowUserInputBuilder @override void replace(GFollowUserInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GFollowUserInput; } @override - void update(void Function(GFollowUserInputBuilder) updates) { + void update(void Function(GFollowUserInputBuilder)? updates) { if (updates != null) updates(this); } @@ -23787,7 +24142,9 @@ class GFollowUserInputBuilder _$GFollowUserInput build() { final _$result = _$v ?? new _$GFollowUserInput._( - clientMutationId: clientMutationId, userId: userId); + clientMutationId: clientMutationId, + userId: BuiltValueNullFieldError.checkNotNull( + userId, 'GFollowUserInput', 'userId')); replace(_$result); return _$result; } @@ -23799,16 +24156,12 @@ class _$GGistOrder extends GGistOrder { @override final GGistOrderField field; - factory _$GGistOrder([void Function(GGistOrderBuilder) updates]) => + factory _$GGistOrder([void Function(GGistOrderBuilder)? updates]) => (new GGistOrderBuilder()..update(updates)).build(); - _$GGistOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GGistOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GGistOrder', 'field'); - } + _$GGistOrder._({required this.direction, required this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull(direction, 'GGistOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GGistOrder', 'field'); } @override @@ -23841,22 +24194,23 @@ class _$GGistOrder extends GGistOrder { } class GGistOrderBuilder implements Builder { - _$GGistOrder _$v; + _$GGistOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GGistOrderField _field; - GGistOrderField get field => _$this._field; - set field(GGistOrderField field) => _$this._field = field; + GGistOrderField? _field; + GGistOrderField? get field => _$this._field; + set field(GGistOrderField? field) => _$this._field = field; GGistOrderBuilder(); GGistOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -23864,21 +24218,23 @@ class GGistOrderBuilder implements Builder { @override void replace(GGistOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GGistOrder; } @override - void update(void Function(GGistOrderBuilder) updates) { + void update(void Function(GGistOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GGistOrder build() { - final _$result = - _$v ?? new _$GGistOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GGistOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GGistOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GGistOrder', 'field')); replace(_$result); return _$result; } @@ -23888,13 +24244,11 @@ class _$GGitObjectID extends GGitObjectID { @override final String value; - factory _$GGitObjectID([void Function(GGitObjectIDBuilder) updates]) => + factory _$GGitObjectID([void Function(GGitObjectIDBuilder)? updates]) => (new GGitObjectIDBuilder()..update(updates)).build(); - _$GGitObjectID._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GGitObjectID', 'value'); - } + _$GGitObjectID._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GGitObjectID', 'value'); } @override @@ -23924,17 +24278,18 @@ class _$GGitObjectID extends GGitObjectID { class GGitObjectIDBuilder implements Builder { - _$GGitObjectID _$v; + _$GGitObjectID? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GGitObjectIDBuilder(); GGitObjectIDBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -23942,20 +24297,21 @@ class GGitObjectIDBuilder @override void replace(GGitObjectID other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GGitObjectID; } @override - void update(void Function(GGitObjectIDBuilder) updates) { + void update(void Function(GGitObjectIDBuilder)? updates) { if (updates != null) updates(this); } @override _$GGitObjectID build() { - final _$result = _$v ?? new _$GGitObjectID._(value: value); + final _$result = _$v ?? + new _$GGitObjectID._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GGitObjectID', 'value')); replace(_$result); return _$result; } @@ -23965,13 +24321,11 @@ class _$GGitSSHRemote extends GGitSSHRemote { @override final String value; - factory _$GGitSSHRemote([void Function(GGitSSHRemoteBuilder) updates]) => + factory _$GGitSSHRemote([void Function(GGitSSHRemoteBuilder)? updates]) => (new GGitSSHRemoteBuilder()..update(updates)).build(); - _$GGitSSHRemote._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GGitSSHRemote', 'value'); - } + _$GGitSSHRemote._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GGitSSHRemote', 'value'); } @override @@ -24001,17 +24355,18 @@ class _$GGitSSHRemote extends GGitSSHRemote { class GGitSSHRemoteBuilder implements Builder { - _$GGitSSHRemote _$v; + _$GGitSSHRemote? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GGitSSHRemoteBuilder(); GGitSSHRemoteBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -24019,20 +24374,21 @@ class GGitSSHRemoteBuilder @override void replace(GGitSSHRemote other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GGitSSHRemote; } @override - void update(void Function(GGitSSHRemoteBuilder) updates) { + void update(void Function(GGitSSHRemoteBuilder)? updates) { if (updates != null) updates(this); } @override _$GGitSSHRemote build() { - final _$result = _$v ?? new _$GGitSSHRemote._(value: value); + final _$result = _$v ?? + new _$GGitSSHRemote._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GGitSSHRemote', 'value')); replace(_$result); return _$result; } @@ -24042,13 +24398,11 @@ class _$GGitTimestamp extends GGitTimestamp { @override final String value; - factory _$GGitTimestamp([void Function(GGitTimestampBuilder) updates]) => + factory _$GGitTimestamp([void Function(GGitTimestampBuilder)? updates]) => (new GGitTimestampBuilder()..update(updates)).build(); - _$GGitTimestamp._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GGitTimestamp', 'value'); - } + _$GGitTimestamp._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GGitTimestamp', 'value'); } @override @@ -24078,17 +24432,18 @@ class _$GGitTimestamp extends GGitTimestamp { class GGitTimestampBuilder implements Builder { - _$GGitTimestamp _$v; + _$GGitTimestamp? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GGitTimestampBuilder(); GGitTimestampBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -24096,20 +24451,21 @@ class GGitTimestampBuilder @override void replace(GGitTimestamp other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GGitTimestamp; } @override - void update(void Function(GGitTimestampBuilder) updates) { + void update(void Function(GGitTimestampBuilder)? updates) { if (updates != null) updates(this); } @override _$GGitTimestamp build() { - final _$result = _$v ?? new _$GGitTimestamp._(value: value); + final _$result = _$v ?? + new _$GGitTimestamp._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GGitTimestamp', 'value')); replace(_$result); return _$result; } @@ -24119,13 +24475,11 @@ class _$GHTML extends GHTML { @override final String value; - factory _$GHTML([void Function(GHTMLBuilder) updates]) => + factory _$GHTML([void Function(GHTMLBuilder)? updates]) => (new GHTMLBuilder()..update(updates)).build(); - _$GHTML._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GHTML', 'value'); - } + _$GHTML._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GHTML', 'value'); } @override @@ -24154,17 +24508,18 @@ class _$GHTML extends GHTML { } class GHTMLBuilder implements Builder { - _$GHTML _$v; + _$GHTML? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GHTMLBuilder(); GHTMLBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -24172,20 +24527,21 @@ class GHTMLBuilder implements Builder { @override void replace(GHTML other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GHTML; } @override - void update(void Function(GHTMLBuilder) updates) { + void update(void Function(GHTMLBuilder)? updates) { if (updates != null) updates(this); } @override _$GHTML build() { - final _$result = _$v ?? new _$GHTML._(value: value); + final _$result = _$v ?? + new _$GHTML._( + value: + BuiltValueNullFieldError.checkNotNull(value, 'GHTML', 'value')); replace(_$result); return _$result; } @@ -24193,31 +24549,29 @@ class GHTMLBuilder implements Builder { class _$GInviteEnterpriseAdminInput extends GInviteEnterpriseAdminInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String email; + final String? email; @override final String enterpriseId; @override - final String invitee; + final String? invitee; @override - final GEnterpriseAdministratorRole role; + final GEnterpriseAdministratorRole? role; factory _$GInviteEnterpriseAdminInput( - [void Function(GInviteEnterpriseAdminInputBuilder) updates]) => + [void Function(GInviteEnterpriseAdminInputBuilder)? updates]) => (new GInviteEnterpriseAdminInputBuilder()..update(updates)).build(); _$GInviteEnterpriseAdminInput._( {this.clientMutationId, this.email, - this.enterpriseId, + required this.enterpriseId, this.invitee, this.role}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GInviteEnterpriseAdminInput', 'enterpriseId'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GInviteEnterpriseAdminInput', 'enterpriseId'); } @override @@ -24266,38 +24620,39 @@ class GInviteEnterpriseAdminInputBuilder implements Builder { - _$GInviteEnterpriseAdminInput _$v; + _$GInviteEnterpriseAdminInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _email; - String get email => _$this._email; - set email(String email) => _$this._email = email; + String? _email; + String? get email => _$this._email; + set email(String? email) => _$this._email = email; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - String _invitee; - String get invitee => _$this._invitee; - set invitee(String invitee) => _$this._invitee = invitee; + String? _invitee; + String? get invitee => _$this._invitee; + set invitee(String? invitee) => _$this._invitee = invitee; - GEnterpriseAdministratorRole _role; - GEnterpriseAdministratorRole get role => _$this._role; - set role(GEnterpriseAdministratorRole role) => _$this._role = role; + GEnterpriseAdministratorRole? _role; + GEnterpriseAdministratorRole? get role => _$this._role; + set role(GEnterpriseAdministratorRole? role) => _$this._role = role; GInviteEnterpriseAdminInputBuilder(); GInviteEnterpriseAdminInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _email = _$v.email; - _enterpriseId = _$v.enterpriseId; - _invitee = _$v.invitee; - _role = _$v.role; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _email = $v.email; + _enterpriseId = $v.enterpriseId; + _invitee = $v.invitee; + _role = $v.role; _$v = null; } return this; @@ -24305,14 +24660,12 @@ class GInviteEnterpriseAdminInputBuilder @override void replace(GInviteEnterpriseAdminInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GInviteEnterpriseAdminInput; } @override - void update(void Function(GInviteEnterpriseAdminInputBuilder) updates) { + void update(void Function(GInviteEnterpriseAdminInputBuilder)? updates) { if (updates != null) updates(this); } @@ -24322,7 +24675,8 @@ class GInviteEnterpriseAdminInputBuilder new _$GInviteEnterpriseAdminInput._( clientMutationId: clientMutationId, email: email, - enterpriseId: enterpriseId, + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GInviteEnterpriseAdminInput', 'enterpriseId'), invitee: invitee, role: role); replace(_$result); @@ -24332,23 +24686,23 @@ class GInviteEnterpriseAdminInputBuilder class _$GIssueFilters extends GIssueFilters { @override - final String assignee; + final String? assignee; @override - final String createdBy; + final String? createdBy; @override - final BuiltList labels; + final BuiltList? labels; @override - final String mentioned; + final String? mentioned; @override - final String milestone; + final String? milestone; @override - final GDateTime since; + final GDateTime? since; @override - final BuiltList states; + final BuiltList? states; @override - final bool viewerSubscribed; + final bool? viewerSubscribed; - factory _$GIssueFilters([void Function(GIssueFiltersBuilder) updates]) => + factory _$GIssueFilters([void Function(GIssueFiltersBuilder)? updates]) => (new GIssueFiltersBuilder()..update(updates)).build(); _$GIssueFilters._( @@ -24360,14 +24714,7 @@ class _$GIssueFilters extends GIssueFilters { this.since, this.states, this.viewerSubscribed}) - : super._() { - if (labels == null) { - throw new BuiltValueNullFieldError('GIssueFilters', 'labels'); - } - if (states == null) { - throw new BuiltValueNullFieldError('GIssueFilters', 'states'); - } - } + : super._(); @override GIssueFilters rebuild(void Function(GIssueFiltersBuilder) updates) => @@ -24423,55 +24770,56 @@ class _$GIssueFilters extends GIssueFilters { class GIssueFiltersBuilder implements Builder { - _$GIssueFilters _$v; + _$GIssueFilters? _$v; - String _assignee; - String get assignee => _$this._assignee; - set assignee(String assignee) => _$this._assignee = assignee; + String? _assignee; + String? get assignee => _$this._assignee; + set assignee(String? assignee) => _$this._assignee = assignee; - String _createdBy; - String get createdBy => _$this._createdBy; - set createdBy(String createdBy) => _$this._createdBy = createdBy; + String? _createdBy; + String? get createdBy => _$this._createdBy; + set createdBy(String? createdBy) => _$this._createdBy = createdBy; - ListBuilder _labels; + ListBuilder? _labels; ListBuilder get labels => _$this._labels ??= new ListBuilder(); - set labels(ListBuilder labels) => _$this._labels = labels; + set labels(ListBuilder? labels) => _$this._labels = labels; - String _mentioned; - String get mentioned => _$this._mentioned; - set mentioned(String mentioned) => _$this._mentioned = mentioned; + String? _mentioned; + String? get mentioned => _$this._mentioned; + set mentioned(String? mentioned) => _$this._mentioned = mentioned; - String _milestone; - String get milestone => _$this._milestone; - set milestone(String milestone) => _$this._milestone = milestone; + String? _milestone; + String? get milestone => _$this._milestone; + set milestone(String? milestone) => _$this._milestone = milestone; - GDateTimeBuilder _since; + GDateTimeBuilder? _since; GDateTimeBuilder get since => _$this._since ??= new GDateTimeBuilder(); - set since(GDateTimeBuilder since) => _$this._since = since; + set since(GDateTimeBuilder? since) => _$this._since = since; - ListBuilder _states; + ListBuilder? _states; ListBuilder get states => _$this._states ??= new ListBuilder(); - set states(ListBuilder states) => _$this._states = states; + set states(ListBuilder? states) => _$this._states = states; - bool _viewerSubscribed; - bool get viewerSubscribed => _$this._viewerSubscribed; - set viewerSubscribed(bool viewerSubscribed) => + bool? _viewerSubscribed; + bool? get viewerSubscribed => _$this._viewerSubscribed; + set viewerSubscribed(bool? viewerSubscribed) => _$this._viewerSubscribed = viewerSubscribed; GIssueFiltersBuilder(); GIssueFiltersBuilder get _$this { - if (_$v != null) { - _assignee = _$v.assignee; - _createdBy = _$v.createdBy; - _labels = _$v.labels?.toBuilder(); - _mentioned = _$v.mentioned; - _milestone = _$v.milestone; - _since = _$v.since?.toBuilder(); - _states = _$v.states?.toBuilder(); - _viewerSubscribed = _$v.viewerSubscribed; + final $v = _$v; + if ($v != null) { + _assignee = $v.assignee; + _createdBy = $v.createdBy; + _labels = $v.labels?.toBuilder(); + _mentioned = $v.mentioned; + _milestone = $v.milestone; + _since = $v.since?.toBuilder(); + _states = $v.states?.toBuilder(); + _viewerSubscribed = $v.viewerSubscribed; _$v = null; } return this; @@ -24479,14 +24827,12 @@ class GIssueFiltersBuilder @override void replace(GIssueFilters other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GIssueFilters; } @override - void update(void Function(GIssueFiltersBuilder) updates) { + void update(void Function(GIssueFiltersBuilder)? updates) { if (updates != null) updates(this); } @@ -24498,22 +24844,22 @@ class GIssueFiltersBuilder new _$GIssueFilters._( assignee: assignee, createdBy: createdBy, - labels: labels.build(), + labels: _labels?.build(), mentioned: mentioned, milestone: milestone, since: _since?.build(), - states: states.build(), + states: _states?.build(), viewerSubscribed: viewerSubscribed); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'labels'; - labels.build(); + _labels?.build(); _$failedField = 'since'; _since?.build(); _$failedField = 'states'; - states.build(); + _states?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GIssueFilters', _$failedField, e.toString()); @@ -24531,16 +24877,13 @@ class _$GIssueOrder extends GIssueOrder { @override final GIssueOrderField field; - factory _$GIssueOrder([void Function(GIssueOrderBuilder) updates]) => + factory _$GIssueOrder([void Function(GIssueOrderBuilder)? updates]) => (new GIssueOrderBuilder()..update(updates)).build(); - _$GIssueOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GIssueOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GIssueOrder', 'field'); - } + _$GIssueOrder._({required this.direction, required this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GIssueOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GIssueOrder', 'field'); } @override @@ -24573,22 +24916,23 @@ class _$GIssueOrder extends GIssueOrder { } class GIssueOrderBuilder implements Builder { - _$GIssueOrder _$v; + _$GIssueOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GIssueOrderField _field; - GIssueOrderField get field => _$this._field; - set field(GIssueOrderField field) => _$this._field = field; + GIssueOrderField? _field; + GIssueOrderField? get field => _$this._field; + set field(GIssueOrderField? field) => _$this._field = field; GIssueOrderBuilder(); GIssueOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -24596,21 +24940,23 @@ class GIssueOrderBuilder implements Builder { @override void replace(GIssueOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GIssueOrder; } @override - void update(void Function(GIssueOrderBuilder) updates) { + void update(void Function(GIssueOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GIssueOrder build() { - final _$result = - _$v ?? new _$GIssueOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GIssueOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GIssueOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GIssueOrder', 'field')); replace(_$result); return _$result; } @@ -24622,16 +24968,13 @@ class _$GLabelOrder extends GLabelOrder { @override final GLabelOrderField field; - factory _$GLabelOrder([void Function(GLabelOrderBuilder) updates]) => + factory _$GLabelOrder([void Function(GLabelOrderBuilder)? updates]) => (new GLabelOrderBuilder()..update(updates)).build(); - _$GLabelOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GLabelOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GLabelOrder', 'field'); - } + _$GLabelOrder._({required this.direction, required this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GLabelOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GLabelOrder', 'field'); } @override @@ -24664,22 +25007,23 @@ class _$GLabelOrder extends GLabelOrder { } class GLabelOrderBuilder implements Builder { - _$GLabelOrder _$v; + _$GLabelOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GLabelOrderField _field; - GLabelOrderField get field => _$this._field; - set field(GLabelOrderField field) => _$this._field = field; + GLabelOrderField? _field; + GLabelOrderField? get field => _$this._field; + set field(GLabelOrderField? field) => _$this._field = field; GLabelOrderBuilder(); GLabelOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -24687,21 +25031,23 @@ class GLabelOrderBuilder implements Builder { @override void replace(GLabelOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GLabelOrder; } @override - void update(void Function(GLabelOrderBuilder) updates) { + void update(void Function(GLabelOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GLabelOrder build() { - final _$result = - _$v ?? new _$GLabelOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GLabelOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GLabelOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GLabelOrder', 'field')); replace(_$result); return _$result; } @@ -24713,16 +25059,14 @@ class _$GLanguageOrder extends GLanguageOrder { @override final GLanguageOrderField field; - factory _$GLanguageOrder([void Function(GLanguageOrderBuilder) updates]) => + factory _$GLanguageOrder([void Function(GLanguageOrderBuilder)? updates]) => (new GLanguageOrderBuilder()..update(updates)).build(); - _$GLanguageOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GLanguageOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GLanguageOrder', 'field'); - } + _$GLanguageOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GLanguageOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GLanguageOrder', 'field'); } @override @@ -24757,22 +25101,23 @@ class _$GLanguageOrder extends GLanguageOrder { class GLanguageOrderBuilder implements Builder { - _$GLanguageOrder _$v; + _$GLanguageOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GLanguageOrderField _field; - GLanguageOrderField get field => _$this._field; - set field(GLanguageOrderField field) => _$this._field = field; + GLanguageOrderField? _field; + GLanguageOrderField? get field => _$this._field; + set field(GLanguageOrderField? field) => _$this._field = field; GLanguageOrderBuilder(); GLanguageOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -24780,21 +25125,23 @@ class GLanguageOrderBuilder @override void replace(GLanguageOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GLanguageOrder; } @override - void update(void Function(GLanguageOrderBuilder) updates) { + void update(void Function(GLanguageOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GLanguageOrder build() { - final _$result = - _$v ?? new _$GLanguageOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GLanguageOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GLanguageOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GLanguageOrder', 'field')); replace(_$result); return _$result; } @@ -24802,27 +25149,25 @@ class GLanguageOrderBuilder class _$GLinkRepositoryToProjectInput extends GLinkRepositoryToProjectInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String projectId; @override final String repositoryId; factory _$GLinkRepositoryToProjectInput( - [void Function(GLinkRepositoryToProjectInputBuilder) updates]) => + [void Function(GLinkRepositoryToProjectInputBuilder)? updates]) => (new GLinkRepositoryToProjectInputBuilder()..update(updates)).build(); _$GLinkRepositoryToProjectInput._( - {this.clientMutationId, this.projectId, this.repositoryId}) + {this.clientMutationId, + required this.projectId, + required this.repositoryId}) : super._() { - if (projectId == null) { - throw new BuiltValueNullFieldError( - 'GLinkRepositoryToProjectInput', 'projectId'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GLinkRepositoryToProjectInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + projectId, 'GLinkRepositoryToProjectInput', 'projectId'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GLinkRepositoryToProjectInput', 'repositoryId'); } @override @@ -24863,28 +25208,29 @@ class GLinkRepositoryToProjectInputBuilder implements Builder { - _$GLinkRepositoryToProjectInput _$v; + _$GLinkRepositoryToProjectInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _projectId; - String get projectId => _$this._projectId; - set projectId(String projectId) => _$this._projectId = projectId; + String? _projectId; + String? get projectId => _$this._projectId; + set projectId(String? projectId) => _$this._projectId = projectId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GLinkRepositoryToProjectInputBuilder(); GLinkRepositoryToProjectInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _projectId = _$v.projectId; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _projectId = $v.projectId; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -24892,14 +25238,12 @@ class GLinkRepositoryToProjectInputBuilder @override void replace(GLinkRepositoryToProjectInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GLinkRepositoryToProjectInput; } @override - void update(void Function(GLinkRepositoryToProjectInputBuilder) updates) { + void update(void Function(GLinkRepositoryToProjectInputBuilder)? updates) { if (updates != null) updates(this); } @@ -24908,8 +25252,10 @@ class GLinkRepositoryToProjectInputBuilder final _$result = _$v ?? new _$GLinkRepositoryToProjectInput._( clientMutationId: clientMutationId, - projectId: projectId, - repositoryId: repositoryId); + projectId: BuiltValueNullFieldError.checkNotNull( + projectId, 'GLinkRepositoryToProjectInput', 'projectId'), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GLinkRepositoryToProjectInput', 'repositoryId')); replace(_$result); return _$result; } @@ -24917,22 +25263,21 @@ class GLinkRepositoryToProjectInputBuilder class _$GLockLockableInput extends GLockLockableInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final GLockReason lockReason; + final GLockReason? lockReason; @override final String lockableId; factory _$GLockLockableInput( - [void Function(GLockLockableInputBuilder) updates]) => + [void Function(GLockLockableInputBuilder)? updates]) => (new GLockLockableInputBuilder()..update(updates)).build(); _$GLockLockableInput._( - {this.clientMutationId, this.lockReason, this.lockableId}) + {this.clientMutationId, this.lockReason, required this.lockableId}) : super._() { - if (lockableId == null) { - throw new BuiltValueNullFieldError('GLockLockableInput', 'lockableId'); - } + BuiltValueNullFieldError.checkNotNull( + lockableId, 'GLockLockableInput', 'lockableId'); } @override @@ -24971,28 +25316,29 @@ class _$GLockLockableInput extends GLockLockableInput { class GLockLockableInputBuilder implements Builder { - _$GLockLockableInput _$v; + _$GLockLockableInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - GLockReason _lockReason; - GLockReason get lockReason => _$this._lockReason; - set lockReason(GLockReason lockReason) => _$this._lockReason = lockReason; + GLockReason? _lockReason; + GLockReason? get lockReason => _$this._lockReason; + set lockReason(GLockReason? lockReason) => _$this._lockReason = lockReason; - String _lockableId; - String get lockableId => _$this._lockableId; - set lockableId(String lockableId) => _$this._lockableId = lockableId; + String? _lockableId; + String? get lockableId => _$this._lockableId; + set lockableId(String? lockableId) => _$this._lockableId = lockableId; GLockLockableInputBuilder(); GLockLockableInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _lockReason = _$v.lockReason; - _lockableId = _$v.lockableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _lockReason = $v.lockReason; + _lockableId = $v.lockableId; _$v = null; } return this; @@ -25000,14 +25346,12 @@ class GLockLockableInputBuilder @override void replace(GLockLockableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GLockLockableInput; } @override - void update(void Function(GLockLockableInputBuilder) updates) { + void update(void Function(GLockLockableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -25017,7 +25361,8 @@ class GLockLockableInputBuilder new _$GLockLockableInput._( clientMutationId: clientMutationId, lockReason: lockReason, - lockableId: lockableId); + lockableId: BuiltValueNullFieldError.checkNotNull( + lockableId, 'GLockLockableInput', 'lockableId')); replace(_$result); return _$result; } @@ -25027,34 +25372,29 @@ class _$GMergeBranchInput extends GMergeBranchInput { @override final String base; @override - final String clientMutationId; + final String? clientMutationId; @override - final String commitMessage; + final String? commitMessage; @override final String head; @override final String repositoryId; factory _$GMergeBranchInput( - [void Function(GMergeBranchInputBuilder) updates]) => + [void Function(GMergeBranchInputBuilder)? updates]) => (new GMergeBranchInputBuilder()..update(updates)).build(); _$GMergeBranchInput._( - {this.base, + {required this.base, this.clientMutationId, this.commitMessage, - this.head, - this.repositoryId}) + required this.head, + required this.repositoryId}) : super._() { - if (base == null) { - throw new BuiltValueNullFieldError('GMergeBranchInput', 'base'); - } - if (head == null) { - throw new BuiltValueNullFieldError('GMergeBranchInput', 'head'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError('GMergeBranchInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull(base, 'GMergeBranchInput', 'base'); + BuiltValueNullFieldError.checkNotNull(head, 'GMergeBranchInput', 'head'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GMergeBranchInput', 'repositoryId'); } @override @@ -25100,39 +25440,40 @@ class _$GMergeBranchInput extends GMergeBranchInput { class GMergeBranchInputBuilder implements Builder { - _$GMergeBranchInput _$v; + _$GMergeBranchInput? _$v; - String _base; - String get base => _$this._base; - set base(String base) => _$this._base = base; + String? _base; + String? get base => _$this._base; + set base(String? base) => _$this._base = base; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _commitMessage; - String get commitMessage => _$this._commitMessage; - set commitMessage(String commitMessage) => + String? _commitMessage; + String? get commitMessage => _$this._commitMessage; + set commitMessage(String? commitMessage) => _$this._commitMessage = commitMessage; - String _head; - String get head => _$this._head; - set head(String head) => _$this._head = head; + String? _head; + String? get head => _$this._head; + set head(String? head) => _$this._head = head; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GMergeBranchInputBuilder(); GMergeBranchInputBuilder get _$this { - if (_$v != null) { - _base = _$v.base; - _clientMutationId = _$v.clientMutationId; - _commitMessage = _$v.commitMessage; - _head = _$v.head; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _base = $v.base; + _clientMutationId = $v.clientMutationId; + _commitMessage = $v.commitMessage; + _head = $v.head; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -25140,14 +25481,12 @@ class GMergeBranchInputBuilder @override void replace(GMergeBranchInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GMergeBranchInput; } @override - void update(void Function(GMergeBranchInputBuilder) updates) { + void update(void Function(GMergeBranchInputBuilder)? updates) { if (updates != null) updates(this); } @@ -25155,11 +25494,14 @@ class GMergeBranchInputBuilder _$GMergeBranchInput build() { final _$result = _$v ?? new _$GMergeBranchInput._( - base: base, + base: BuiltValueNullFieldError.checkNotNull( + base, 'GMergeBranchInput', 'base'), clientMutationId: clientMutationId, commitMessage: commitMessage, - head: head, - repositoryId: repositoryId); + head: BuiltValueNullFieldError.checkNotNull( + head, 'GMergeBranchInput', 'head'), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GMergeBranchInput', 'repositoryId')); replace(_$result); return _$result; } @@ -25167,20 +25509,20 @@ class GMergeBranchInputBuilder class _$GMergePullRequestInput extends GMergePullRequestInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String commitBody; + final String? commitBody; @override - final String commitHeadline; + final String? commitHeadline; @override - final GGitObjectID expectedHeadOid; + final GGitObjectID? expectedHeadOid; @override - final GPullRequestMergeMethod mergeMethod; + final GPullRequestMergeMethod? mergeMethod; @override final String pullRequestId; factory _$GMergePullRequestInput( - [void Function(GMergePullRequestInputBuilder) updates]) => + [void Function(GMergePullRequestInputBuilder)? updates]) => (new GMergePullRequestInputBuilder()..update(updates)).build(); _$GMergePullRequestInput._( @@ -25189,12 +25531,10 @@ class _$GMergePullRequestInput extends GMergePullRequestInput { this.commitHeadline, this.expectedHeadOid, this.mergeMethod, - this.pullRequestId}) + required this.pullRequestId}) : super._() { - if (pullRequestId == null) { - throw new BuiltValueNullFieldError( - 'GMergePullRequestInput', 'pullRequestId'); - } + BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GMergePullRequestInput', 'pullRequestId'); } @override @@ -25245,48 +25585,49 @@ class _$GMergePullRequestInput extends GMergePullRequestInput { class GMergePullRequestInputBuilder implements Builder { - _$GMergePullRequestInput _$v; + _$GMergePullRequestInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _commitBody; - String get commitBody => _$this._commitBody; - set commitBody(String commitBody) => _$this._commitBody = commitBody; + String? _commitBody; + String? get commitBody => _$this._commitBody; + set commitBody(String? commitBody) => _$this._commitBody = commitBody; - String _commitHeadline; - String get commitHeadline => _$this._commitHeadline; - set commitHeadline(String commitHeadline) => + String? _commitHeadline; + String? get commitHeadline => _$this._commitHeadline; + set commitHeadline(String? commitHeadline) => _$this._commitHeadline = commitHeadline; - GGitObjectIDBuilder _expectedHeadOid; + GGitObjectIDBuilder? _expectedHeadOid; GGitObjectIDBuilder get expectedHeadOid => _$this._expectedHeadOid ??= new GGitObjectIDBuilder(); - set expectedHeadOid(GGitObjectIDBuilder expectedHeadOid) => + set expectedHeadOid(GGitObjectIDBuilder? expectedHeadOid) => _$this._expectedHeadOid = expectedHeadOid; - GPullRequestMergeMethod _mergeMethod; - GPullRequestMergeMethod get mergeMethod => _$this._mergeMethod; - set mergeMethod(GPullRequestMergeMethod mergeMethod) => + GPullRequestMergeMethod? _mergeMethod; + GPullRequestMergeMethod? get mergeMethod => _$this._mergeMethod; + set mergeMethod(GPullRequestMergeMethod? mergeMethod) => _$this._mergeMethod = mergeMethod; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; GMergePullRequestInputBuilder(); GMergePullRequestInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _commitBody = _$v.commitBody; - _commitHeadline = _$v.commitHeadline; - _expectedHeadOid = _$v.expectedHeadOid?.toBuilder(); - _mergeMethod = _$v.mergeMethod; - _pullRequestId = _$v.pullRequestId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _commitBody = $v.commitBody; + _commitHeadline = $v.commitHeadline; + _expectedHeadOid = $v.expectedHeadOid?.toBuilder(); + _mergeMethod = $v.mergeMethod; + _pullRequestId = $v.pullRequestId; _$v = null; } return this; @@ -25294,14 +25635,12 @@ class GMergePullRequestInputBuilder @override void replace(GMergePullRequestInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GMergePullRequestInput; } @override - void update(void Function(GMergePullRequestInputBuilder) updates) { + void update(void Function(GMergePullRequestInputBuilder)? updates) { if (updates != null) updates(this); } @@ -25316,9 +25655,10 @@ class GMergePullRequestInputBuilder commitHeadline: commitHeadline, expectedHeadOid: _expectedHeadOid?.build(), mergeMethod: mergeMethod, - pullRequestId: pullRequestId); + pullRequestId: BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GMergePullRequestInput', 'pullRequestId')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'expectedHeadOid'; _expectedHeadOid?.build(); @@ -25339,16 +25679,14 @@ class _$GMilestoneOrder extends GMilestoneOrder { @override final GMilestoneOrderField field; - factory _$GMilestoneOrder([void Function(GMilestoneOrderBuilder) updates]) => + factory _$GMilestoneOrder([void Function(GMilestoneOrderBuilder)? updates]) => (new GMilestoneOrderBuilder()..update(updates)).build(); - _$GMilestoneOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GMilestoneOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GMilestoneOrder', 'field'); - } + _$GMilestoneOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GMilestoneOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GMilestoneOrder', 'field'); } @override @@ -25383,22 +25721,23 @@ class _$GMilestoneOrder extends GMilestoneOrder { class GMilestoneOrderBuilder implements Builder { - _$GMilestoneOrder _$v; + _$GMilestoneOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GMilestoneOrderField _field; - GMilestoneOrderField get field => _$this._field; - set field(GMilestoneOrderField field) => _$this._field = field; + GMilestoneOrderField? _field; + GMilestoneOrderField? get field => _$this._field; + set field(GMilestoneOrderField? field) => _$this._field = field; GMilestoneOrderBuilder(); GMilestoneOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -25406,21 +25745,23 @@ class GMilestoneOrderBuilder @override void replace(GMilestoneOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GMilestoneOrder; } @override - void update(void Function(GMilestoneOrderBuilder) updates) { + void update(void Function(GMilestoneOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GMilestoneOrder build() { - final _$result = - _$v ?? new _$GMilestoneOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GMilestoneOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GMilestoneOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GMilestoneOrder', 'field')); replace(_$result); return _$result; } @@ -25428,27 +25769,28 @@ class GMilestoneOrderBuilder class _$GMoveProjectCardInput extends GMoveProjectCardInput { @override - final String afterCardId; + final String? afterCardId; @override final String cardId; @override - final String clientMutationId; + final String? clientMutationId; @override final String columnId; factory _$GMoveProjectCardInput( - [void Function(GMoveProjectCardInputBuilder) updates]) => + [void Function(GMoveProjectCardInputBuilder)? updates]) => (new GMoveProjectCardInputBuilder()..update(updates)).build(); _$GMoveProjectCardInput._( - {this.afterCardId, this.cardId, this.clientMutationId, this.columnId}) + {this.afterCardId, + required this.cardId, + this.clientMutationId, + required this.columnId}) : super._() { - if (cardId == null) { - throw new BuiltValueNullFieldError('GMoveProjectCardInput', 'cardId'); - } - if (columnId == null) { - throw new BuiltValueNullFieldError('GMoveProjectCardInput', 'columnId'); - } + BuiltValueNullFieldError.checkNotNull( + cardId, 'GMoveProjectCardInput', 'cardId'); + BuiltValueNullFieldError.checkNotNull( + columnId, 'GMoveProjectCardInput', 'columnId'); } @override @@ -25491,33 +25833,34 @@ class _$GMoveProjectCardInput extends GMoveProjectCardInput { class GMoveProjectCardInputBuilder implements Builder { - _$GMoveProjectCardInput _$v; + _$GMoveProjectCardInput? _$v; - String _afterCardId; - String get afterCardId => _$this._afterCardId; - set afterCardId(String afterCardId) => _$this._afterCardId = afterCardId; + String? _afterCardId; + String? get afterCardId => _$this._afterCardId; + set afterCardId(String? afterCardId) => _$this._afterCardId = afterCardId; - String _cardId; - String get cardId => _$this._cardId; - set cardId(String cardId) => _$this._cardId = cardId; + String? _cardId; + String? get cardId => _$this._cardId; + set cardId(String? cardId) => _$this._cardId = cardId; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _columnId; - String get columnId => _$this._columnId; - set columnId(String columnId) => _$this._columnId = columnId; + String? _columnId; + String? get columnId => _$this._columnId; + set columnId(String? columnId) => _$this._columnId = columnId; GMoveProjectCardInputBuilder(); GMoveProjectCardInputBuilder get _$this { - if (_$v != null) { - _afterCardId = _$v.afterCardId; - _cardId = _$v.cardId; - _clientMutationId = _$v.clientMutationId; - _columnId = _$v.columnId; + final $v = _$v; + if ($v != null) { + _afterCardId = $v.afterCardId; + _cardId = $v.cardId; + _clientMutationId = $v.clientMutationId; + _columnId = $v.columnId; _$v = null; } return this; @@ -25525,14 +25868,12 @@ class GMoveProjectCardInputBuilder @override void replace(GMoveProjectCardInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GMoveProjectCardInput; } @override - void update(void Function(GMoveProjectCardInputBuilder) updates) { + void update(void Function(GMoveProjectCardInputBuilder)? updates) { if (updates != null) updates(this); } @@ -25541,9 +25882,11 @@ class GMoveProjectCardInputBuilder final _$result = _$v ?? new _$GMoveProjectCardInput._( afterCardId: afterCardId, - cardId: cardId, + cardId: BuiltValueNullFieldError.checkNotNull( + cardId, 'GMoveProjectCardInput', 'cardId'), clientMutationId: clientMutationId, - columnId: columnId); + columnId: BuiltValueNullFieldError.checkNotNull( + columnId, 'GMoveProjectCardInput', 'columnId')); replace(_$result); return _$result; } @@ -25551,22 +25894,21 @@ class GMoveProjectCardInputBuilder class _$GMoveProjectColumnInput extends GMoveProjectColumnInput { @override - final String afterColumnId; + final String? afterColumnId; @override - final String clientMutationId; + final String? clientMutationId; @override final String columnId; factory _$GMoveProjectColumnInput( - [void Function(GMoveProjectColumnInputBuilder) updates]) => + [void Function(GMoveProjectColumnInputBuilder)? updates]) => (new GMoveProjectColumnInputBuilder()..update(updates)).build(); _$GMoveProjectColumnInput._( - {this.afterColumnId, this.clientMutationId, this.columnId}) + {this.afterColumnId, this.clientMutationId, required this.columnId}) : super._() { - if (columnId == null) { - throw new BuiltValueNullFieldError('GMoveProjectColumnInput', 'columnId'); - } + BuiltValueNullFieldError.checkNotNull( + columnId, 'GMoveProjectColumnInput', 'columnId'); } @override @@ -25607,29 +25949,30 @@ class _$GMoveProjectColumnInput extends GMoveProjectColumnInput { class GMoveProjectColumnInputBuilder implements Builder { - _$GMoveProjectColumnInput _$v; + _$GMoveProjectColumnInput? _$v; - String _afterColumnId; - String get afterColumnId => _$this._afterColumnId; - set afterColumnId(String afterColumnId) => + String? _afterColumnId; + String? get afterColumnId => _$this._afterColumnId; + set afterColumnId(String? afterColumnId) => _$this._afterColumnId = afterColumnId; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _columnId; - String get columnId => _$this._columnId; - set columnId(String columnId) => _$this._columnId = columnId; + String? _columnId; + String? get columnId => _$this._columnId; + set columnId(String? columnId) => _$this._columnId = columnId; GMoveProjectColumnInputBuilder(); GMoveProjectColumnInputBuilder get _$this { - if (_$v != null) { - _afterColumnId = _$v.afterColumnId; - _clientMutationId = _$v.clientMutationId; - _columnId = _$v.columnId; + final $v = _$v; + if ($v != null) { + _afterColumnId = $v.afterColumnId; + _clientMutationId = $v.clientMutationId; + _columnId = $v.columnId; _$v = null; } return this; @@ -25637,14 +25980,12 @@ class GMoveProjectColumnInputBuilder @override void replace(GMoveProjectColumnInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GMoveProjectColumnInput; } @override - void update(void Function(GMoveProjectColumnInputBuilder) updates) { + void update(void Function(GMoveProjectColumnInputBuilder)? updates) { if (updates != null) updates(this); } @@ -25654,7 +25995,8 @@ class GMoveProjectColumnInputBuilder new _$GMoveProjectColumnInput._( afterColumnId: afterColumnId, clientMutationId: clientMutationId, - columnId: columnId); + columnId: BuiltValueNullFieldError.checkNotNull( + columnId, 'GMoveProjectColumnInput', 'columnId')); replace(_$result); return _$result; } @@ -25667,16 +26009,14 @@ class _$GOrganizationOrder extends GOrganizationOrder { final GOrganizationOrderField field; factory _$GOrganizationOrder( - [void Function(GOrganizationOrderBuilder) updates]) => + [void Function(GOrganizationOrderBuilder)? updates]) => (new GOrganizationOrderBuilder()..update(updates)).build(); - _$GOrganizationOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GOrganizationOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GOrganizationOrder', 'field'); - } + _$GOrganizationOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GOrganizationOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GOrganizationOrder', 'field'); } @override @@ -25712,22 +26052,23 @@ class _$GOrganizationOrder extends GOrganizationOrder { class GOrganizationOrderBuilder implements Builder { - _$GOrganizationOrder _$v; + _$GOrganizationOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GOrganizationOrderField _field; - GOrganizationOrderField get field => _$this._field; - set field(GOrganizationOrderField field) => _$this._field = field; + GOrganizationOrderField? _field; + GOrganizationOrderField? get field => _$this._field; + set field(GOrganizationOrderField? field) => _$this._field = field; GOrganizationOrderBuilder(); GOrganizationOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -25735,21 +26076,23 @@ class GOrganizationOrderBuilder @override void replace(GOrganizationOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GOrganizationOrder; } @override - void update(void Function(GOrganizationOrderBuilder) updates) { + void update(void Function(GOrganizationOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GOrganizationOrder build() { - final _$result = - _$v ?? new _$GOrganizationOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GOrganizationOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GOrganizationOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GOrganizationOrder', 'field')); replace(_$result); return _$result; } @@ -25760,13 +26103,11 @@ class _$GPreciseDateTime extends GPreciseDateTime { final String value; factory _$GPreciseDateTime( - [void Function(GPreciseDateTimeBuilder) updates]) => + [void Function(GPreciseDateTimeBuilder)? updates]) => (new GPreciseDateTimeBuilder()..update(updates)).build(); - _$GPreciseDateTime._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GPreciseDateTime', 'value'); - } + _$GPreciseDateTime._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GPreciseDateTime', 'value'); } @override @@ -25798,17 +26139,18 @@ class _$GPreciseDateTime extends GPreciseDateTime { class GPreciseDateTimeBuilder implements Builder { - _$GPreciseDateTime _$v; + _$GPreciseDateTime? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GPreciseDateTimeBuilder(); GPreciseDateTimeBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -25816,20 +26158,21 @@ class GPreciseDateTimeBuilder @override void replace(GPreciseDateTime other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPreciseDateTime; } @override - void update(void Function(GPreciseDateTimeBuilder) updates) { + void update(void Function(GPreciseDateTimeBuilder)? updates) { if (updates != null) updates(this); } @override _$GPreciseDateTime build() { - final _$result = _$v ?? new _$GPreciseDateTime._(value: value); + final _$result = _$v ?? + new _$GPreciseDateTime._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GPreciseDateTime', 'value')); replace(_$result); return _$result; } @@ -25841,16 +26184,14 @@ class _$GProjectOrder extends GProjectOrder { @override final GProjectOrderField field; - factory _$GProjectOrder([void Function(GProjectOrderBuilder) updates]) => + factory _$GProjectOrder([void Function(GProjectOrderBuilder)? updates]) => (new GProjectOrderBuilder()..update(updates)).build(); - _$GProjectOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GProjectOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GProjectOrder', 'field'); - } + _$GProjectOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GProjectOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GProjectOrder', 'field'); } @override @@ -25884,22 +26225,23 @@ class _$GProjectOrder extends GProjectOrder { class GProjectOrderBuilder implements Builder { - _$GProjectOrder _$v; + _$GProjectOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GProjectOrderField _field; - GProjectOrderField get field => _$this._field; - set field(GProjectOrderField field) => _$this._field = field; + GProjectOrderField? _field; + GProjectOrderField? get field => _$this._field; + set field(GProjectOrderField? field) => _$this._field = field; GProjectOrderBuilder(); GProjectOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -25907,21 +26249,23 @@ class GProjectOrderBuilder @override void replace(GProjectOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GProjectOrder; } @override - void update(void Function(GProjectOrderBuilder) updates) { + void update(void Function(GProjectOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GProjectOrder build() { - final _$result = - _$v ?? new _$GProjectOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GProjectOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GProjectOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GProjectOrder', 'field')); replace(_$result); return _$result; } @@ -25934,16 +26278,14 @@ class _$GPullRequestOrder extends GPullRequestOrder { final GPullRequestOrderField field; factory _$GPullRequestOrder( - [void Function(GPullRequestOrderBuilder) updates]) => + [void Function(GPullRequestOrderBuilder)? updates]) => (new GPullRequestOrderBuilder()..update(updates)).build(); - _$GPullRequestOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GPullRequestOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GPullRequestOrder', 'field'); - } + _$GPullRequestOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GPullRequestOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GPullRequestOrder', 'field'); } @override @@ -25978,22 +26320,23 @@ class _$GPullRequestOrder extends GPullRequestOrder { class GPullRequestOrderBuilder implements Builder { - _$GPullRequestOrder _$v; + _$GPullRequestOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GPullRequestOrderField _field; - GPullRequestOrderField get field => _$this._field; - set field(GPullRequestOrderField field) => _$this._field = field; + GPullRequestOrderField? _field; + GPullRequestOrderField? get field => _$this._field; + set field(GPullRequestOrderField? field) => _$this._field = field; GPullRequestOrderBuilder(); GPullRequestOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -26001,21 +26344,23 @@ class GPullRequestOrderBuilder @override void replace(GPullRequestOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPullRequestOrder; } @override - void update(void Function(GPullRequestOrderBuilder) updates) { + void update(void Function(GPullRequestOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GPullRequestOrder build() { - final _$result = - _$v ?? new _$GPullRequestOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GPullRequestOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GPullRequestOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GPullRequestOrder', 'field')); replace(_$result); return _$result; } @@ -26027,16 +26372,14 @@ class _$GReactionOrder extends GReactionOrder { @override final GReactionOrderField field; - factory _$GReactionOrder([void Function(GReactionOrderBuilder) updates]) => + factory _$GReactionOrder([void Function(GReactionOrderBuilder)? updates]) => (new GReactionOrderBuilder()..update(updates)).build(); - _$GReactionOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GReactionOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GReactionOrder', 'field'); - } + _$GReactionOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GReactionOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GReactionOrder', 'field'); } @override @@ -26071,22 +26414,23 @@ class _$GReactionOrder extends GReactionOrder { class GReactionOrderBuilder implements Builder { - _$GReactionOrder _$v; + _$GReactionOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GReactionOrderField _field; - GReactionOrderField get field => _$this._field; - set field(GReactionOrderField field) => _$this._field = field; + GReactionOrderField? _field; + GReactionOrderField? get field => _$this._field; + set field(GReactionOrderField? field) => _$this._field = field; GReactionOrderBuilder(); GReactionOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -26094,21 +26438,23 @@ class GReactionOrderBuilder @override void replace(GReactionOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReactionOrder; } @override - void update(void Function(GReactionOrderBuilder) updates) { + void update(void Function(GReactionOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GReactionOrder build() { - final _$result = - _$v ?? new _$GReactionOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GReactionOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GReactionOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GReactionOrder', 'field')); replace(_$result); return _$result; } @@ -26120,16 +26466,12 @@ class _$GRefOrder extends GRefOrder { @override final GRefOrderField field; - factory _$GRefOrder([void Function(GRefOrderBuilder) updates]) => + factory _$GRefOrder([void Function(GRefOrderBuilder)? updates]) => (new GRefOrderBuilder()..update(updates)).build(); - _$GRefOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GRefOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GRefOrder', 'field'); - } + _$GRefOrder._({required this.direction, required this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull(direction, 'GRefOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GRefOrder', 'field'); } @override @@ -26162,22 +26504,23 @@ class _$GRefOrder extends GRefOrder { } class GRefOrderBuilder implements Builder { - _$GRefOrder _$v; + _$GRefOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GRefOrderField _field; - GRefOrderField get field => _$this._field; - set field(GRefOrderField field) => _$this._field = field; + GRefOrderField? _field; + GRefOrderField? get field => _$this._field; + set field(GRefOrderField? field) => _$this._field = field; GRefOrderBuilder(); GRefOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -26185,21 +26528,23 @@ class GRefOrderBuilder implements Builder { @override void replace(GRefOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRefOrder; } @override - void update(void Function(GRefOrderBuilder) updates) { + void update(void Function(GRefOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GRefOrder build() { - final _$result = - _$v ?? new _$GRefOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GRefOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GRefOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GRefOrder', 'field')); replace(_$result); return _$result; } @@ -26208,26 +26553,25 @@ class GRefOrderBuilder implements Builder { class _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput extends GRegenerateEnterpriseIdentityProviderRecoveryCodesInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; factory _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput( [void Function( - GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder) + GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder)? updates]) => (new GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder() ..update(updates)) .build(); _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput._( - {this.clientMutationId, this.enterpriseId}) + {this.clientMutationId, required this.enterpriseId}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GRegenerateEnterpriseIdentityProviderRecoveryCodesInput', - 'enterpriseId'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GRegenerateEnterpriseIdentityProviderRecoveryCodesInput', + 'enterpriseId'); } @override @@ -26269,23 +26613,24 @@ class GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder implements Builder { - _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput _$v; + _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder(); GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; _$v = null; } return this; @@ -26293,16 +26638,14 @@ class GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder @override void replace(GRegenerateEnterpriseIdentityProviderRecoveryCodesInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput; } @override void update( void Function( - GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder) + GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder)? updates) { if (updates != null) updates(this); } @@ -26311,7 +26654,11 @@ class GRegenerateEnterpriseIdentityProviderRecoveryCodesInputBuilder _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput build() { final _$result = _$v ?? new _$GRegenerateEnterpriseIdentityProviderRecoveryCodesInput._( - clientMutationId: clientMutationId, enterpriseId: enterpriseId); + clientMutationId: clientMutationId, + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GRegenerateEnterpriseIdentityProviderRecoveryCodesInput', + 'enterpriseId')); replace(_$result); return _$result; } @@ -26321,22 +26668,21 @@ class _$GRegistryPackageMetadatum extends GRegistryPackageMetadatum { @override final String name; @override - final bool update; + final bool? update; @override final String value; factory _$GRegistryPackageMetadatum( - [void Function(GRegistryPackageMetadatumBuilder) updates]) => + [void Function(GRegistryPackageMetadatumBuilder)? updates]) => (new GRegistryPackageMetadatumBuilder()..update(updates)).build(); - _$GRegistryPackageMetadatum._({this.name, this.update, this.value}) + _$GRegistryPackageMetadatum._( + {required this.name, this.update, required this.value}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GRegistryPackageMetadatum', 'name'); - } - if (value == null) { - throw new BuiltValueNullFieldError('GRegistryPackageMetadatum', 'value'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GRegistryPackageMetadatum', 'name'); + BuiltValueNullFieldError.checkNotNull( + value, 'GRegistryPackageMetadatum', 'value'); } @override @@ -26376,27 +26722,28 @@ class _$GRegistryPackageMetadatum extends GRegistryPackageMetadatum { class GRegistryPackageMetadatumBuilder implements Builder { - _$GRegistryPackageMetadatum _$v; + _$GRegistryPackageMetadatum? _$v; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - bool _update; - bool get update => _$this._update; - set update(bool update) => _$this._update = update; + bool? _update; + bool? get update => _$this._update; + set update(bool? update) => _$this._update = update; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GRegistryPackageMetadatumBuilder(); GRegistryPackageMetadatumBuilder get _$this { - if (_$v != null) { - _name = _$v.name; - _update = _$v.update; - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _name = $v.name; + _update = $v.update; + _value = $v.value; _$v = null; } return this; @@ -26404,14 +26751,12 @@ class GRegistryPackageMetadatumBuilder @override void replace(GRegistryPackageMetadatum other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRegistryPackageMetadatum; } @override - void update(void Function(GRegistryPackageMetadatumBuilder) updates) { + void update(void Function(GRegistryPackageMetadatumBuilder)? updates) { if (updates != null) updates(this); } @@ -26419,7 +26764,11 @@ class GRegistryPackageMetadatumBuilder _$GRegistryPackageMetadatum build() { final _$result = _$v ?? new _$GRegistryPackageMetadatum._( - name: name, update: update, value: value); + name: BuiltValueNullFieldError.checkNotNull( + name, 'GRegistryPackageMetadatum', 'name'), + update: update, + value: BuiltValueNullFieldError.checkNotNull( + value, 'GRegistryPackageMetadatum', 'value')); replace(_$result); return _$result; } @@ -26431,16 +26780,14 @@ class _$GReleaseOrder extends GReleaseOrder { @override final GReleaseOrderField field; - factory _$GReleaseOrder([void Function(GReleaseOrderBuilder) updates]) => + factory _$GReleaseOrder([void Function(GReleaseOrderBuilder)? updates]) => (new GReleaseOrderBuilder()..update(updates)).build(); - _$GReleaseOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GReleaseOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GReleaseOrder', 'field'); - } + _$GReleaseOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GReleaseOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GReleaseOrder', 'field'); } @override @@ -26474,22 +26821,23 @@ class _$GReleaseOrder extends GReleaseOrder { class GReleaseOrderBuilder implements Builder { - _$GReleaseOrder _$v; + _$GReleaseOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GReleaseOrderField _field; - GReleaseOrderField get field => _$this._field; - set field(GReleaseOrderField field) => _$this._field = field; + GReleaseOrderField? _field; + GReleaseOrderField? get field => _$this._field; + set field(GReleaseOrderField? field) => _$this._field = field; GReleaseOrderBuilder(); GReleaseOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -26497,21 +26845,23 @@ class GReleaseOrderBuilder @override void replace(GReleaseOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReleaseOrder; } @override - void update(void Function(GReleaseOrderBuilder) updates) { + void update(void Function(GReleaseOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GReleaseOrder build() { - final _$result = - _$v ?? new _$GReleaseOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GReleaseOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GReleaseOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GReleaseOrder', 'field')); replace(_$result); return _$result; } @@ -26524,25 +26874,23 @@ class _$GRemoveAssigneesFromAssignableInput @override final BuiltList assigneeIds; @override - final String clientMutationId; + final String? clientMutationId; factory _$GRemoveAssigneesFromAssignableInput( - [void Function(GRemoveAssigneesFromAssignableInputBuilder) + [void Function(GRemoveAssigneesFromAssignableInputBuilder)? updates]) => (new GRemoveAssigneesFromAssignableInputBuilder()..update(updates)) .build(); _$GRemoveAssigneesFromAssignableInput._( - {this.assignableId, this.assigneeIds, this.clientMutationId}) + {required this.assignableId, + required this.assigneeIds, + this.clientMutationId}) : super._() { - if (assignableId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveAssigneesFromAssignableInput', 'assignableId'); - } - if (assigneeIds == null) { - throw new BuiltValueNullFieldError( - 'GRemoveAssigneesFromAssignableInput', 'assigneeIds'); - } + BuiltValueNullFieldError.checkNotNull( + assignableId, 'GRemoveAssigneesFromAssignableInput', 'assignableId'); + BuiltValueNullFieldError.checkNotNull( + assigneeIds, 'GRemoveAssigneesFromAssignableInput', 'assigneeIds'); } @override @@ -26583,30 +26931,31 @@ class GRemoveAssigneesFromAssignableInputBuilder implements Builder { - _$GRemoveAssigneesFromAssignableInput _$v; + _$GRemoveAssigneesFromAssignableInput? _$v; - String _assignableId; - String get assignableId => _$this._assignableId; - set assignableId(String assignableId) => _$this._assignableId = assignableId; + String? _assignableId; + String? get assignableId => _$this._assignableId; + set assignableId(String? assignableId) => _$this._assignableId = assignableId; - ListBuilder _assigneeIds; + ListBuilder? _assigneeIds; ListBuilder get assigneeIds => _$this._assigneeIds ??= new ListBuilder(); - set assigneeIds(ListBuilder assigneeIds) => + set assigneeIds(ListBuilder? assigneeIds) => _$this._assigneeIds = assigneeIds; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; GRemoveAssigneesFromAssignableInputBuilder(); GRemoveAssigneesFromAssignableInputBuilder get _$this { - if (_$v != null) { - _assignableId = _$v.assignableId; - _assigneeIds = _$v.assigneeIds?.toBuilder(); - _clientMutationId = _$v.clientMutationId; + final $v = _$v; + if ($v != null) { + _assignableId = $v.assignableId; + _assigneeIds = $v.assigneeIds.toBuilder(); + _clientMutationId = $v.clientMutationId; _$v = null; } return this; @@ -26614,15 +26963,13 @@ class GRemoveAssigneesFromAssignableInputBuilder @override void replace(GRemoveAssigneesFromAssignableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveAssigneesFromAssignableInput; } @override void update( - void Function(GRemoveAssigneesFromAssignableInputBuilder) updates) { + void Function(GRemoveAssigneesFromAssignableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -26632,11 +26979,12 @@ class GRemoveAssigneesFromAssignableInputBuilder try { _$result = _$v ?? new _$GRemoveAssigneesFromAssignableInput._( - assignableId: assignableId, + assignableId: BuiltValueNullFieldError.checkNotNull(assignableId, + 'GRemoveAssigneesFromAssignableInput', 'assignableId'), assigneeIds: assigneeIds.build(), clientMutationId: clientMutationId); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'assigneeIds'; assigneeIds.build(); @@ -26653,27 +27001,23 @@ class GRemoveAssigneesFromAssignableInputBuilder class _$GRemoveEnterpriseAdminInput extends GRemoveEnterpriseAdminInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override final String login; factory _$GRemoveEnterpriseAdminInput( - [void Function(GRemoveEnterpriseAdminInputBuilder) updates]) => + [void Function(GRemoveEnterpriseAdminInputBuilder)? updates]) => (new GRemoveEnterpriseAdminInputBuilder()..update(updates)).build(); _$GRemoveEnterpriseAdminInput._( - {this.clientMutationId, this.enterpriseId, this.login}) + {this.clientMutationId, required this.enterpriseId, required this.login}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveEnterpriseAdminInput', 'enterpriseId'); - } - if (login == null) { - throw new BuiltValueNullFieldError( - 'GRemoveEnterpriseAdminInput', 'login'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GRemoveEnterpriseAdminInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + login, 'GRemoveEnterpriseAdminInput', 'login'); } @override @@ -26715,28 +27059,29 @@ class GRemoveEnterpriseAdminInputBuilder implements Builder { - _$GRemoveEnterpriseAdminInput _$v; + _$GRemoveEnterpriseAdminInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - String _login; - String get login => _$this._login; - set login(String login) => _$this._login = login; + String? _login; + String? get login => _$this._login; + set login(String? login) => _$this._login = login; GRemoveEnterpriseAdminInputBuilder(); GRemoveEnterpriseAdminInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _login = _$v.login; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _login = $v.login; _$v = null; } return this; @@ -26744,14 +27089,12 @@ class GRemoveEnterpriseAdminInputBuilder @override void replace(GRemoveEnterpriseAdminInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveEnterpriseAdminInput; } @override - void update(void Function(GRemoveEnterpriseAdminInputBuilder) updates) { + void update(void Function(GRemoveEnterpriseAdminInputBuilder)? updates) { if (updates != null) updates(this); } @@ -26760,8 +27103,10 @@ class GRemoveEnterpriseAdminInputBuilder final _$result = _$v ?? new _$GRemoveEnterpriseAdminInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - login: login); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GRemoveEnterpriseAdminInput', 'enterpriseId'), + login: BuiltValueNullFieldError.checkNotNull( + login, 'GRemoveEnterpriseAdminInput', 'login')); replace(_$result); return _$result; } @@ -26770,28 +27115,27 @@ class GRemoveEnterpriseAdminInputBuilder class _$GRemoveEnterpriseOrganizationInput extends GRemoveEnterpriseOrganizationInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override final String organizationId; factory _$GRemoveEnterpriseOrganizationInput( - [void Function(GRemoveEnterpriseOrganizationInputBuilder) updates]) => + [void Function(GRemoveEnterpriseOrganizationInputBuilder)? + updates]) => (new GRemoveEnterpriseOrganizationInputBuilder()..update(updates)) .build(); _$GRemoveEnterpriseOrganizationInput._( - {this.clientMutationId, this.enterpriseId, this.organizationId}) + {this.clientMutationId, + required this.enterpriseId, + required this.organizationId}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveEnterpriseOrganizationInput', 'enterpriseId'); - } - if (organizationId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveEnterpriseOrganizationInput', 'organizationId'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GRemoveEnterpriseOrganizationInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + organizationId, 'GRemoveEnterpriseOrganizationInput', 'organizationId'); } @override @@ -26833,29 +27177,30 @@ class GRemoveEnterpriseOrganizationInputBuilder implements Builder { - _$GRemoveEnterpriseOrganizationInput _$v; + _$GRemoveEnterpriseOrganizationInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - String _organizationId; - String get organizationId => _$this._organizationId; - set organizationId(String organizationId) => + String? _organizationId; + String? get organizationId => _$this._organizationId; + set organizationId(String? organizationId) => _$this._organizationId = organizationId; GRemoveEnterpriseOrganizationInputBuilder(); GRemoveEnterpriseOrganizationInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _organizationId = _$v.organizationId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _organizationId = $v.organizationId; _$v = null; } return this; @@ -26863,15 +27208,13 @@ class GRemoveEnterpriseOrganizationInputBuilder @override void replace(GRemoveEnterpriseOrganizationInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveEnterpriseOrganizationInput; } @override void update( - void Function(GRemoveEnterpriseOrganizationInputBuilder) updates) { + void Function(GRemoveEnterpriseOrganizationInputBuilder)? updates) { if (updates != null) updates(this); } @@ -26880,8 +27223,12 @@ class GRemoveEnterpriseOrganizationInputBuilder final _$result = _$v ?? new _$GRemoveEnterpriseOrganizationInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - organizationId: organizationId); + enterpriseId: BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GRemoveEnterpriseOrganizationInput', 'enterpriseId'), + organizationId: BuiltValueNullFieldError.checkNotNull( + organizationId, + 'GRemoveEnterpriseOrganizationInput', + 'organizationId')); replace(_$result); return _$result; } @@ -26890,27 +27237,25 @@ class GRemoveEnterpriseOrganizationInputBuilder class _$GRemoveLabelsFromLabelableInput extends GRemoveLabelsFromLabelableInput { @override - final String clientMutationId; + final String? clientMutationId; @override final BuiltList labelIds; @override final String labelableId; factory _$GRemoveLabelsFromLabelableInput( - [void Function(GRemoveLabelsFromLabelableInputBuilder) updates]) => + [void Function(GRemoveLabelsFromLabelableInputBuilder)? updates]) => (new GRemoveLabelsFromLabelableInputBuilder()..update(updates)).build(); _$GRemoveLabelsFromLabelableInput._( - {this.clientMutationId, this.labelIds, this.labelableId}) + {this.clientMutationId, + required this.labelIds, + required this.labelableId}) : super._() { - if (labelIds == null) { - throw new BuiltValueNullFieldError( - 'GRemoveLabelsFromLabelableInput', 'labelIds'); - } - if (labelableId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveLabelsFromLabelableInput', 'labelableId'); - } + BuiltValueNullFieldError.checkNotNull( + labelIds, 'GRemoveLabelsFromLabelableInput', 'labelIds'); + BuiltValueNullFieldError.checkNotNull( + labelableId, 'GRemoveLabelsFromLabelableInput', 'labelableId'); } @override @@ -26951,29 +27296,30 @@ class GRemoveLabelsFromLabelableInputBuilder implements Builder { - _$GRemoveLabelsFromLabelableInput _$v; + _$GRemoveLabelsFromLabelableInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - ListBuilder _labelIds; + ListBuilder? _labelIds; ListBuilder get labelIds => _$this._labelIds ??= new ListBuilder(); - set labelIds(ListBuilder labelIds) => _$this._labelIds = labelIds; + set labelIds(ListBuilder? labelIds) => _$this._labelIds = labelIds; - String _labelableId; - String get labelableId => _$this._labelableId; - set labelableId(String labelableId) => _$this._labelableId = labelableId; + String? _labelableId; + String? get labelableId => _$this._labelableId; + set labelableId(String? labelableId) => _$this._labelableId = labelableId; GRemoveLabelsFromLabelableInputBuilder(); GRemoveLabelsFromLabelableInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _labelIds = _$v.labelIds?.toBuilder(); - _labelableId = _$v.labelableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _labelIds = $v.labelIds.toBuilder(); + _labelableId = $v.labelableId; _$v = null; } return this; @@ -26981,14 +27327,12 @@ class GRemoveLabelsFromLabelableInputBuilder @override void replace(GRemoveLabelsFromLabelableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveLabelsFromLabelableInput; } @override - void update(void Function(GRemoveLabelsFromLabelableInputBuilder) updates) { + void update(void Function(GRemoveLabelsFromLabelableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27000,9 +27344,10 @@ class GRemoveLabelsFromLabelableInputBuilder new _$GRemoveLabelsFromLabelableInput._( clientMutationId: clientMutationId, labelIds: labelIds.build(), - labelableId: labelableId); + labelableId: BuiltValueNullFieldError.checkNotNull(labelableId, + 'GRemoveLabelsFromLabelableInput', 'labelableId')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'labelIds'; labelIds.build(); @@ -27020,27 +27365,25 @@ class GRemoveLabelsFromLabelableInputBuilder class _$GRemoveOutsideCollaboratorInput extends GRemoveOutsideCollaboratorInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String organizationId; @override final String userId; factory _$GRemoveOutsideCollaboratorInput( - [void Function(GRemoveOutsideCollaboratorInputBuilder) updates]) => + [void Function(GRemoveOutsideCollaboratorInputBuilder)? updates]) => (new GRemoveOutsideCollaboratorInputBuilder()..update(updates)).build(); _$GRemoveOutsideCollaboratorInput._( - {this.clientMutationId, this.organizationId, this.userId}) + {this.clientMutationId, + required this.organizationId, + required this.userId}) : super._() { - if (organizationId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveOutsideCollaboratorInput', 'organizationId'); - } - if (userId == null) { - throw new BuiltValueNullFieldError( - 'GRemoveOutsideCollaboratorInput', 'userId'); - } + BuiltValueNullFieldError.checkNotNull( + organizationId, 'GRemoveOutsideCollaboratorInput', 'organizationId'); + BuiltValueNullFieldError.checkNotNull( + userId, 'GRemoveOutsideCollaboratorInput', 'userId'); } @override @@ -27082,29 +27425,30 @@ class GRemoveOutsideCollaboratorInputBuilder implements Builder { - _$GRemoveOutsideCollaboratorInput _$v; + _$GRemoveOutsideCollaboratorInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _organizationId; - String get organizationId => _$this._organizationId; - set organizationId(String organizationId) => + String? _organizationId; + String? get organizationId => _$this._organizationId; + set organizationId(String? organizationId) => _$this._organizationId = organizationId; - String _userId; - String get userId => _$this._userId; - set userId(String userId) => _$this._userId = userId; + String? _userId; + String? get userId => _$this._userId; + set userId(String? userId) => _$this._userId = userId; GRemoveOutsideCollaboratorInputBuilder(); GRemoveOutsideCollaboratorInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _organizationId = _$v.organizationId; - _userId = _$v.userId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _organizationId = $v.organizationId; + _userId = $v.userId; _$v = null; } return this; @@ -27112,14 +27456,12 @@ class GRemoveOutsideCollaboratorInputBuilder @override void replace(GRemoveOutsideCollaboratorInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveOutsideCollaboratorInput; } @override - void update(void Function(GRemoveOutsideCollaboratorInputBuilder) updates) { + void update(void Function(GRemoveOutsideCollaboratorInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27128,8 +27470,12 @@ class GRemoveOutsideCollaboratorInputBuilder final _$result = _$v ?? new _$GRemoveOutsideCollaboratorInput._( clientMutationId: clientMutationId, - organizationId: organizationId, - userId: userId); + organizationId: BuiltValueNullFieldError.checkNotNull( + organizationId, + 'GRemoveOutsideCollaboratorInput', + 'organizationId'), + userId: BuiltValueNullFieldError.checkNotNull( + userId, 'GRemoveOutsideCollaboratorInput', 'userId')); replace(_$result); return _$result; } @@ -27137,25 +27483,23 @@ class GRemoveOutsideCollaboratorInputBuilder class _$GRemoveReactionInput extends GRemoveReactionInput { @override - final String clientMutationId; + final String? clientMutationId; @override final GReactionContent content; @override final String subjectId; factory _$GRemoveReactionInput( - [void Function(GRemoveReactionInputBuilder) updates]) => + [void Function(GRemoveReactionInputBuilder)? updates]) => (new GRemoveReactionInputBuilder()..update(updates)).build(); _$GRemoveReactionInput._( - {this.clientMutationId, this.content, this.subjectId}) + {this.clientMutationId, required this.content, required this.subjectId}) : super._() { - if (content == null) { - throw new BuiltValueNullFieldError('GRemoveReactionInput', 'content'); - } - if (subjectId == null) { - throw new BuiltValueNullFieldError('GRemoveReactionInput', 'subjectId'); - } + BuiltValueNullFieldError.checkNotNull( + content, 'GRemoveReactionInput', 'content'); + BuiltValueNullFieldError.checkNotNull( + subjectId, 'GRemoveReactionInput', 'subjectId'); } @override @@ -27194,28 +27538,29 @@ class _$GRemoveReactionInput extends GRemoveReactionInput { class GRemoveReactionInputBuilder implements Builder { - _$GRemoveReactionInput _$v; + _$GRemoveReactionInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - GReactionContent _content; - GReactionContent get content => _$this._content; - set content(GReactionContent content) => _$this._content = content; + GReactionContent? _content; + GReactionContent? get content => _$this._content; + set content(GReactionContent? content) => _$this._content = content; - String _subjectId; - String get subjectId => _$this._subjectId; - set subjectId(String subjectId) => _$this._subjectId = subjectId; + String? _subjectId; + String? get subjectId => _$this._subjectId; + set subjectId(String? subjectId) => _$this._subjectId = subjectId; GRemoveReactionInputBuilder(); GRemoveReactionInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _content = _$v.content; - _subjectId = _$v.subjectId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _content = $v.content; + _subjectId = $v.subjectId; _$v = null; } return this; @@ -27223,14 +27568,12 @@ class GRemoveReactionInputBuilder @override void replace(GRemoveReactionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveReactionInput; } @override - void update(void Function(GRemoveReactionInputBuilder) updates) { + void update(void Function(GRemoveReactionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27239,8 +27582,10 @@ class GRemoveReactionInputBuilder final _$result = _$v ?? new _$GRemoveReactionInput._( clientMutationId: clientMutationId, - content: content, - subjectId: subjectId); + content: BuiltValueNullFieldError.checkNotNull( + content, 'GRemoveReactionInput', 'content'), + subjectId: BuiltValueNullFieldError.checkNotNull( + subjectId, 'GRemoveReactionInput', 'subjectId')); replace(_$result); return _$result; } @@ -27248,18 +27593,18 @@ class GRemoveReactionInputBuilder class _$GRemoveStarInput extends GRemoveStarInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String starrableId; factory _$GRemoveStarInput( - [void Function(GRemoveStarInputBuilder) updates]) => + [void Function(GRemoveStarInputBuilder)? updates]) => (new GRemoveStarInputBuilder()..update(updates)).build(); - _$GRemoveStarInput._({this.clientMutationId, this.starrableId}) : super._() { - if (starrableId == null) { - throw new BuiltValueNullFieldError('GRemoveStarInput', 'starrableId'); - } + _$GRemoveStarInput._({this.clientMutationId, required this.starrableId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + starrableId, 'GRemoveStarInput', 'starrableId'); } @override @@ -27294,23 +27639,24 @@ class _$GRemoveStarInput extends GRemoveStarInput { class GRemoveStarInputBuilder implements Builder { - _$GRemoveStarInput _$v; + _$GRemoveStarInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _starrableId; - String get starrableId => _$this._starrableId; - set starrableId(String starrableId) => _$this._starrableId = starrableId; + String? _starrableId; + String? get starrableId => _$this._starrableId; + set starrableId(String? starrableId) => _$this._starrableId = starrableId; GRemoveStarInputBuilder(); GRemoveStarInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _starrableId = _$v.starrableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _starrableId = $v.starrableId; _$v = null; } return this; @@ -27318,14 +27664,12 @@ class GRemoveStarInputBuilder @override void replace(GRemoveStarInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRemoveStarInput; } @override - void update(void Function(GRemoveStarInputBuilder) updates) { + void update(void Function(GRemoveStarInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27333,7 +27677,9 @@ class GRemoveStarInputBuilder _$GRemoveStarInput build() { final _$result = _$v ?? new _$GRemoveStarInput._( - clientMutationId: clientMutationId, starrableId: starrableId); + clientMutationId: clientMutationId, + starrableId: BuiltValueNullFieldError.checkNotNull( + starrableId, 'GRemoveStarInput', 'starrableId')); replace(_$result); return _$result; } @@ -27341,18 +27687,18 @@ class GRemoveStarInputBuilder class _$GReopenIssueInput extends GReopenIssueInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String issueId; factory _$GReopenIssueInput( - [void Function(GReopenIssueInputBuilder) updates]) => + [void Function(GReopenIssueInputBuilder)? updates]) => (new GReopenIssueInputBuilder()..update(updates)).build(); - _$GReopenIssueInput._({this.clientMutationId, this.issueId}) : super._() { - if (issueId == null) { - throw new BuiltValueNullFieldError('GReopenIssueInput', 'issueId'); - } + _$GReopenIssueInput._({this.clientMutationId, required this.issueId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + issueId, 'GReopenIssueInput', 'issueId'); } @override @@ -27387,23 +27733,24 @@ class _$GReopenIssueInput extends GReopenIssueInput { class GReopenIssueInputBuilder implements Builder { - _$GReopenIssueInput _$v; + _$GReopenIssueInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _issueId; - String get issueId => _$this._issueId; - set issueId(String issueId) => _$this._issueId = issueId; + String? _issueId; + String? get issueId => _$this._issueId; + set issueId(String? issueId) => _$this._issueId = issueId; GReopenIssueInputBuilder(); GReopenIssueInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _issueId = _$v.issueId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _issueId = $v.issueId; _$v = null; } return this; @@ -27411,14 +27758,12 @@ class GReopenIssueInputBuilder @override void replace(GReopenIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReopenIssueInput; } @override - void update(void Function(GReopenIssueInputBuilder) updates) { + void update(void Function(GReopenIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27426,7 +27771,9 @@ class GReopenIssueInputBuilder _$GReopenIssueInput build() { final _$result = _$v ?? new _$GReopenIssueInput._( - clientMutationId: clientMutationId, issueId: issueId); + clientMutationId: clientMutationId, + issueId: BuiltValueNullFieldError.checkNotNull( + issueId, 'GReopenIssueInput', 'issueId')); replace(_$result); return _$result; } @@ -27434,20 +27781,19 @@ class GReopenIssueInputBuilder class _$GReopenPullRequestInput extends GReopenPullRequestInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String pullRequestId; factory _$GReopenPullRequestInput( - [void Function(GReopenPullRequestInputBuilder) updates]) => + [void Function(GReopenPullRequestInputBuilder)? updates]) => (new GReopenPullRequestInputBuilder()..update(updates)).build(); - _$GReopenPullRequestInput._({this.clientMutationId, this.pullRequestId}) + _$GReopenPullRequestInput._( + {this.clientMutationId, required this.pullRequestId}) : super._() { - if (pullRequestId == null) { - throw new BuiltValueNullFieldError( - 'GReopenPullRequestInput', 'pullRequestId'); - } + BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GReopenPullRequestInput', 'pullRequestId'); } @override @@ -27484,24 +27830,25 @@ class _$GReopenPullRequestInput extends GReopenPullRequestInput { class GReopenPullRequestInputBuilder implements Builder { - _$GReopenPullRequestInput _$v; + _$GReopenPullRequestInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; GReopenPullRequestInputBuilder(); GReopenPullRequestInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _pullRequestId = _$v.pullRequestId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _pullRequestId = $v.pullRequestId; _$v = null; } return this; @@ -27509,14 +27856,12 @@ class GReopenPullRequestInputBuilder @override void replace(GReopenPullRequestInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GReopenPullRequestInput; } @override - void update(void Function(GReopenPullRequestInputBuilder) updates) { + void update(void Function(GReopenPullRequestInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27524,7 +27869,9 @@ class GReopenPullRequestInputBuilder _$GReopenPullRequestInput build() { final _$result = _$v ?? new _$GReopenPullRequestInput._( - clientMutationId: clientMutationId, pullRequestId: pullRequestId); + clientMutationId: clientMutationId, + pullRequestId: BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GReopenPullRequestInput', 'pullRequestId')); replace(_$result); return _$result; } @@ -27537,17 +27884,15 @@ class _$GRepositoryInvitationOrder extends GRepositoryInvitationOrder { final GRepositoryInvitationOrderField field; factory _$GRepositoryInvitationOrder( - [void Function(GRepositoryInvitationOrderBuilder) updates]) => + [void Function(GRepositoryInvitationOrderBuilder)? updates]) => (new GRepositoryInvitationOrderBuilder()..update(updates)).build(); - _$GRepositoryInvitationOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GRepositoryInvitationOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GRepositoryInvitationOrder', 'field'); - } + _$GRepositoryInvitationOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GRepositoryInvitationOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GRepositoryInvitationOrder', 'field'); } @override @@ -27584,22 +27929,23 @@ class _$GRepositoryInvitationOrder extends GRepositoryInvitationOrder { class GRepositoryInvitationOrderBuilder implements Builder { - _$GRepositoryInvitationOrder _$v; + _$GRepositoryInvitationOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GRepositoryInvitationOrderField _field; - GRepositoryInvitationOrderField get field => _$this._field; - set field(GRepositoryInvitationOrderField field) => _$this._field = field; + GRepositoryInvitationOrderField? _field; + GRepositoryInvitationOrderField? get field => _$this._field; + set field(GRepositoryInvitationOrderField? field) => _$this._field = field; GRepositoryInvitationOrderBuilder(); GRepositoryInvitationOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -27607,21 +27953,23 @@ class GRepositoryInvitationOrderBuilder @override void replace(GRepositoryInvitationOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRepositoryInvitationOrder; } @override - void update(void Function(GRepositoryInvitationOrderBuilder) updates) { + void update(void Function(GRepositoryInvitationOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GRepositoryInvitationOrder build() { final _$result = _$v ?? - new _$GRepositoryInvitationOrder._(direction: direction, field: field); + new _$GRepositoryInvitationOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GRepositoryInvitationOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GRepositoryInvitationOrder', 'field')); replace(_$result); return _$result; } @@ -27634,16 +27982,14 @@ class _$GRepositoryOrder extends GRepositoryOrder { final GRepositoryOrderField field; factory _$GRepositoryOrder( - [void Function(GRepositoryOrderBuilder) updates]) => + [void Function(GRepositoryOrderBuilder)? updates]) => (new GRepositoryOrderBuilder()..update(updates)).build(); - _$GRepositoryOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GRepositoryOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GRepositoryOrder', 'field'); - } + _$GRepositoryOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GRepositoryOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GRepositoryOrder', 'field'); } @override @@ -27678,22 +28024,23 @@ class _$GRepositoryOrder extends GRepositoryOrder { class GRepositoryOrderBuilder implements Builder { - _$GRepositoryOrder _$v; + _$GRepositoryOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GRepositoryOrderField _field; - GRepositoryOrderField get field => _$this._field; - set field(GRepositoryOrderField field) => _$this._field = field; + GRepositoryOrderField? _field; + GRepositoryOrderField? get field => _$this._field; + set field(GRepositoryOrderField? field) => _$this._field = field; GRepositoryOrderBuilder(); GRepositoryOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -27701,21 +28048,23 @@ class GRepositoryOrderBuilder @override void replace(GRepositoryOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRepositoryOrder; } @override - void update(void Function(GRepositoryOrderBuilder) updates) { + void update(void Function(GRepositoryOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GRepositoryOrder build() { - final _$result = - _$v ?? new _$GRepositoryOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GRepositoryOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GRepositoryOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GRepositoryOrder', 'field')); replace(_$result); return _$result; } @@ -27723,37 +28072,29 @@ class GRepositoryOrderBuilder class _$GRequestReviewsInput extends GRequestReviewsInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String pullRequestId; @override - final BuiltList teamIds; + final BuiltList? teamIds; @override - final bool union; + final bool? union; @override - final BuiltList userIds; + final BuiltList? userIds; factory _$GRequestReviewsInput( - [void Function(GRequestReviewsInputBuilder) updates]) => + [void Function(GRequestReviewsInputBuilder)? updates]) => (new GRequestReviewsInputBuilder()..update(updates)).build(); _$GRequestReviewsInput._( {this.clientMutationId, - this.pullRequestId, + required this.pullRequestId, this.teamIds, this.union, this.userIds}) : super._() { - if (pullRequestId == null) { - throw new BuiltValueNullFieldError( - 'GRequestReviewsInput', 'pullRequestId'); - } - if (teamIds == null) { - throw new BuiltValueNullFieldError('GRequestReviewsInput', 'teamIds'); - } - if (userIds == null) { - throw new BuiltValueNullFieldError('GRequestReviewsInput', 'userIds'); - } + BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GRequestReviewsInput', 'pullRequestId'); } @override @@ -27800,41 +28141,42 @@ class _$GRequestReviewsInput extends GRequestReviewsInput { class GRequestReviewsInputBuilder implements Builder { - _$GRequestReviewsInput _$v; + _$GRequestReviewsInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; - ListBuilder _teamIds; + ListBuilder? _teamIds; ListBuilder get teamIds => _$this._teamIds ??= new ListBuilder(); - set teamIds(ListBuilder teamIds) => _$this._teamIds = teamIds; + set teamIds(ListBuilder? teamIds) => _$this._teamIds = teamIds; - bool _union; - bool get union => _$this._union; - set union(bool union) => _$this._union = union; + bool? _union; + bool? get union => _$this._union; + set union(bool? union) => _$this._union = union; - ListBuilder _userIds; + ListBuilder? _userIds; ListBuilder get userIds => _$this._userIds ??= new ListBuilder(); - set userIds(ListBuilder userIds) => _$this._userIds = userIds; + set userIds(ListBuilder? userIds) => _$this._userIds = userIds; GRequestReviewsInputBuilder(); GRequestReviewsInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _pullRequestId = _$v.pullRequestId; - _teamIds = _$v.teamIds?.toBuilder(); - _union = _$v.union; - _userIds = _$v.userIds?.toBuilder(); + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _pullRequestId = $v.pullRequestId; + _teamIds = $v.teamIds?.toBuilder(); + _union = $v.union; + _userIds = $v.userIds?.toBuilder(); _$v = null; } return this; @@ -27842,14 +28184,12 @@ class GRequestReviewsInputBuilder @override void replace(GRequestReviewsInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GRequestReviewsInput; } @override - void update(void Function(GRequestReviewsInputBuilder) updates) { + void update(void Function(GRequestReviewsInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27860,18 +28200,19 @@ class GRequestReviewsInputBuilder _$result = _$v ?? new _$GRequestReviewsInput._( clientMutationId: clientMutationId, - pullRequestId: pullRequestId, - teamIds: teamIds.build(), + pullRequestId: BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GRequestReviewsInput', 'pullRequestId'), + teamIds: _teamIds?.build(), union: union, - userIds: userIds.build()); + userIds: _userIds?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'teamIds'; - teamIds.build(); + _teamIds?.build(); _$failedField = 'userIds'; - userIds.build(); + _userIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GRequestReviewsInput', _$failedField, e.toString()); @@ -27885,20 +28226,18 @@ class GRequestReviewsInputBuilder class _$GResolveReviewThreadInput extends GResolveReviewThreadInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String threadId; factory _$GResolveReviewThreadInput( - [void Function(GResolveReviewThreadInputBuilder) updates]) => + [void Function(GResolveReviewThreadInputBuilder)? updates]) => (new GResolveReviewThreadInputBuilder()..update(updates)).build(); - _$GResolveReviewThreadInput._({this.clientMutationId, this.threadId}) + _$GResolveReviewThreadInput._({this.clientMutationId, required this.threadId}) : super._() { - if (threadId == null) { - throw new BuiltValueNullFieldError( - 'GResolveReviewThreadInput', 'threadId'); - } + BuiltValueNullFieldError.checkNotNull( + threadId, 'GResolveReviewThreadInput', 'threadId'); } @override @@ -27935,23 +28274,24 @@ class _$GResolveReviewThreadInput extends GResolveReviewThreadInput { class GResolveReviewThreadInputBuilder implements Builder { - _$GResolveReviewThreadInput _$v; + _$GResolveReviewThreadInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _threadId; - String get threadId => _$this._threadId; - set threadId(String threadId) => _$this._threadId = threadId; + String? _threadId; + String? get threadId => _$this._threadId; + set threadId(String? threadId) => _$this._threadId = threadId; GResolveReviewThreadInputBuilder(); GResolveReviewThreadInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _threadId = _$v.threadId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _threadId = $v.threadId; _$v = null; } return this; @@ -27959,14 +28299,12 @@ class GResolveReviewThreadInputBuilder @override void replace(GResolveReviewThreadInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GResolveReviewThreadInput; } @override - void update(void Function(GResolveReviewThreadInputBuilder) updates) { + void update(void Function(GResolveReviewThreadInputBuilder)? updates) { if (updates != null) updates(this); } @@ -27974,7 +28312,9 @@ class GResolveReviewThreadInputBuilder _$GResolveReviewThreadInput build() { final _$result = _$v ?? new _$GResolveReviewThreadInput._( - clientMutationId: clientMutationId, threadId: threadId); + clientMutationId: clientMutationId, + threadId: BuiltValueNullFieldError.checkNotNull( + threadId, 'GResolveReviewThreadInput', 'threadId')); replace(_$result); return _$result; } @@ -27987,16 +28327,14 @@ class _$GSavedReplyOrder extends GSavedReplyOrder { final GSavedReplyOrderField field; factory _$GSavedReplyOrder( - [void Function(GSavedReplyOrderBuilder) updates]) => + [void Function(GSavedReplyOrderBuilder)? updates]) => (new GSavedReplyOrderBuilder()..update(updates)).build(); - _$GSavedReplyOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GSavedReplyOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GSavedReplyOrder', 'field'); - } + _$GSavedReplyOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GSavedReplyOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GSavedReplyOrder', 'field'); } @override @@ -28031,22 +28369,23 @@ class _$GSavedReplyOrder extends GSavedReplyOrder { class GSavedReplyOrderBuilder implements Builder { - _$GSavedReplyOrder _$v; + _$GSavedReplyOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GSavedReplyOrderField _field; - GSavedReplyOrderField get field => _$this._field; - set field(GSavedReplyOrderField field) => _$this._field = field; + GSavedReplyOrderField? _field; + GSavedReplyOrderField? get field => _$this._field; + set field(GSavedReplyOrderField? field) => _$this._field = field; GSavedReplyOrderBuilder(); GSavedReplyOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28054,21 +28393,23 @@ class GSavedReplyOrderBuilder @override void replace(GSavedReplyOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSavedReplyOrder; } @override - void update(void Function(GSavedReplyOrderBuilder) updates) { + void update(void Function(GSavedReplyOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GSavedReplyOrder build() { - final _$result = - _$v ?? new _$GSavedReplyOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GSavedReplyOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GSavedReplyOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GSavedReplyOrder', 'field')); replace(_$result); return _$result; } @@ -28082,18 +28423,16 @@ class _$GSecurityAdvisoryIdentifierFilter final String value; factory _$GSecurityAdvisoryIdentifierFilter( - [void Function(GSecurityAdvisoryIdentifierFilterBuilder) updates]) => + [void Function(GSecurityAdvisoryIdentifierFilterBuilder)? updates]) => (new GSecurityAdvisoryIdentifierFilterBuilder()..update(updates)).build(); - _$GSecurityAdvisoryIdentifierFilter._({this.type, this.value}) : super._() { - if (type == null) { - throw new BuiltValueNullFieldError( - 'GSecurityAdvisoryIdentifierFilter', 'type'); - } - if (value == null) { - throw new BuiltValueNullFieldError( - 'GSecurityAdvisoryIdentifierFilter', 'value'); - } + _$GSecurityAdvisoryIdentifierFilter._( + {required this.type, required this.value}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + type, 'GSecurityAdvisoryIdentifierFilter', 'type'); + BuiltValueNullFieldError.checkNotNull( + value, 'GSecurityAdvisoryIdentifierFilter', 'value'); } @override @@ -28131,22 +28470,23 @@ class GSecurityAdvisoryIdentifierFilterBuilder implements Builder { - _$GSecurityAdvisoryIdentifierFilter _$v; + _$GSecurityAdvisoryIdentifierFilter? _$v; - GSecurityAdvisoryIdentifierType _type; - GSecurityAdvisoryIdentifierType get type => _$this._type; - set type(GSecurityAdvisoryIdentifierType type) => _$this._type = type; + GSecurityAdvisoryIdentifierType? _type; + GSecurityAdvisoryIdentifierType? get type => _$this._type; + set type(GSecurityAdvisoryIdentifierType? type) => _$this._type = type; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GSecurityAdvisoryIdentifierFilterBuilder(); GSecurityAdvisoryIdentifierFilterBuilder get _$this { - if (_$v != null) { - _type = _$v.type; - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _type = $v.type; + _value = $v.value; _$v = null; } return this; @@ -28154,21 +28494,24 @@ class GSecurityAdvisoryIdentifierFilterBuilder @override void replace(GSecurityAdvisoryIdentifierFilter other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSecurityAdvisoryIdentifierFilter; } @override - void update(void Function(GSecurityAdvisoryIdentifierFilterBuilder) updates) { + void update( + void Function(GSecurityAdvisoryIdentifierFilterBuilder)? updates) { if (updates != null) updates(this); } @override _$GSecurityAdvisoryIdentifierFilter build() { final _$result = _$v ?? - new _$GSecurityAdvisoryIdentifierFilter._(type: type, value: value); + new _$GSecurityAdvisoryIdentifierFilter._( + type: BuiltValueNullFieldError.checkNotNull( + type, 'GSecurityAdvisoryIdentifierFilter', 'type'), + value: BuiltValueNullFieldError.checkNotNull( + value, 'GSecurityAdvisoryIdentifierFilter', 'value')); replace(_$result); return _$result; } @@ -28181,16 +28524,15 @@ class _$GSecurityAdvisoryOrder extends GSecurityAdvisoryOrder { final GSecurityAdvisoryOrderField field; factory _$GSecurityAdvisoryOrder( - [void Function(GSecurityAdvisoryOrderBuilder) updates]) => + [void Function(GSecurityAdvisoryOrderBuilder)? updates]) => (new GSecurityAdvisoryOrderBuilder()..update(updates)).build(); - _$GSecurityAdvisoryOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GSecurityAdvisoryOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GSecurityAdvisoryOrder', 'field'); - } + _$GSecurityAdvisoryOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GSecurityAdvisoryOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GSecurityAdvisoryOrder', 'field'); } @override @@ -28226,22 +28568,23 @@ class _$GSecurityAdvisoryOrder extends GSecurityAdvisoryOrder { class GSecurityAdvisoryOrderBuilder implements Builder { - _$GSecurityAdvisoryOrder _$v; + _$GSecurityAdvisoryOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GSecurityAdvisoryOrderField _field; - GSecurityAdvisoryOrderField get field => _$this._field; - set field(GSecurityAdvisoryOrderField field) => _$this._field = field; + GSecurityAdvisoryOrderField? _field; + GSecurityAdvisoryOrderField? get field => _$this._field; + set field(GSecurityAdvisoryOrderField? field) => _$this._field = field; GSecurityAdvisoryOrderBuilder(); GSecurityAdvisoryOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28249,21 +28592,23 @@ class GSecurityAdvisoryOrderBuilder @override void replace(GSecurityAdvisoryOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSecurityAdvisoryOrder; } @override - void update(void Function(GSecurityAdvisoryOrderBuilder) updates) { + void update(void Function(GSecurityAdvisoryOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GSecurityAdvisoryOrder build() { final _$result = _$v ?? - new _$GSecurityAdvisoryOrder._(direction: direction, field: field); + new _$GSecurityAdvisoryOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GSecurityAdvisoryOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GSecurityAdvisoryOrder', 'field')); replace(_$result); return _$result; } @@ -28276,18 +28621,16 @@ class _$GSecurityVulnerabilityOrder extends GSecurityVulnerabilityOrder { final GSecurityVulnerabilityOrderField field; factory _$GSecurityVulnerabilityOrder( - [void Function(GSecurityVulnerabilityOrderBuilder) updates]) => + [void Function(GSecurityVulnerabilityOrderBuilder)? updates]) => (new GSecurityVulnerabilityOrderBuilder()..update(updates)).build(); - _$GSecurityVulnerabilityOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GSecurityVulnerabilityOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GSecurityVulnerabilityOrder', 'field'); - } + _$GSecurityVulnerabilityOrder._( + {required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GSecurityVulnerabilityOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GSecurityVulnerabilityOrder', 'field'); } @override @@ -28325,22 +28668,23 @@ class GSecurityVulnerabilityOrderBuilder implements Builder { - _$GSecurityVulnerabilityOrder _$v; + _$GSecurityVulnerabilityOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GSecurityVulnerabilityOrderField _field; - GSecurityVulnerabilityOrderField get field => _$this._field; - set field(GSecurityVulnerabilityOrderField field) => _$this._field = field; + GSecurityVulnerabilityOrderField? _field; + GSecurityVulnerabilityOrderField? get field => _$this._field; + set field(GSecurityVulnerabilityOrderField? field) => _$this._field = field; GSecurityVulnerabilityOrderBuilder(); GSecurityVulnerabilityOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28348,21 +28692,23 @@ class GSecurityVulnerabilityOrderBuilder @override void replace(GSecurityVulnerabilityOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSecurityVulnerabilityOrder; } @override - void update(void Function(GSecurityVulnerabilityOrderBuilder) updates) { + void update(void Function(GSecurityVulnerabilityOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GSecurityVulnerabilityOrder build() { final _$result = _$v ?? - new _$GSecurityVulnerabilityOrder._(direction: direction, field: field); + new _$GSecurityVulnerabilityOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GSecurityVulnerabilityOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GSecurityVulnerabilityOrder', 'field')); replace(_$result); return _$result; } @@ -28375,16 +28721,14 @@ class _$GSponsorsTierOrder extends GSponsorsTierOrder { final GSponsorsTierOrderField field; factory _$GSponsorsTierOrder( - [void Function(GSponsorsTierOrderBuilder) updates]) => + [void Function(GSponsorsTierOrderBuilder)? updates]) => (new GSponsorsTierOrderBuilder()..update(updates)).build(); - _$GSponsorsTierOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GSponsorsTierOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GSponsorsTierOrder', 'field'); - } + _$GSponsorsTierOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GSponsorsTierOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GSponsorsTierOrder', 'field'); } @override @@ -28420,22 +28764,23 @@ class _$GSponsorsTierOrder extends GSponsorsTierOrder { class GSponsorsTierOrderBuilder implements Builder { - _$GSponsorsTierOrder _$v; + _$GSponsorsTierOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GSponsorsTierOrderField _field; - GSponsorsTierOrderField get field => _$this._field; - set field(GSponsorsTierOrderField field) => _$this._field = field; + GSponsorsTierOrderField? _field; + GSponsorsTierOrderField? get field => _$this._field; + set field(GSponsorsTierOrderField? field) => _$this._field = field; GSponsorsTierOrderBuilder(); GSponsorsTierOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28443,21 +28788,23 @@ class GSponsorsTierOrderBuilder @override void replace(GSponsorsTierOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSponsorsTierOrder; } @override - void update(void Function(GSponsorsTierOrderBuilder) updates) { + void update(void Function(GSponsorsTierOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GSponsorsTierOrder build() { - final _$result = - _$v ?? new _$GSponsorsTierOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GSponsorsTierOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GSponsorsTierOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GSponsorsTierOrder', 'field')); replace(_$result); return _$result; } @@ -28470,16 +28817,14 @@ class _$GSponsorshipOrder extends GSponsorshipOrder { final GSponsorshipOrderField field; factory _$GSponsorshipOrder( - [void Function(GSponsorshipOrderBuilder) updates]) => + [void Function(GSponsorshipOrderBuilder)? updates]) => (new GSponsorshipOrderBuilder()..update(updates)).build(); - _$GSponsorshipOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GSponsorshipOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GSponsorshipOrder', 'field'); - } + _$GSponsorshipOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GSponsorshipOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GSponsorshipOrder', 'field'); } @override @@ -28514,22 +28859,23 @@ class _$GSponsorshipOrder extends GSponsorshipOrder { class GSponsorshipOrderBuilder implements Builder { - _$GSponsorshipOrder _$v; + _$GSponsorshipOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GSponsorshipOrderField _field; - GSponsorshipOrderField get field => _$this._field; - set field(GSponsorshipOrderField field) => _$this._field = field; + GSponsorshipOrderField? _field; + GSponsorshipOrderField? get field => _$this._field; + set field(GSponsorshipOrderField? field) => _$this._field = field; GSponsorshipOrderBuilder(); GSponsorshipOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28537,21 +28883,23 @@ class GSponsorshipOrderBuilder @override void replace(GSponsorshipOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSponsorshipOrder; } @override - void update(void Function(GSponsorshipOrderBuilder) updates) { + void update(void Function(GSponsorshipOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GSponsorshipOrder build() { - final _$result = - _$v ?? new _$GSponsorshipOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GSponsorshipOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GSponsorshipOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GSponsorshipOrder', 'field')); replace(_$result); return _$result; } @@ -28563,16 +28911,12 @@ class _$GStarOrder extends GStarOrder { @override final GStarOrderField field; - factory _$GStarOrder([void Function(GStarOrderBuilder) updates]) => + factory _$GStarOrder([void Function(GStarOrderBuilder)? updates]) => (new GStarOrderBuilder()..update(updates)).build(); - _$GStarOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GStarOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GStarOrder', 'field'); - } + _$GStarOrder._({required this.direction, required this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull(direction, 'GStarOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GStarOrder', 'field'); } @override @@ -28605,22 +28949,23 @@ class _$GStarOrder extends GStarOrder { } class GStarOrderBuilder implements Builder { - _$GStarOrder _$v; + _$GStarOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GStarOrderField _field; - GStarOrderField get field => _$this._field; - set field(GStarOrderField field) => _$this._field = field; + GStarOrderField? _field; + GStarOrderField? get field => _$this._field; + set field(GStarOrderField? field) => _$this._field = field; GStarOrderBuilder(); GStarOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28628,21 +28973,23 @@ class GStarOrderBuilder implements Builder { @override void replace(GStarOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GStarOrder; } @override - void update(void Function(GStarOrderBuilder) updates) { + void update(void Function(GStarOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GStarOrder build() { - final _$result = - _$v ?? new _$GStarOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GStarOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GStarOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GStarOrder', 'field')); replace(_$result); return _$result; } @@ -28650,31 +28997,29 @@ class GStarOrderBuilder implements Builder { class _$GSubmitPullRequestReviewInput extends GSubmitPullRequestReviewInput { @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override final GPullRequestReviewEvent event; @override - final String pullRequestId; + final String? pullRequestId; @override - final String pullRequestReviewId; + final String? pullRequestReviewId; factory _$GSubmitPullRequestReviewInput( - [void Function(GSubmitPullRequestReviewInputBuilder) updates]) => + [void Function(GSubmitPullRequestReviewInputBuilder)? updates]) => (new GSubmitPullRequestReviewInputBuilder()..update(updates)).build(); _$GSubmitPullRequestReviewInput._( {this.body, this.clientMutationId, - this.event, + required this.event, this.pullRequestId, this.pullRequestReviewId}) : super._() { - if (event == null) { - throw new BuiltValueNullFieldError( - 'GSubmitPullRequestReviewInput', 'event'); - } + BuiltValueNullFieldError.checkNotNull( + event, 'GSubmitPullRequestReviewInput', 'event'); } @override @@ -28723,40 +29068,41 @@ class GSubmitPullRequestReviewInputBuilder implements Builder { - _$GSubmitPullRequestReviewInput _$v; + _$GSubmitPullRequestReviewInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - GPullRequestReviewEvent _event; - GPullRequestReviewEvent get event => _$this._event; - set event(GPullRequestReviewEvent event) => _$this._event = event; + GPullRequestReviewEvent? _event; + GPullRequestReviewEvent? get event => _$this._event; + set event(GPullRequestReviewEvent? event) => _$this._event = event; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; - String _pullRequestReviewId; - String get pullRequestReviewId => _$this._pullRequestReviewId; - set pullRequestReviewId(String pullRequestReviewId) => + String? _pullRequestReviewId; + String? get pullRequestReviewId => _$this._pullRequestReviewId; + set pullRequestReviewId(String? pullRequestReviewId) => _$this._pullRequestReviewId = pullRequestReviewId; GSubmitPullRequestReviewInputBuilder(); GSubmitPullRequestReviewInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _event = _$v.event; - _pullRequestId = _$v.pullRequestId; - _pullRequestReviewId = _$v.pullRequestReviewId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _event = $v.event; + _pullRequestId = $v.pullRequestId; + _pullRequestReviewId = $v.pullRequestReviewId; _$v = null; } return this; @@ -28764,14 +29110,12 @@ class GSubmitPullRequestReviewInputBuilder @override void replace(GSubmitPullRequestReviewInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GSubmitPullRequestReviewInput; } @override - void update(void Function(GSubmitPullRequestReviewInputBuilder) updates) { + void update(void Function(GSubmitPullRequestReviewInputBuilder)? updates) { if (updates != null) updates(this); } @@ -28781,7 +29125,8 @@ class GSubmitPullRequestReviewInputBuilder new _$GSubmitPullRequestReviewInput._( body: body, clientMutationId: clientMutationId, - event: event, + event: BuiltValueNullFieldError.checkNotNull( + event, 'GSubmitPullRequestReviewInput', 'event'), pullRequestId: pullRequestId, pullRequestReviewId: pullRequestReviewId); replace(_$result); @@ -28796,18 +29141,16 @@ class _$GTeamDiscussionCommentOrder extends GTeamDiscussionCommentOrder { final GTeamDiscussionCommentOrderField field; factory _$GTeamDiscussionCommentOrder( - [void Function(GTeamDiscussionCommentOrderBuilder) updates]) => + [void Function(GTeamDiscussionCommentOrderBuilder)? updates]) => (new GTeamDiscussionCommentOrderBuilder()..update(updates)).build(); - _$GTeamDiscussionCommentOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError( - 'GTeamDiscussionCommentOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError( - 'GTeamDiscussionCommentOrder', 'field'); - } + _$GTeamDiscussionCommentOrder._( + {required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamDiscussionCommentOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GTeamDiscussionCommentOrder', 'field'); } @override @@ -28845,22 +29188,23 @@ class GTeamDiscussionCommentOrderBuilder implements Builder { - _$GTeamDiscussionCommentOrder _$v; + _$GTeamDiscussionCommentOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GTeamDiscussionCommentOrderField _field; - GTeamDiscussionCommentOrderField get field => _$this._field; - set field(GTeamDiscussionCommentOrderField field) => _$this._field = field; + GTeamDiscussionCommentOrderField? _field; + GTeamDiscussionCommentOrderField? get field => _$this._field; + set field(GTeamDiscussionCommentOrderField? field) => _$this._field = field; GTeamDiscussionCommentOrderBuilder(); GTeamDiscussionCommentOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28868,21 +29212,23 @@ class GTeamDiscussionCommentOrderBuilder @override void replace(GTeamDiscussionCommentOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GTeamDiscussionCommentOrder; } @override - void update(void Function(GTeamDiscussionCommentOrderBuilder) updates) { + void update(void Function(GTeamDiscussionCommentOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GTeamDiscussionCommentOrder build() { final _$result = _$v ?? - new _$GTeamDiscussionCommentOrder._(direction: direction, field: field); + new _$GTeamDiscussionCommentOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamDiscussionCommentOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GTeamDiscussionCommentOrder', 'field')); replace(_$result); return _$result; } @@ -28895,16 +29241,15 @@ class _$GTeamDiscussionOrder extends GTeamDiscussionOrder { final GTeamDiscussionOrderField field; factory _$GTeamDiscussionOrder( - [void Function(GTeamDiscussionOrderBuilder) updates]) => + [void Function(GTeamDiscussionOrderBuilder)? updates]) => (new GTeamDiscussionOrderBuilder()..update(updates)).build(); - _$GTeamDiscussionOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GTeamDiscussionOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GTeamDiscussionOrder', 'field'); - } + _$GTeamDiscussionOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamDiscussionOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GTeamDiscussionOrder', 'field'); } @override @@ -28940,22 +29285,23 @@ class _$GTeamDiscussionOrder extends GTeamDiscussionOrder { class GTeamDiscussionOrderBuilder implements Builder { - _$GTeamDiscussionOrder _$v; + _$GTeamDiscussionOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GTeamDiscussionOrderField _field; - GTeamDiscussionOrderField get field => _$this._field; - set field(GTeamDiscussionOrderField field) => _$this._field = field; + GTeamDiscussionOrderField? _field; + GTeamDiscussionOrderField? get field => _$this._field; + set field(GTeamDiscussionOrderField? field) => _$this._field = field; GTeamDiscussionOrderBuilder(); GTeamDiscussionOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -28963,21 +29309,23 @@ class GTeamDiscussionOrderBuilder @override void replace(GTeamDiscussionOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GTeamDiscussionOrder; } @override - void update(void Function(GTeamDiscussionOrderBuilder) updates) { + void update(void Function(GTeamDiscussionOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GTeamDiscussionOrder build() { - final _$result = - _$v ?? new _$GTeamDiscussionOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GTeamDiscussionOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamDiscussionOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GTeamDiscussionOrder', 'field')); replace(_$result); return _$result; } @@ -28990,16 +29338,14 @@ class _$GTeamMemberOrder extends GTeamMemberOrder { final GTeamMemberOrderField field; factory _$GTeamMemberOrder( - [void Function(GTeamMemberOrderBuilder) updates]) => + [void Function(GTeamMemberOrderBuilder)? updates]) => (new GTeamMemberOrderBuilder()..update(updates)).build(); - _$GTeamMemberOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GTeamMemberOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GTeamMemberOrder', 'field'); - } + _$GTeamMemberOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamMemberOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GTeamMemberOrder', 'field'); } @override @@ -29034,22 +29380,23 @@ class _$GTeamMemberOrder extends GTeamMemberOrder { class GTeamMemberOrderBuilder implements Builder { - _$GTeamMemberOrder _$v; + _$GTeamMemberOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GTeamMemberOrderField _field; - GTeamMemberOrderField get field => _$this._field; - set field(GTeamMemberOrderField field) => _$this._field = field; + GTeamMemberOrderField? _field; + GTeamMemberOrderField? get field => _$this._field; + set field(GTeamMemberOrderField? field) => _$this._field = field; GTeamMemberOrderBuilder(); GTeamMemberOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -29057,21 +29404,23 @@ class GTeamMemberOrderBuilder @override void replace(GTeamMemberOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GTeamMemberOrder; } @override - void update(void Function(GTeamMemberOrderBuilder) updates) { + void update(void Function(GTeamMemberOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GTeamMemberOrder build() { - final _$result = - _$v ?? new _$GTeamMemberOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GTeamMemberOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamMemberOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GTeamMemberOrder', 'field')); replace(_$result); return _$result; } @@ -29083,16 +29432,12 @@ class _$GTeamOrder extends GTeamOrder { @override final GTeamOrderField field; - factory _$GTeamOrder([void Function(GTeamOrderBuilder) updates]) => + factory _$GTeamOrder([void Function(GTeamOrderBuilder)? updates]) => (new GTeamOrderBuilder()..update(updates)).build(); - _$GTeamOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GTeamOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GTeamOrder', 'field'); - } + _$GTeamOrder._({required this.direction, required this.field}) : super._() { + BuiltValueNullFieldError.checkNotNull(direction, 'GTeamOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GTeamOrder', 'field'); } @override @@ -29125,22 +29470,23 @@ class _$GTeamOrder extends GTeamOrder { } class GTeamOrderBuilder implements Builder { - _$GTeamOrder _$v; + _$GTeamOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GTeamOrderField _field; - GTeamOrderField get field => _$this._field; - set field(GTeamOrderField field) => _$this._field = field; + GTeamOrderField? _field; + GTeamOrderField? get field => _$this._field; + set field(GTeamOrderField? field) => _$this._field = field; GTeamOrderBuilder(); GTeamOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -29148,21 +29494,23 @@ class GTeamOrderBuilder implements Builder { @override void replace(GTeamOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GTeamOrder; } @override - void update(void Function(GTeamOrderBuilder) updates) { + void update(void Function(GTeamOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GTeamOrder build() { - final _$result = - _$v ?? new _$GTeamOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GTeamOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GTeamOrder', 'field')); replace(_$result); return _$result; } @@ -29175,16 +29523,15 @@ class _$GTeamRepositoryOrder extends GTeamRepositoryOrder { final GTeamRepositoryOrderField field; factory _$GTeamRepositoryOrder( - [void Function(GTeamRepositoryOrderBuilder) updates]) => + [void Function(GTeamRepositoryOrderBuilder)? updates]) => (new GTeamRepositoryOrderBuilder()..update(updates)).build(); - _$GTeamRepositoryOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GTeamRepositoryOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GTeamRepositoryOrder', 'field'); - } + _$GTeamRepositoryOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamRepositoryOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull( + field, 'GTeamRepositoryOrder', 'field'); } @override @@ -29220,22 +29567,23 @@ class _$GTeamRepositoryOrder extends GTeamRepositoryOrder { class GTeamRepositoryOrderBuilder implements Builder { - _$GTeamRepositoryOrder _$v; + _$GTeamRepositoryOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GTeamRepositoryOrderField _field; - GTeamRepositoryOrderField get field => _$this._field; - set field(GTeamRepositoryOrderField field) => _$this._field = field; + GTeamRepositoryOrderField? _field; + GTeamRepositoryOrderField? get field => _$this._field; + set field(GTeamRepositoryOrderField? field) => _$this._field = field; GTeamRepositoryOrderBuilder(); GTeamRepositoryOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -29243,21 +29591,23 @@ class GTeamRepositoryOrderBuilder @override void replace(GTeamRepositoryOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GTeamRepositoryOrder; } @override - void update(void Function(GTeamRepositoryOrderBuilder) updates) { + void update(void Function(GTeamRepositoryOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GTeamRepositoryOrder build() { - final _$result = - _$v ?? new _$GTeamRepositoryOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GTeamRepositoryOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GTeamRepositoryOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GTeamRepositoryOrder', 'field')); replace(_$result); return _$result; } @@ -29265,25 +29615,25 @@ class GTeamRepositoryOrderBuilder class _$GTransferIssueInput extends GTransferIssueInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String issueId; @override final String repositoryId; factory _$GTransferIssueInput( - [void Function(GTransferIssueInputBuilder) updates]) => + [void Function(GTransferIssueInputBuilder)? updates]) => (new GTransferIssueInputBuilder()..update(updates)).build(); _$GTransferIssueInput._( - {this.clientMutationId, this.issueId, this.repositoryId}) + {this.clientMutationId, + required this.issueId, + required this.repositoryId}) : super._() { - if (issueId == null) { - throw new BuiltValueNullFieldError('GTransferIssueInput', 'issueId'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError('GTransferIssueInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + issueId, 'GTransferIssueInput', 'issueId'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GTransferIssueInput', 'repositoryId'); } @override @@ -29322,28 +29672,29 @@ class _$GTransferIssueInput extends GTransferIssueInput { class GTransferIssueInputBuilder implements Builder { - _$GTransferIssueInput _$v; + _$GTransferIssueInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _issueId; - String get issueId => _$this._issueId; - set issueId(String issueId) => _$this._issueId = issueId; + String? _issueId; + String? get issueId => _$this._issueId; + set issueId(String? issueId) => _$this._issueId = issueId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GTransferIssueInputBuilder(); GTransferIssueInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _issueId = _$v.issueId; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _issueId = $v.issueId; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -29351,14 +29702,12 @@ class GTransferIssueInputBuilder @override void replace(GTransferIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GTransferIssueInput; } @override - void update(void Function(GTransferIssueInputBuilder) updates) { + void update(void Function(GTransferIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -29367,8 +29716,10 @@ class GTransferIssueInputBuilder final _$result = _$v ?? new _$GTransferIssueInput._( clientMutationId: clientMutationId, - issueId: issueId, - repositoryId: repositoryId); + issueId: BuiltValueNullFieldError.checkNotNull( + issueId, 'GTransferIssueInput', 'issueId'), + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GTransferIssueInput', 'repositoryId')); replace(_$result); return _$result; } @@ -29378,13 +29729,11 @@ class _$GURI extends GURI { @override final String value; - factory _$GURI([void Function(GURIBuilder) updates]) => + factory _$GURI([void Function(GURIBuilder)? updates]) => (new GURIBuilder()..update(updates)).build(); - _$GURI._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GURI', 'value'); - } + _$GURI._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GURI', 'value'); } @override @@ -29413,17 +29762,18 @@ class _$GURI extends GURI { } class GURIBuilder implements Builder { - _$GURI _$v; + _$GURI? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GURIBuilder(); GURIBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -29431,20 +29781,21 @@ class GURIBuilder implements Builder { @override void replace(GURI other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GURI; } @override - void update(void Function(GURIBuilder) updates) { + void update(void Function(GURIBuilder)? updates) { if (updates != null) updates(this); } @override _$GURI build() { - final _$result = _$v ?? new _$GURI._(value: value); + final _$result = _$v ?? + new _$GURI._( + value: + BuiltValueNullFieldError.checkNotNull(value, 'GURI', 'value')); replace(_$result); return _$result; } @@ -29452,20 +29803,19 @@ class GURIBuilder implements Builder { class _$GUnarchiveRepositoryInput extends GUnarchiveRepositoryInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String repositoryId; factory _$GUnarchiveRepositoryInput( - [void Function(GUnarchiveRepositoryInputBuilder) updates]) => + [void Function(GUnarchiveRepositoryInputBuilder)? updates]) => (new GUnarchiveRepositoryInputBuilder()..update(updates)).build(); - _$GUnarchiveRepositoryInput._({this.clientMutationId, this.repositoryId}) + _$GUnarchiveRepositoryInput._( + {this.clientMutationId, required this.repositoryId}) : super._() { - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GUnarchiveRepositoryInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUnarchiveRepositoryInput', 'repositoryId'); } @override @@ -29502,23 +29852,24 @@ class _$GUnarchiveRepositoryInput extends GUnarchiveRepositoryInput { class GUnarchiveRepositoryInputBuilder implements Builder { - _$GUnarchiveRepositoryInput _$v; + _$GUnarchiveRepositoryInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GUnarchiveRepositoryInputBuilder(); GUnarchiveRepositoryInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -29526,14 +29877,12 @@ class GUnarchiveRepositoryInputBuilder @override void replace(GUnarchiveRepositoryInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUnarchiveRepositoryInput; } @override - void update(void Function(GUnarchiveRepositoryInputBuilder) updates) { + void update(void Function(GUnarchiveRepositoryInputBuilder)? updates) { if (updates != null) updates(this); } @@ -29541,7 +29890,9 @@ class GUnarchiveRepositoryInputBuilder _$GUnarchiveRepositoryInput build() { final _$result = _$v ?? new _$GUnarchiveRepositoryInput._( - clientMutationId: clientMutationId, repositoryId: repositoryId); + clientMutationId: clientMutationId, + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUnarchiveRepositoryInput', 'repositoryId')); replace(_$result); return _$result; } @@ -29549,18 +29900,18 @@ class GUnarchiveRepositoryInputBuilder class _$GUnfollowUserInput extends GUnfollowUserInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String userId; factory _$GUnfollowUserInput( - [void Function(GUnfollowUserInputBuilder) updates]) => + [void Function(GUnfollowUserInputBuilder)? updates]) => (new GUnfollowUserInputBuilder()..update(updates)).build(); - _$GUnfollowUserInput._({this.clientMutationId, this.userId}) : super._() { - if (userId == null) { - throw new BuiltValueNullFieldError('GUnfollowUserInput', 'userId'); - } + _$GUnfollowUserInput._({this.clientMutationId, required this.userId}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + userId, 'GUnfollowUserInput', 'userId'); } @override @@ -29596,23 +29947,24 @@ class _$GUnfollowUserInput extends GUnfollowUserInput { class GUnfollowUserInputBuilder implements Builder { - _$GUnfollowUserInput _$v; + _$GUnfollowUserInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _userId; - String get userId => _$this._userId; - set userId(String userId) => _$this._userId = userId; + String? _userId; + String? get userId => _$this._userId; + set userId(String? userId) => _$this._userId = userId; GUnfollowUserInputBuilder(); GUnfollowUserInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _userId = _$v.userId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _userId = $v.userId; _$v = null; } return this; @@ -29620,14 +29972,12 @@ class GUnfollowUserInputBuilder @override void replace(GUnfollowUserInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUnfollowUserInput; } @override - void update(void Function(GUnfollowUserInputBuilder) updates) { + void update(void Function(GUnfollowUserInputBuilder)? updates) { if (updates != null) updates(this); } @@ -29635,7 +29985,9 @@ class GUnfollowUserInputBuilder _$GUnfollowUserInput build() { final _$result = _$v ?? new _$GUnfollowUserInput._( - clientMutationId: clientMutationId, userId: userId); + clientMutationId: clientMutationId, + userId: BuiltValueNullFieldError.checkNotNull( + userId, 'GUnfollowUserInput', 'userId')); replace(_$result); return _$result; } @@ -29644,27 +29996,25 @@ class GUnfollowUserInputBuilder class _$GUnlinkRepositoryFromProjectInput extends GUnlinkRepositoryFromProjectInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String projectId; @override final String repositoryId; factory _$GUnlinkRepositoryFromProjectInput( - [void Function(GUnlinkRepositoryFromProjectInputBuilder) updates]) => + [void Function(GUnlinkRepositoryFromProjectInputBuilder)? updates]) => (new GUnlinkRepositoryFromProjectInputBuilder()..update(updates)).build(); _$GUnlinkRepositoryFromProjectInput._( - {this.clientMutationId, this.projectId, this.repositoryId}) + {this.clientMutationId, + required this.projectId, + required this.repositoryId}) : super._() { - if (projectId == null) { - throw new BuiltValueNullFieldError( - 'GUnlinkRepositoryFromProjectInput', 'projectId'); - } - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GUnlinkRepositoryFromProjectInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + projectId, 'GUnlinkRepositoryFromProjectInput', 'projectId'); + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUnlinkRepositoryFromProjectInput', 'repositoryId'); } @override @@ -29705,28 +30055,29 @@ class GUnlinkRepositoryFromProjectInputBuilder implements Builder { - _$GUnlinkRepositoryFromProjectInput _$v; + _$GUnlinkRepositoryFromProjectInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _projectId; - String get projectId => _$this._projectId; - set projectId(String projectId) => _$this._projectId = projectId; + String? _projectId; + String? get projectId => _$this._projectId; + set projectId(String? projectId) => _$this._projectId = projectId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; GUnlinkRepositoryFromProjectInputBuilder(); GUnlinkRepositoryFromProjectInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _projectId = _$v.projectId; - _repositoryId = _$v.repositoryId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _projectId = $v.projectId; + _repositoryId = $v.repositoryId; _$v = null; } return this; @@ -29734,14 +30085,13 @@ class GUnlinkRepositoryFromProjectInputBuilder @override void replace(GUnlinkRepositoryFromProjectInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUnlinkRepositoryFromProjectInput; } @override - void update(void Function(GUnlinkRepositoryFromProjectInputBuilder) updates) { + void update( + void Function(GUnlinkRepositoryFromProjectInputBuilder)? updates) { if (updates != null) updates(this); } @@ -29750,8 +30100,10 @@ class GUnlinkRepositoryFromProjectInputBuilder final _$result = _$v ?? new _$GUnlinkRepositoryFromProjectInput._( clientMutationId: clientMutationId, - projectId: projectId, - repositoryId: repositoryId); + projectId: BuiltValueNullFieldError.checkNotNull( + projectId, 'GUnlinkRepositoryFromProjectInput', 'projectId'), + repositoryId: BuiltValueNullFieldError.checkNotNull(repositoryId, + 'GUnlinkRepositoryFromProjectInput', 'repositoryId')); replace(_$result); return _$result; } @@ -29759,19 +30111,18 @@ class GUnlinkRepositoryFromProjectInputBuilder class _$GUnlockLockableInput extends GUnlockLockableInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String lockableId; factory _$GUnlockLockableInput( - [void Function(GUnlockLockableInputBuilder) updates]) => + [void Function(GUnlockLockableInputBuilder)? updates]) => (new GUnlockLockableInputBuilder()..update(updates)).build(); - _$GUnlockLockableInput._({this.clientMutationId, this.lockableId}) + _$GUnlockLockableInput._({this.clientMutationId, required this.lockableId}) : super._() { - if (lockableId == null) { - throw new BuiltValueNullFieldError('GUnlockLockableInput', 'lockableId'); - } + BuiltValueNullFieldError.checkNotNull( + lockableId, 'GUnlockLockableInput', 'lockableId'); } @override @@ -29807,23 +30158,24 @@ class _$GUnlockLockableInput extends GUnlockLockableInput { class GUnlockLockableInputBuilder implements Builder { - _$GUnlockLockableInput _$v; + _$GUnlockLockableInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _lockableId; - String get lockableId => _$this._lockableId; - set lockableId(String lockableId) => _$this._lockableId = lockableId; + String? _lockableId; + String? get lockableId => _$this._lockableId; + set lockableId(String? lockableId) => _$this._lockableId = lockableId; GUnlockLockableInputBuilder(); GUnlockLockableInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _lockableId = _$v.lockableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _lockableId = $v.lockableId; _$v = null; } return this; @@ -29831,14 +30183,12 @@ class GUnlockLockableInputBuilder @override void replace(GUnlockLockableInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUnlockLockableInput; } @override - void update(void Function(GUnlockLockableInputBuilder) updates) { + void update(void Function(GUnlockLockableInputBuilder)? updates) { if (updates != null) updates(this); } @@ -29846,7 +30196,9 @@ class GUnlockLockableInputBuilder _$GUnlockLockableInput build() { final _$result = _$v ?? new _$GUnlockLockableInput._( - clientMutationId: clientMutationId, lockableId: lockableId); + clientMutationId: clientMutationId, + lockableId: BuiltValueNullFieldError.checkNotNull( + lockableId, 'GUnlockLockableInput', 'lockableId')); replace(_$result); return _$result; } @@ -29856,25 +30208,23 @@ class _$GUnmarkIssueAsDuplicateInput extends GUnmarkIssueAsDuplicateInput { @override final String canonicalId; @override - final String clientMutationId; + final String? clientMutationId; @override final String duplicateId; factory _$GUnmarkIssueAsDuplicateInput( - [void Function(GUnmarkIssueAsDuplicateInputBuilder) updates]) => + [void Function(GUnmarkIssueAsDuplicateInputBuilder)? updates]) => (new GUnmarkIssueAsDuplicateInputBuilder()..update(updates)).build(); _$GUnmarkIssueAsDuplicateInput._( - {this.canonicalId, this.clientMutationId, this.duplicateId}) + {required this.canonicalId, + this.clientMutationId, + required this.duplicateId}) : super._() { - if (canonicalId == null) { - throw new BuiltValueNullFieldError( - 'GUnmarkIssueAsDuplicateInput', 'canonicalId'); - } - if (duplicateId == null) { - throw new BuiltValueNullFieldError( - 'GUnmarkIssueAsDuplicateInput', 'duplicateId'); - } + BuiltValueNullFieldError.checkNotNull( + canonicalId, 'GUnmarkIssueAsDuplicateInput', 'canonicalId'); + BuiltValueNullFieldError.checkNotNull( + duplicateId, 'GUnmarkIssueAsDuplicateInput', 'duplicateId'); } @override @@ -29915,28 +30265,29 @@ class GUnmarkIssueAsDuplicateInputBuilder implements Builder { - _$GUnmarkIssueAsDuplicateInput _$v; + _$GUnmarkIssueAsDuplicateInput? _$v; - String _canonicalId; - String get canonicalId => _$this._canonicalId; - set canonicalId(String canonicalId) => _$this._canonicalId = canonicalId; + String? _canonicalId; + String? get canonicalId => _$this._canonicalId; + set canonicalId(String? canonicalId) => _$this._canonicalId = canonicalId; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _duplicateId; - String get duplicateId => _$this._duplicateId; - set duplicateId(String duplicateId) => _$this._duplicateId = duplicateId; + String? _duplicateId; + String? get duplicateId => _$this._duplicateId; + set duplicateId(String? duplicateId) => _$this._duplicateId = duplicateId; GUnmarkIssueAsDuplicateInputBuilder(); GUnmarkIssueAsDuplicateInputBuilder get _$this { - if (_$v != null) { - _canonicalId = _$v.canonicalId; - _clientMutationId = _$v.clientMutationId; - _duplicateId = _$v.duplicateId; + final $v = _$v; + if ($v != null) { + _canonicalId = $v.canonicalId; + _clientMutationId = $v.clientMutationId; + _duplicateId = $v.duplicateId; _$v = null; } return this; @@ -29944,14 +30295,12 @@ class GUnmarkIssueAsDuplicateInputBuilder @override void replace(GUnmarkIssueAsDuplicateInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUnmarkIssueAsDuplicateInput; } @override - void update(void Function(GUnmarkIssueAsDuplicateInputBuilder) updates) { + void update(void Function(GUnmarkIssueAsDuplicateInputBuilder)? updates) { if (updates != null) updates(this); } @@ -29959,9 +30308,11 @@ class GUnmarkIssueAsDuplicateInputBuilder _$GUnmarkIssueAsDuplicateInput build() { final _$result = _$v ?? new _$GUnmarkIssueAsDuplicateInput._( - canonicalId: canonicalId, + canonicalId: BuiltValueNullFieldError.checkNotNull( + canonicalId, 'GUnmarkIssueAsDuplicateInput', 'canonicalId'), clientMutationId: clientMutationId, - duplicateId: duplicateId); + duplicateId: BuiltValueNullFieldError.checkNotNull( + duplicateId, 'GUnmarkIssueAsDuplicateInput', 'duplicateId')); replace(_$result); return _$result; } @@ -29969,20 +30320,19 @@ class GUnmarkIssueAsDuplicateInputBuilder class _$GUnresolveReviewThreadInput extends GUnresolveReviewThreadInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String threadId; factory _$GUnresolveReviewThreadInput( - [void Function(GUnresolveReviewThreadInputBuilder) updates]) => + [void Function(GUnresolveReviewThreadInputBuilder)? updates]) => (new GUnresolveReviewThreadInputBuilder()..update(updates)).build(); - _$GUnresolveReviewThreadInput._({this.clientMutationId, this.threadId}) + _$GUnresolveReviewThreadInput._( + {this.clientMutationId, required this.threadId}) : super._() { - if (threadId == null) { - throw new BuiltValueNullFieldError( - 'GUnresolveReviewThreadInput', 'threadId'); - } + BuiltValueNullFieldError.checkNotNull( + threadId, 'GUnresolveReviewThreadInput', 'threadId'); } @override @@ -30020,23 +30370,24 @@ class GUnresolveReviewThreadInputBuilder implements Builder { - _$GUnresolveReviewThreadInput _$v; + _$GUnresolveReviewThreadInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _threadId; - String get threadId => _$this._threadId; - set threadId(String threadId) => _$this._threadId = threadId; + String? _threadId; + String? get threadId => _$this._threadId; + set threadId(String? threadId) => _$this._threadId = threadId; GUnresolveReviewThreadInputBuilder(); GUnresolveReviewThreadInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _threadId = _$v.threadId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _threadId = $v.threadId; _$v = null; } return this; @@ -30044,14 +30395,12 @@ class GUnresolveReviewThreadInputBuilder @override void replace(GUnresolveReviewThreadInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUnresolveReviewThreadInput; } @override - void update(void Function(GUnresolveReviewThreadInputBuilder) updates) { + void update(void Function(GUnresolveReviewThreadInputBuilder)? updates) { if (updates != null) updates(this); } @@ -30059,7 +30408,9 @@ class GUnresolveReviewThreadInputBuilder _$GUnresolveReviewThreadInput build() { final _$result = _$v ?? new _$GUnresolveReviewThreadInput._( - clientMutationId: clientMutationId, threadId: threadId); + clientMutationId: clientMutationId, + threadId: BuiltValueNullFieldError.checkNotNull( + threadId, 'GUnresolveReviewThreadInput', 'threadId')); replace(_$result); return _$result; } @@ -30070,42 +30421,42 @@ class _$GUpdateBranchProtectionRuleInput @override final String branchProtectionRuleId; @override - final String clientMutationId; + final String? clientMutationId; @override - final bool dismissesStaleReviews; + final bool? dismissesStaleReviews; @override - final bool isAdminEnforced; + final bool? isAdminEnforced; @override - final String pattern; + final String? pattern; @override - final BuiltList pushActorIds; + final BuiltList? pushActorIds; @override - final int requiredApprovingReviewCount; + final int? requiredApprovingReviewCount; @override - final BuiltList requiredStatusCheckContexts; + final BuiltList? requiredStatusCheckContexts; @override - final bool requiresApprovingReviews; + final bool? requiresApprovingReviews; @override - final bool requiresCodeOwnerReviews; + final bool? requiresCodeOwnerReviews; @override - final bool requiresCommitSignatures; + final bool? requiresCommitSignatures; @override - final bool requiresStatusChecks; + final bool? requiresStatusChecks; @override - final bool requiresStrictStatusChecks; + final bool? requiresStrictStatusChecks; @override - final bool restrictsPushes; + final bool? restrictsPushes; @override - final bool restrictsReviewDismissals; + final bool? restrictsReviewDismissals; @override - final BuiltList reviewDismissalActorIds; + final BuiltList? reviewDismissalActorIds; factory _$GUpdateBranchProtectionRuleInput( - [void Function(GUpdateBranchProtectionRuleInputBuilder) updates]) => + [void Function(GUpdateBranchProtectionRuleInputBuilder)? updates]) => (new GUpdateBranchProtectionRuleInputBuilder()..update(updates)).build(); _$GUpdateBranchProtectionRuleInput._( - {this.branchProtectionRuleId, + {required this.branchProtectionRuleId, this.clientMutationId, this.dismissesStaleReviews, this.isAdminEnforced, @@ -30122,22 +30473,8 @@ class _$GUpdateBranchProtectionRuleInput this.restrictsReviewDismissals, this.reviewDismissalActorIds}) : super._() { - if (branchProtectionRuleId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateBranchProtectionRuleInput', 'branchProtectionRuleId'); - } - if (pushActorIds == null) { - throw new BuiltValueNullFieldError( - 'GUpdateBranchProtectionRuleInput', 'pushActorIds'); - } - if (requiredStatusCheckContexts == null) { - throw new BuiltValueNullFieldError( - 'GUpdateBranchProtectionRuleInput', 'requiredStatusCheckContexts'); - } - if (reviewDismissalActorIds == null) { - throw new BuiltValueNullFieldError( - 'GUpdateBranchProtectionRuleInput', 'reviewDismissalActorIds'); - } + BuiltValueNullFieldError.checkNotNull(branchProtectionRuleId, + 'GUpdateBranchProtectionRuleInput', 'branchProtectionRuleId'); } @override @@ -30240,112 +30577,113 @@ class GUpdateBranchProtectionRuleInputBuilder implements Builder { - _$GUpdateBranchProtectionRuleInput _$v; + _$GUpdateBranchProtectionRuleInput? _$v; - String _branchProtectionRuleId; - String get branchProtectionRuleId => _$this._branchProtectionRuleId; - set branchProtectionRuleId(String branchProtectionRuleId) => + String? _branchProtectionRuleId; + String? get branchProtectionRuleId => _$this._branchProtectionRuleId; + set branchProtectionRuleId(String? branchProtectionRuleId) => _$this._branchProtectionRuleId = branchProtectionRuleId; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - bool _dismissesStaleReviews; - bool get dismissesStaleReviews => _$this._dismissesStaleReviews; - set dismissesStaleReviews(bool dismissesStaleReviews) => + bool? _dismissesStaleReviews; + bool? get dismissesStaleReviews => _$this._dismissesStaleReviews; + set dismissesStaleReviews(bool? dismissesStaleReviews) => _$this._dismissesStaleReviews = dismissesStaleReviews; - bool _isAdminEnforced; - bool get isAdminEnforced => _$this._isAdminEnforced; - set isAdminEnforced(bool isAdminEnforced) => + bool? _isAdminEnforced; + bool? get isAdminEnforced => _$this._isAdminEnforced; + set isAdminEnforced(bool? isAdminEnforced) => _$this._isAdminEnforced = isAdminEnforced; - String _pattern; - String get pattern => _$this._pattern; - set pattern(String pattern) => _$this._pattern = pattern; + String? _pattern; + String? get pattern => _$this._pattern; + set pattern(String? pattern) => _$this._pattern = pattern; - ListBuilder _pushActorIds; + ListBuilder? _pushActorIds; ListBuilder get pushActorIds => _$this._pushActorIds ??= new ListBuilder(); - set pushActorIds(ListBuilder pushActorIds) => + set pushActorIds(ListBuilder? pushActorIds) => _$this._pushActorIds = pushActorIds; - int _requiredApprovingReviewCount; - int get requiredApprovingReviewCount => _$this._requiredApprovingReviewCount; - set requiredApprovingReviewCount(int requiredApprovingReviewCount) => + int? _requiredApprovingReviewCount; + int? get requiredApprovingReviewCount => _$this._requiredApprovingReviewCount; + set requiredApprovingReviewCount(int? requiredApprovingReviewCount) => _$this._requiredApprovingReviewCount = requiredApprovingReviewCount; - ListBuilder _requiredStatusCheckContexts; + ListBuilder? _requiredStatusCheckContexts; ListBuilder get requiredStatusCheckContexts => _$this._requiredStatusCheckContexts ??= new ListBuilder(); set requiredStatusCheckContexts( - ListBuilder requiredStatusCheckContexts) => + ListBuilder? requiredStatusCheckContexts) => _$this._requiredStatusCheckContexts = requiredStatusCheckContexts; - bool _requiresApprovingReviews; - bool get requiresApprovingReviews => _$this._requiresApprovingReviews; - set requiresApprovingReviews(bool requiresApprovingReviews) => + bool? _requiresApprovingReviews; + bool? get requiresApprovingReviews => _$this._requiresApprovingReviews; + set requiresApprovingReviews(bool? requiresApprovingReviews) => _$this._requiresApprovingReviews = requiresApprovingReviews; - bool _requiresCodeOwnerReviews; - bool get requiresCodeOwnerReviews => _$this._requiresCodeOwnerReviews; - set requiresCodeOwnerReviews(bool requiresCodeOwnerReviews) => + bool? _requiresCodeOwnerReviews; + bool? get requiresCodeOwnerReviews => _$this._requiresCodeOwnerReviews; + set requiresCodeOwnerReviews(bool? requiresCodeOwnerReviews) => _$this._requiresCodeOwnerReviews = requiresCodeOwnerReviews; - bool _requiresCommitSignatures; - bool get requiresCommitSignatures => _$this._requiresCommitSignatures; - set requiresCommitSignatures(bool requiresCommitSignatures) => + bool? _requiresCommitSignatures; + bool? get requiresCommitSignatures => _$this._requiresCommitSignatures; + set requiresCommitSignatures(bool? requiresCommitSignatures) => _$this._requiresCommitSignatures = requiresCommitSignatures; - bool _requiresStatusChecks; - bool get requiresStatusChecks => _$this._requiresStatusChecks; - set requiresStatusChecks(bool requiresStatusChecks) => + bool? _requiresStatusChecks; + bool? get requiresStatusChecks => _$this._requiresStatusChecks; + set requiresStatusChecks(bool? requiresStatusChecks) => _$this._requiresStatusChecks = requiresStatusChecks; - bool _requiresStrictStatusChecks; - bool get requiresStrictStatusChecks => _$this._requiresStrictStatusChecks; - set requiresStrictStatusChecks(bool requiresStrictStatusChecks) => + bool? _requiresStrictStatusChecks; + bool? get requiresStrictStatusChecks => _$this._requiresStrictStatusChecks; + set requiresStrictStatusChecks(bool? requiresStrictStatusChecks) => _$this._requiresStrictStatusChecks = requiresStrictStatusChecks; - bool _restrictsPushes; - bool get restrictsPushes => _$this._restrictsPushes; - set restrictsPushes(bool restrictsPushes) => + bool? _restrictsPushes; + bool? get restrictsPushes => _$this._restrictsPushes; + set restrictsPushes(bool? restrictsPushes) => _$this._restrictsPushes = restrictsPushes; - bool _restrictsReviewDismissals; - bool get restrictsReviewDismissals => _$this._restrictsReviewDismissals; - set restrictsReviewDismissals(bool restrictsReviewDismissals) => + bool? _restrictsReviewDismissals; + bool? get restrictsReviewDismissals => _$this._restrictsReviewDismissals; + set restrictsReviewDismissals(bool? restrictsReviewDismissals) => _$this._restrictsReviewDismissals = restrictsReviewDismissals; - ListBuilder _reviewDismissalActorIds; + ListBuilder? _reviewDismissalActorIds; ListBuilder get reviewDismissalActorIds => _$this._reviewDismissalActorIds ??= new ListBuilder(); - set reviewDismissalActorIds(ListBuilder reviewDismissalActorIds) => + set reviewDismissalActorIds(ListBuilder? reviewDismissalActorIds) => _$this._reviewDismissalActorIds = reviewDismissalActorIds; GUpdateBranchProtectionRuleInputBuilder(); GUpdateBranchProtectionRuleInputBuilder get _$this { - if (_$v != null) { - _branchProtectionRuleId = _$v.branchProtectionRuleId; - _clientMutationId = _$v.clientMutationId; - _dismissesStaleReviews = _$v.dismissesStaleReviews; - _isAdminEnforced = _$v.isAdminEnforced; - _pattern = _$v.pattern; - _pushActorIds = _$v.pushActorIds?.toBuilder(); - _requiredApprovingReviewCount = _$v.requiredApprovingReviewCount; + final $v = _$v; + if ($v != null) { + _branchProtectionRuleId = $v.branchProtectionRuleId; + _clientMutationId = $v.clientMutationId; + _dismissesStaleReviews = $v.dismissesStaleReviews; + _isAdminEnforced = $v.isAdminEnforced; + _pattern = $v.pattern; + _pushActorIds = $v.pushActorIds?.toBuilder(); + _requiredApprovingReviewCount = $v.requiredApprovingReviewCount; _requiredStatusCheckContexts = - _$v.requiredStatusCheckContexts?.toBuilder(); - _requiresApprovingReviews = _$v.requiresApprovingReviews; - _requiresCodeOwnerReviews = _$v.requiresCodeOwnerReviews; - _requiresCommitSignatures = _$v.requiresCommitSignatures; - _requiresStatusChecks = _$v.requiresStatusChecks; - _requiresStrictStatusChecks = _$v.requiresStrictStatusChecks; - _restrictsPushes = _$v.restrictsPushes; - _restrictsReviewDismissals = _$v.restrictsReviewDismissals; - _reviewDismissalActorIds = _$v.reviewDismissalActorIds?.toBuilder(); + $v.requiredStatusCheckContexts?.toBuilder(); + _requiresApprovingReviews = $v.requiresApprovingReviews; + _requiresCodeOwnerReviews = $v.requiresCodeOwnerReviews; + _requiresCommitSignatures = $v.requiresCommitSignatures; + _requiresStatusChecks = $v.requiresStatusChecks; + _requiresStrictStatusChecks = $v.requiresStrictStatusChecks; + _restrictsPushes = $v.restrictsPushes; + _restrictsReviewDismissals = $v.restrictsReviewDismissals; + _reviewDismissalActorIds = $v.reviewDismissalActorIds?.toBuilder(); _$v = null; } return this; @@ -30353,14 +30691,12 @@ class GUpdateBranchProtectionRuleInputBuilder @override void replace(GUpdateBranchProtectionRuleInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateBranchProtectionRuleInput; } @override - void update(void Function(GUpdateBranchProtectionRuleInputBuilder) updates) { + void update(void Function(GUpdateBranchProtectionRuleInputBuilder)? updates) { if (updates != null) updates(this); } @@ -30370,14 +30706,18 @@ class GUpdateBranchProtectionRuleInputBuilder try { _$result = _$v ?? new _$GUpdateBranchProtectionRuleInput._( - branchProtectionRuleId: branchProtectionRuleId, + branchProtectionRuleId: BuiltValueNullFieldError.checkNotNull( + branchProtectionRuleId, + 'GUpdateBranchProtectionRuleInput', + 'branchProtectionRuleId'), clientMutationId: clientMutationId, dismissesStaleReviews: dismissesStaleReviews, isAdminEnforced: isAdminEnforced, pattern: pattern, - pushActorIds: pushActorIds.build(), + pushActorIds: _pushActorIds?.build(), requiredApprovingReviewCount: requiredApprovingReviewCount, - requiredStatusCheckContexts: requiredStatusCheckContexts.build(), + requiredStatusCheckContexts: + _requiredStatusCheckContexts?.build(), requiresApprovingReviews: requiresApprovingReviews, requiresCodeOwnerReviews: requiresCodeOwnerReviews, requiresCommitSignatures: requiresCommitSignatures, @@ -30385,18 +30725,18 @@ class GUpdateBranchProtectionRuleInputBuilder requiresStrictStatusChecks: requiresStrictStatusChecks, restrictsPushes: restrictsPushes, restrictsReviewDismissals: restrictsReviewDismissals, - reviewDismissalActorIds: reviewDismissalActorIds.build()); + reviewDismissalActorIds: _reviewDismissalActorIds?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'pushActorIds'; - pushActorIds.build(); + _pushActorIds?.build(); _$failedField = 'requiredStatusCheckContexts'; - requiredStatusCheckContexts.build(); + _requiredStatusCheckContexts?.build(); _$failedField = 'reviewDismissalActorIds'; - reviewDismissalActorIds.build(); + _reviewDismissalActorIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GUpdateBranchProtectionRuleInput', _$failedField, e.toString()); @@ -30413,31 +30753,29 @@ class _$GUpdateEnterpriseActionExecutionCapabilitySettingInput @override final GActionExecutionCapabilitySetting capability; @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; factory _$GUpdateEnterpriseActionExecutionCapabilitySettingInput( [void Function( - GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder) + GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder)? updates]) => (new GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseActionExecutionCapabilitySettingInput._( - {this.capability, this.clientMutationId, this.enterpriseId}) + {required this.capability, + this.clientMutationId, + required this.enterpriseId}) : super._() { - if (capability == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseActionExecutionCapabilitySettingInput', - 'capability'); - } - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseActionExecutionCapabilitySettingInput', - 'enterpriseId'); - } + BuiltValueNullFieldError.checkNotNull(capability, + 'GUpdateEnterpriseActionExecutionCapabilitySettingInput', 'capability'); + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseActionExecutionCapabilitySettingInput', + 'enterpriseId'); } @override @@ -30482,29 +30820,30 @@ class GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder implements Builder { - _$GUpdateEnterpriseActionExecutionCapabilitySettingInput _$v; + _$GUpdateEnterpriseActionExecutionCapabilitySettingInput? _$v; - GActionExecutionCapabilitySetting _capability; - GActionExecutionCapabilitySetting get capability => _$this._capability; - set capability(GActionExecutionCapabilitySetting capability) => + GActionExecutionCapabilitySetting? _capability; + GActionExecutionCapabilitySetting? get capability => _$this._capability; + set capability(GActionExecutionCapabilitySetting? capability) => _$this._capability = capability; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder(); GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder get _$this { - if (_$v != null) { - _capability = _$v.capability; - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; + final $v = _$v; + if ($v != null) { + _capability = $v.capability; + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; _$v = null; } return this; @@ -30512,16 +30851,14 @@ class GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder @override void replace(GUpdateEnterpriseActionExecutionCapabilitySettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseActionExecutionCapabilitySettingInput; } @override void update( void Function( - GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder) + GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -30530,9 +30867,15 @@ class GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder _$GUpdateEnterpriseActionExecutionCapabilitySettingInput build() { final _$result = _$v ?? new _$GUpdateEnterpriseActionExecutionCapabilitySettingInput._( - capability: capability, + capability: BuiltValueNullFieldError.checkNotNull( + capability, + 'GUpdateEnterpriseActionExecutionCapabilitySettingInput', + 'capability'), clientMutationId: clientMutationId, - enterpriseId: enterpriseId); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseActionExecutionCapabilitySettingInput', + 'enterpriseId')); replace(_$result); return _$result; } @@ -30541,7 +30884,7 @@ class GUpdateEnterpriseActionExecutionCapabilitySettingInputBuilder class _$GUpdateEnterpriseAdministratorRoleInput extends GUpdateEnterpriseAdministratorRoleInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -30550,26 +30893,23 @@ class _$GUpdateEnterpriseAdministratorRoleInput final GEnterpriseAdministratorRole role; factory _$GUpdateEnterpriseAdministratorRoleInput( - [void Function(GUpdateEnterpriseAdministratorRoleInputBuilder) + [void Function(GUpdateEnterpriseAdministratorRoleInputBuilder)? updates]) => (new GUpdateEnterpriseAdministratorRoleInputBuilder()..update(updates)) .build(); _$GUpdateEnterpriseAdministratorRoleInput._( - {this.clientMutationId, this.enterpriseId, this.login, this.role}) + {this.clientMutationId, + required this.enterpriseId, + required this.login, + required this.role}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseAdministratorRoleInput', 'enterpriseId'); - } - if (login == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseAdministratorRoleInput', 'login'); - } - if (role == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseAdministratorRoleInput', 'role'); - } + BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseAdministratorRoleInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + login, 'GUpdateEnterpriseAdministratorRoleInput', 'login'); + BuiltValueNullFieldError.checkNotNull( + role, 'GUpdateEnterpriseAdministratorRoleInput', 'role'); } @override @@ -30616,33 +30956,34 @@ class GUpdateEnterpriseAdministratorRoleInputBuilder implements Builder { - _$GUpdateEnterpriseAdministratorRoleInput _$v; + _$GUpdateEnterpriseAdministratorRoleInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - String _login; - String get login => _$this._login; - set login(String login) => _$this._login = login; + String? _login; + String? get login => _$this._login; + set login(String? login) => _$this._login = login; - GEnterpriseAdministratorRole _role; - GEnterpriseAdministratorRole get role => _$this._role; - set role(GEnterpriseAdministratorRole role) => _$this._role = role; + GEnterpriseAdministratorRole? _role; + GEnterpriseAdministratorRole? get role => _$this._role; + set role(GEnterpriseAdministratorRole? role) => _$this._role = role; GUpdateEnterpriseAdministratorRoleInputBuilder(); GUpdateEnterpriseAdministratorRoleInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _login = _$v.login; - _role = _$v.role; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _login = $v.login; + _role = $v.role; _$v = null; } return this; @@ -30650,15 +30991,13 @@ class GUpdateEnterpriseAdministratorRoleInputBuilder @override void replace(GUpdateEnterpriseAdministratorRoleInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseAdministratorRoleInput; } @override void update( - void Function(GUpdateEnterpriseAdministratorRoleInputBuilder) updates) { + void Function(GUpdateEnterpriseAdministratorRoleInputBuilder)? updates) { if (updates != null) updates(this); } @@ -30667,9 +31006,12 @@ class GUpdateEnterpriseAdministratorRoleInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseAdministratorRoleInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - login: login, - role: role); + enterpriseId: BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseAdministratorRoleInput', 'enterpriseId'), + login: BuiltValueNullFieldError.checkNotNull( + login, 'GUpdateEnterpriseAdministratorRoleInput', 'login'), + role: BuiltValueNullFieldError.checkNotNull( + role, 'GUpdateEnterpriseAdministratorRoleInput', 'role')); replace(_$result); return _$result; } @@ -30678,7 +31020,7 @@ class GUpdateEnterpriseAdministratorRoleInputBuilder class _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput extends GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -30686,25 +31028,25 @@ class _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput factory _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput( [void Function( - GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder) + GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder)? updates]) => (new GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput', + 'settingValue'); } @override @@ -30752,30 +31094,31 @@ class GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder implements Builder { - _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput _$v; + _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder(); GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -30784,16 +31127,14 @@ class GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder @override void replace( GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput; } @override void update( void Function( - GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder) + GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -30803,8 +31144,14 @@ class GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -30813,7 +31160,7 @@ class GUpdateEnterpriseAllowPrivateRepositoryForkingSettingInputBuilder class _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput extends GUpdateEnterpriseDefaultRepositoryPermissionSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -30821,25 +31168,25 @@ class _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput factory _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput( [void Function( - GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder) + GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder)? updates]) => (new GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput', + 'settingValue'); } @override @@ -30885,31 +31232,32 @@ class GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder implements Builder { - _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput _$v; + _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseDefaultRepositoryPermissionSettingValue _settingValue; - GEnterpriseDefaultRepositoryPermissionSettingValue get settingValue => + GEnterpriseDefaultRepositoryPermissionSettingValue? _settingValue; + GEnterpriseDefaultRepositoryPermissionSettingValue? get settingValue => _$this._settingValue; set settingValue( - GEnterpriseDefaultRepositoryPermissionSettingValue settingValue) => + GEnterpriseDefaultRepositoryPermissionSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder(); GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -30917,16 +31265,14 @@ class GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder @override void replace(GUpdateEnterpriseDefaultRepositoryPermissionSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput; } @override void update( void Function( - GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder) + GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -30936,8 +31282,14 @@ class GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseDefaultRepositoryPermissionSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseDefaultRepositoryPermissionSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -30946,7 +31298,7 @@ class GUpdateEnterpriseDefaultRepositoryPermissionSettingInputBuilder class _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput extends GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -30954,25 +31306,25 @@ class _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput factory _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput( [void Function( - GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder) + GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput', + 'settingValue'); } @override @@ -31021,31 +31373,32 @@ class GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder Builder< GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput, GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder> { - _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput _$v; + _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder(); GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31054,9 +31407,7 @@ class GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder @override void replace( GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput; } @@ -31064,7 +31415,7 @@ class GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder @override void update( void Function( - GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder) + GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31075,8 +31426,14 @@ class GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder new _$GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput ._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -31085,23 +31442,23 @@ class GUpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInputBuilder class _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput extends GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override - final bool membersCanCreateInternalRepositories; + final bool? membersCanCreateInternalRepositories; @override - final bool membersCanCreatePrivateRepositories; + final bool? membersCanCreatePrivateRepositories; @override - final bool membersCanCreatePublicRepositories; + final bool? membersCanCreatePublicRepositories; @override - final bool membersCanCreateRepositoriesPolicyEnabled; + final bool? membersCanCreateRepositoriesPolicyEnabled; @override - final GEnterpriseMembersCanCreateRepositoriesSettingValue settingValue; + final GEnterpriseMembersCanCreateRepositoriesSettingValue? settingValue; factory _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput( [void Function( - GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder) + GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder() ..update(updates)) @@ -31109,18 +31466,17 @@ class _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput._( {this.clientMutationId, - this.enterpriseId, + required this.enterpriseId, this.membersCanCreateInternalRepositories, this.membersCanCreatePrivateRepositories, this.membersCanCreatePublicRepositories, this.membersCanCreateRepositoriesPolicyEnabled, this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput', - 'enterpriseId'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput', + 'enterpriseId'); } @override @@ -31192,71 +31548,72 @@ class GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput _$v; + _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - bool _membersCanCreateInternalRepositories; - bool get membersCanCreateInternalRepositories => + bool? _membersCanCreateInternalRepositories; + bool? get membersCanCreateInternalRepositories => _$this._membersCanCreateInternalRepositories; set membersCanCreateInternalRepositories( - bool membersCanCreateInternalRepositories) => + bool? membersCanCreateInternalRepositories) => _$this._membersCanCreateInternalRepositories = membersCanCreateInternalRepositories; - bool _membersCanCreatePrivateRepositories; - bool get membersCanCreatePrivateRepositories => + bool? _membersCanCreatePrivateRepositories; + bool? get membersCanCreatePrivateRepositories => _$this._membersCanCreatePrivateRepositories; set membersCanCreatePrivateRepositories( - bool membersCanCreatePrivateRepositories) => + bool? membersCanCreatePrivateRepositories) => _$this._membersCanCreatePrivateRepositories = membersCanCreatePrivateRepositories; - bool _membersCanCreatePublicRepositories; - bool get membersCanCreatePublicRepositories => + bool? _membersCanCreatePublicRepositories; + bool? get membersCanCreatePublicRepositories => _$this._membersCanCreatePublicRepositories; set membersCanCreatePublicRepositories( - bool membersCanCreatePublicRepositories) => + bool? membersCanCreatePublicRepositories) => _$this._membersCanCreatePublicRepositories = membersCanCreatePublicRepositories; - bool _membersCanCreateRepositoriesPolicyEnabled; - bool get membersCanCreateRepositoriesPolicyEnabled => + bool? _membersCanCreateRepositoriesPolicyEnabled; + bool? get membersCanCreateRepositoriesPolicyEnabled => _$this._membersCanCreateRepositoriesPolicyEnabled; set membersCanCreateRepositoriesPolicyEnabled( - bool membersCanCreateRepositoriesPolicyEnabled) => + bool? membersCanCreateRepositoriesPolicyEnabled) => _$this._membersCanCreateRepositoriesPolicyEnabled = membersCanCreateRepositoriesPolicyEnabled; - GEnterpriseMembersCanCreateRepositoriesSettingValue _settingValue; - GEnterpriseMembersCanCreateRepositoriesSettingValue get settingValue => + GEnterpriseMembersCanCreateRepositoriesSettingValue? _settingValue; + GEnterpriseMembersCanCreateRepositoriesSettingValue? get settingValue => _$this._settingValue; set settingValue( - GEnterpriseMembersCanCreateRepositoriesSettingValue settingValue) => + GEnterpriseMembersCanCreateRepositoriesSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder(); GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; _membersCanCreateInternalRepositories = - _$v.membersCanCreateInternalRepositories; + $v.membersCanCreateInternalRepositories; _membersCanCreatePrivateRepositories = - _$v.membersCanCreatePrivateRepositories; + $v.membersCanCreatePrivateRepositories; _membersCanCreatePublicRepositories = - _$v.membersCanCreatePublicRepositories; + $v.membersCanCreatePublicRepositories; _membersCanCreateRepositoriesPolicyEnabled = - _$v.membersCanCreateRepositoriesPolicyEnabled; - _settingValue = _$v.settingValue; + $v.membersCanCreateRepositoriesPolicyEnabled; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31265,16 +31622,14 @@ class GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder @override void replace( GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput; } @override void update( void Function( - GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder) + GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31284,7 +31639,10 @@ class GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanCreateRepositoriesSettingInput', + 'enterpriseId'), membersCanCreateInternalRepositories: membersCanCreateInternalRepositories, membersCanCreatePrivateRepositories: @@ -31302,7 +31660,7 @@ class GUpdateEnterpriseMembersCanCreateRepositoriesSettingInputBuilder class _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput extends GUpdateEnterpriseMembersCanDeleteIssuesSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -31310,25 +31668,21 @@ class _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput factory _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput( [void Function( - GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder) + GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull(settingValue, + 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput', 'settingValue'); } @override @@ -31374,30 +31728,31 @@ class GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput _$v; + _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder(); GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31405,15 +31760,13 @@ class GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder @override void replace(GUpdateEnterpriseMembersCanDeleteIssuesSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput; } @override void update( - void Function(GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder) + void Function(GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31423,8 +31776,14 @@ class GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanDeleteIssuesSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanDeleteIssuesSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -31433,7 +31792,7 @@ class GUpdateEnterpriseMembersCanDeleteIssuesSettingInputBuilder class _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput extends GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -31441,25 +31800,25 @@ class _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput factory _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput( [void Function( - GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder) + GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput', + 'settingValue'); } @override @@ -31506,30 +31865,31 @@ class GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput _$v; + _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder(); GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31538,16 +31898,14 @@ class GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder @override void replace( GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput; } @override void update( void Function( - GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder) + GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31557,8 +31915,14 @@ class GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -31567,7 +31931,7 @@ class GUpdateEnterpriseMembersCanDeleteRepositoriesSettingInputBuilder class _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput extends GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -31575,25 +31939,25 @@ class _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput factory _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput( [void Function( - GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder) + GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput', + 'settingValue'); } @override @@ -31641,30 +32005,31 @@ class GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput _$v; + _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder(); GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31673,16 +32038,14 @@ class GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder @override void replace( GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput; } @override void update( void Function( - GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder) + GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31692,8 +32055,14 @@ class GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -31702,7 +32071,7 @@ class GUpdateEnterpriseMembersCanInviteCollaboratorsSettingInputBuilder class _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput extends GUpdateEnterpriseMembersCanMakePurchasesSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -31710,25 +32079,21 @@ class _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput factory _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput( [void Function( - GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder) + GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull(settingValue, + 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput', 'settingValue'); } @override @@ -31774,31 +32139,32 @@ class GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput _$v; + _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseMembersCanMakePurchasesSettingValue _settingValue; - GEnterpriseMembersCanMakePurchasesSettingValue get settingValue => + GEnterpriseMembersCanMakePurchasesSettingValue? _settingValue; + GEnterpriseMembersCanMakePurchasesSettingValue? get settingValue => _$this._settingValue; set settingValue( - GEnterpriseMembersCanMakePurchasesSettingValue settingValue) => + GEnterpriseMembersCanMakePurchasesSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder(); GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31806,15 +32172,14 @@ class GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder @override void replace(GUpdateEnterpriseMembersCanMakePurchasesSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput; } @override void update( - void Function(GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder) + void Function( + GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31824,8 +32189,14 @@ class GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanMakePurchasesSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanMakePurchasesSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -31834,7 +32205,7 @@ class GUpdateEnterpriseMembersCanMakePurchasesSettingInputBuilder class _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput extends GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -31842,25 +32213,25 @@ class _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput factory _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput( [void Function( - GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder) + GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput', + 'settingValue'); } @override @@ -31908,31 +32279,32 @@ class GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput _$v; + _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder(); GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -31941,9 +32313,7 @@ class GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder @override void replace( GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput; } @@ -31951,7 +32321,7 @@ class GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder @override void update( void Function( - GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder) + GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -31961,8 +32331,14 @@ class GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -31971,7 +32347,7 @@ class GUpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInputBuilder class _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput extends GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -31979,25 +32355,25 @@ class _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput factory _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput( [void Function( - GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder) + GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder)? updates]) => (new GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput', + 'settingValue'); } @override @@ -32045,31 +32421,32 @@ class GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder implements Builder { - _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput _$v; + _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder(); GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -32078,9 +32455,7 @@ class GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder @override void replace( GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput; } @@ -32088,7 +32463,7 @@ class GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder @override void update( void Function( - GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder) + GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32098,8 +32473,14 @@ class GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -32108,7 +32489,7 @@ class GUpdateEnterpriseMembersCanViewDependencyInsightsSettingInputBuilder class _$GUpdateEnterpriseOrganizationProjectsSettingInput extends GUpdateEnterpriseOrganizationProjectsSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -32116,23 +32497,21 @@ class _$GUpdateEnterpriseOrganizationProjectsSettingInput factory _$GUpdateEnterpriseOrganizationProjectsSettingInput( [void Function( - GUpdateEnterpriseOrganizationProjectsSettingInputBuilder) + GUpdateEnterpriseOrganizationProjectsSettingInputBuilder)? updates]) => (new GUpdateEnterpriseOrganizationProjectsSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseOrganizationProjectsSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseOrganizationProjectsSettingInput', 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseOrganizationProjectsSettingInput', 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseOrganizationProjectsSettingInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull(settingValue, + 'GUpdateEnterpriseOrganizationProjectsSettingInput', 'settingValue'); } @override @@ -32178,30 +32557,31 @@ class GUpdateEnterpriseOrganizationProjectsSettingInputBuilder implements Builder { - _$GUpdateEnterpriseOrganizationProjectsSettingInput _$v; + _$GUpdateEnterpriseOrganizationProjectsSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseOrganizationProjectsSettingInputBuilder(); GUpdateEnterpriseOrganizationProjectsSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -32209,15 +32589,13 @@ class GUpdateEnterpriseOrganizationProjectsSettingInputBuilder @override void replace(GUpdateEnterpriseOrganizationProjectsSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseOrganizationProjectsSettingInput; } @override void update( - void Function(GUpdateEnterpriseOrganizationProjectsSettingInputBuilder) + void Function(GUpdateEnterpriseOrganizationProjectsSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32227,8 +32605,14 @@ class GUpdateEnterpriseOrganizationProjectsSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseOrganizationProjectsSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseOrganizationProjectsSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseOrganizationProjectsSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -32236,34 +32620,32 @@ class GUpdateEnterpriseOrganizationProjectsSettingInputBuilder class _$GUpdateEnterpriseProfileInput extends GUpdateEnterpriseProfileInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String description; + final String? description; @override final String enterpriseId; @override - final String location; + final String? location; @override - final String name; + final String? name; @override - final String websiteUrl; + final String? websiteUrl; factory _$GUpdateEnterpriseProfileInput( - [void Function(GUpdateEnterpriseProfileInputBuilder) updates]) => + [void Function(GUpdateEnterpriseProfileInputBuilder)? updates]) => (new GUpdateEnterpriseProfileInputBuilder()..update(updates)).build(); _$GUpdateEnterpriseProfileInput._( {this.clientMutationId, this.description, - this.enterpriseId, + required this.enterpriseId, this.location, this.name, this.websiteUrl}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseProfileInput', 'enterpriseId'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GUpdateEnterpriseProfileInput', 'enterpriseId'); } @override @@ -32318,43 +32700,44 @@ class GUpdateEnterpriseProfileInputBuilder implements Builder { - _$GUpdateEnterpriseProfileInput _$v; + _$GUpdateEnterpriseProfileInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _description; - String get description => _$this._description; - set description(String description) => _$this._description = description; + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - String _location; - String get location => _$this._location; - set location(String location) => _$this._location = location; + String? _location; + String? get location => _$this._location; + set location(String? location) => _$this._location = location; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _websiteUrl; - String get websiteUrl => _$this._websiteUrl; - set websiteUrl(String websiteUrl) => _$this._websiteUrl = websiteUrl; + String? _websiteUrl; + String? get websiteUrl => _$this._websiteUrl; + set websiteUrl(String? websiteUrl) => _$this._websiteUrl = websiteUrl; GUpdateEnterpriseProfileInputBuilder(); GUpdateEnterpriseProfileInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _description = _$v.description; - _enterpriseId = _$v.enterpriseId; - _location = _$v.location; - _name = _$v.name; - _websiteUrl = _$v.websiteUrl; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _description = $v.description; + _enterpriseId = $v.enterpriseId; + _location = $v.location; + _name = $v.name; + _websiteUrl = $v.websiteUrl; _$v = null; } return this; @@ -32362,14 +32745,12 @@ class GUpdateEnterpriseProfileInputBuilder @override void replace(GUpdateEnterpriseProfileInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseProfileInput; } @override - void update(void Function(GUpdateEnterpriseProfileInputBuilder) updates) { + void update(void Function(GUpdateEnterpriseProfileInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32379,7 +32760,8 @@ class GUpdateEnterpriseProfileInputBuilder new _$GUpdateEnterpriseProfileInput._( clientMutationId: clientMutationId, description: description, - enterpriseId: enterpriseId, + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, 'GUpdateEnterpriseProfileInput', 'enterpriseId'), location: location, name: name, websiteUrl: websiteUrl); @@ -32391,30 +32773,29 @@ class GUpdateEnterpriseProfileInputBuilder class _$GUpdateEnterpriseRepositoryProjectsSettingInput extends GUpdateEnterpriseRepositoryProjectsSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override final GEnterpriseEnabledDisabledSettingValue settingValue; factory _$GUpdateEnterpriseRepositoryProjectsSettingInput( - [void Function(GUpdateEnterpriseRepositoryProjectsSettingInputBuilder) + [void Function( + GUpdateEnterpriseRepositoryProjectsSettingInputBuilder)? updates]) => (new GUpdateEnterpriseRepositoryProjectsSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseRepositoryProjectsSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseRepositoryProjectsSettingInput', 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseRepositoryProjectsSettingInput', 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseRepositoryProjectsSettingInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull(settingValue, + 'GUpdateEnterpriseRepositoryProjectsSettingInput', 'settingValue'); } @override @@ -32459,30 +32840,31 @@ class GUpdateEnterpriseRepositoryProjectsSettingInputBuilder implements Builder { - _$GUpdateEnterpriseRepositoryProjectsSettingInput _$v; + _$GUpdateEnterpriseRepositoryProjectsSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseRepositoryProjectsSettingInputBuilder(); GUpdateEnterpriseRepositoryProjectsSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -32490,15 +32872,13 @@ class GUpdateEnterpriseRepositoryProjectsSettingInputBuilder @override void replace(GUpdateEnterpriseRepositoryProjectsSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseRepositoryProjectsSettingInput; } @override void update( - void Function(GUpdateEnterpriseRepositoryProjectsSettingInputBuilder) + void Function(GUpdateEnterpriseRepositoryProjectsSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32508,8 +32888,14 @@ class GUpdateEnterpriseRepositoryProjectsSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseRepositoryProjectsSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseRepositoryProjectsSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseRepositoryProjectsSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -32518,30 +32904,28 @@ class GUpdateEnterpriseRepositoryProjectsSettingInputBuilder class _$GUpdateEnterpriseTeamDiscussionsSettingInput extends GUpdateEnterpriseTeamDiscussionsSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override final GEnterpriseEnabledDisabledSettingValue settingValue; factory _$GUpdateEnterpriseTeamDiscussionsSettingInput( - [void Function(GUpdateEnterpriseTeamDiscussionsSettingInputBuilder) + [void Function(GUpdateEnterpriseTeamDiscussionsSettingInputBuilder)? updates]) => (new GUpdateEnterpriseTeamDiscussionsSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseTeamDiscussionsSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseTeamDiscussionsSettingInput', 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseTeamDiscussionsSettingInput', 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseTeamDiscussionsSettingInput', 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull(settingValue, + 'GUpdateEnterpriseTeamDiscussionsSettingInput', 'settingValue'); } @override @@ -32585,30 +32969,31 @@ class GUpdateEnterpriseTeamDiscussionsSettingInputBuilder implements Builder { - _$GUpdateEnterpriseTeamDiscussionsSettingInput _$v; + _$GUpdateEnterpriseTeamDiscussionsSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledDisabledSettingValue _settingValue; - GEnterpriseEnabledDisabledSettingValue get settingValue => + GEnterpriseEnabledDisabledSettingValue? _settingValue; + GEnterpriseEnabledDisabledSettingValue? get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledDisabledSettingValue settingValue) => + set settingValue(GEnterpriseEnabledDisabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseTeamDiscussionsSettingInputBuilder(); GUpdateEnterpriseTeamDiscussionsSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -32616,15 +33001,13 @@ class GUpdateEnterpriseTeamDiscussionsSettingInputBuilder @override void replace(GUpdateEnterpriseTeamDiscussionsSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseTeamDiscussionsSettingInput; } @override void update( - void Function(GUpdateEnterpriseTeamDiscussionsSettingInputBuilder) + void Function(GUpdateEnterpriseTeamDiscussionsSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32634,8 +33017,12 @@ class GUpdateEnterpriseTeamDiscussionsSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseTeamDiscussionsSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull(enterpriseId, + 'GUpdateEnterpriseTeamDiscussionsSettingInput', 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseTeamDiscussionsSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -32644,7 +33031,7 @@ class GUpdateEnterpriseTeamDiscussionsSettingInputBuilder class _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput extends GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String enterpriseId; @override @@ -32652,25 +33039,25 @@ class _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput factory _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput( [void Function( - GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder) + GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder)? updates]) => (new GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder() ..update(updates)) .build(); _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput._( - {this.clientMutationId, this.enterpriseId, this.settingValue}) + {this.clientMutationId, + required this.enterpriseId, + required this.settingValue}) : super._() { - if (enterpriseId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput', - 'enterpriseId'); - } - if (settingValue == null) { - throw new BuiltValueNullFieldError( - 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput', - 'settingValue'); - } + BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput', + 'enterpriseId'); + BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput', + 'settingValue'); } @override @@ -32718,30 +33105,31 @@ class GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder implements Builder { - _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput _$v; + _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _enterpriseId; - String get enterpriseId => _$this._enterpriseId; - set enterpriseId(String enterpriseId) => _$this._enterpriseId = enterpriseId; + String? _enterpriseId; + String? get enterpriseId => _$this._enterpriseId; + set enterpriseId(String? enterpriseId) => _$this._enterpriseId = enterpriseId; - GEnterpriseEnabledSettingValue _settingValue; - GEnterpriseEnabledSettingValue get settingValue => _$this._settingValue; - set settingValue(GEnterpriseEnabledSettingValue settingValue) => + GEnterpriseEnabledSettingValue? _settingValue; + GEnterpriseEnabledSettingValue? get settingValue => _$this._settingValue; + set settingValue(GEnterpriseEnabledSettingValue? settingValue) => _$this._settingValue = settingValue; GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder(); GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _enterpriseId = _$v.enterpriseId; - _settingValue = _$v.settingValue; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _enterpriseId = $v.enterpriseId; + _settingValue = $v.settingValue; _$v = null; } return this; @@ -32750,9 +33138,7 @@ class GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder @override void replace( GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput; } @@ -32760,7 +33146,7 @@ class GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder @override void update( void Function( - GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder) + GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32770,8 +33156,14 @@ class GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInputBuilder final _$result = _$v ?? new _$GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput._( clientMutationId: clientMutationId, - enterpriseId: enterpriseId, - settingValue: settingValue); + enterpriseId: BuiltValueNullFieldError.checkNotNull( + enterpriseId, + 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput', + 'enterpriseId'), + settingValue: BuiltValueNullFieldError.checkNotNull( + settingValue, + 'GUpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput', + 'settingValue')); replace(_$result); return _$result; } @@ -32781,22 +33173,20 @@ class _$GUpdateIssueCommentInput extends GUpdateIssueCommentInput { @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GUpdateIssueCommentInput( - [void Function(GUpdateIssueCommentInputBuilder) updates]) => + [void Function(GUpdateIssueCommentInputBuilder)? updates]) => (new GUpdateIssueCommentInputBuilder()..update(updates)).build(); - _$GUpdateIssueCommentInput._({this.body, this.clientMutationId, this.id}) + _$GUpdateIssueCommentInput._( + {required this.body, this.clientMutationId, required this.id}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError('GUpdateIssueCommentInput', 'body'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GUpdateIssueCommentInput', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GUpdateIssueCommentInput', 'body'); + BuiltValueNullFieldError.checkNotNull(id, 'GUpdateIssueCommentInput', 'id'); } @override @@ -32836,28 +33226,29 @@ class _$GUpdateIssueCommentInput extends GUpdateIssueCommentInput { class GUpdateIssueCommentInputBuilder implements Builder { - _$GUpdateIssueCommentInput _$v; + _$GUpdateIssueCommentInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GUpdateIssueCommentInputBuilder(); GUpdateIssueCommentInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -32865,14 +33256,12 @@ class GUpdateIssueCommentInputBuilder @override void replace(GUpdateIssueCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateIssueCommentInput; } @override - void update(void Function(GUpdateIssueCommentInputBuilder) updates) { + void update(void Function(GUpdateIssueCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -32880,7 +33269,11 @@ class GUpdateIssueCommentInputBuilder _$GUpdateIssueCommentInput build() { final _$result = _$v ?? new _$GUpdateIssueCommentInput._( - body: body, clientMutationId: clientMutationId, id: id); + body: BuiltValueNullFieldError.checkNotNull( + body, 'GUpdateIssueCommentInput', 'body'), + clientMutationId: clientMutationId, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GUpdateIssueCommentInput', 'id')); replace(_$result); return _$result; } @@ -32888,51 +33281,40 @@ class GUpdateIssueCommentInputBuilder class _$GUpdateIssueInput extends GUpdateIssueInput { @override - final BuiltList assigneeIds; + final BuiltList? assigneeIds; @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override final String id; @override - final BuiltList labelIds; + final BuiltList? labelIds; @override - final String milestoneId; + final String? milestoneId; @override - final BuiltList projectIds; + final BuiltList? projectIds; @override - final GIssueState state; + final GIssueState? state; @override - final String title; + final String? title; factory _$GUpdateIssueInput( - [void Function(GUpdateIssueInputBuilder) updates]) => + [void Function(GUpdateIssueInputBuilder)? updates]) => (new GUpdateIssueInputBuilder()..update(updates)).build(); _$GUpdateIssueInput._( {this.assigneeIds, this.body, this.clientMutationId, - this.id, + required this.id, this.labelIds, this.milestoneId, this.projectIds, this.state, this.title}) : super._() { - if (assigneeIds == null) { - throw new BuiltValueNullFieldError('GUpdateIssueInput', 'assigneeIds'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GUpdateIssueInput', 'id'); - } - if (labelIds == null) { - throw new BuiltValueNullFieldError('GUpdateIssueInput', 'labelIds'); - } - if (projectIds == null) { - throw new BuiltValueNullFieldError('GUpdateIssueInput', 'projectIds'); - } + BuiltValueNullFieldError.checkNotNull(id, 'GUpdateIssueInput', 'id'); } @override @@ -32996,63 +33378,64 @@ class _$GUpdateIssueInput extends GUpdateIssueInput { class GUpdateIssueInputBuilder implements Builder { - _$GUpdateIssueInput _$v; + _$GUpdateIssueInput? _$v; - ListBuilder _assigneeIds; + ListBuilder? _assigneeIds; ListBuilder get assigneeIds => _$this._assigneeIds ??= new ListBuilder(); - set assigneeIds(ListBuilder assigneeIds) => + set assigneeIds(ListBuilder? assigneeIds) => _$this._assigneeIds = assigneeIds; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - ListBuilder _labelIds; + ListBuilder? _labelIds; ListBuilder get labelIds => _$this._labelIds ??= new ListBuilder(); - set labelIds(ListBuilder labelIds) => _$this._labelIds = labelIds; + set labelIds(ListBuilder? labelIds) => _$this._labelIds = labelIds; - String _milestoneId; - String get milestoneId => _$this._milestoneId; - set milestoneId(String milestoneId) => _$this._milestoneId = milestoneId; + String? _milestoneId; + String? get milestoneId => _$this._milestoneId; + set milestoneId(String? milestoneId) => _$this._milestoneId = milestoneId; - ListBuilder _projectIds; + ListBuilder? _projectIds; ListBuilder get projectIds => _$this._projectIds ??= new ListBuilder(); - set projectIds(ListBuilder projectIds) => + set projectIds(ListBuilder? projectIds) => _$this._projectIds = projectIds; - GIssueState _state; - GIssueState get state => _$this._state; - set state(GIssueState state) => _$this._state = state; + GIssueState? _state; + GIssueState? get state => _$this._state; + set state(GIssueState? state) => _$this._state = state; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GUpdateIssueInputBuilder(); GUpdateIssueInputBuilder get _$this { - if (_$v != null) { - _assigneeIds = _$v.assigneeIds?.toBuilder(); - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; - _labelIds = _$v.labelIds?.toBuilder(); - _milestoneId = _$v.milestoneId; - _projectIds = _$v.projectIds?.toBuilder(); - _state = _$v.state; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _assigneeIds = $v.assigneeIds?.toBuilder(); + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _id = $v.id; + _labelIds = $v.labelIds?.toBuilder(); + _milestoneId = $v.milestoneId; + _projectIds = $v.projectIds?.toBuilder(); + _state = $v.state; + _title = $v.title; _$v = null; } return this; @@ -33060,14 +33443,12 @@ class GUpdateIssueInputBuilder @override void replace(GUpdateIssueInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateIssueInput; } @override - void update(void Function(GUpdateIssueInputBuilder) updates) { + void update(void Function(GUpdateIssueInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33077,26 +33458,27 @@ class GUpdateIssueInputBuilder try { _$result = _$v ?? new _$GUpdateIssueInput._( - assigneeIds: assigneeIds.build(), + assigneeIds: _assigneeIds?.build(), body: body, clientMutationId: clientMutationId, - id: id, - labelIds: labelIds.build(), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GUpdateIssueInput', 'id'), + labelIds: _labelIds?.build(), milestoneId: milestoneId, - projectIds: projectIds.build(), + projectIds: _projectIds?.build(), state: state, title: title); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'assigneeIds'; - assigneeIds.build(); + _assigneeIds?.build(); _$failedField = 'labelIds'; - labelIds.build(); + _labelIds?.build(); _$failedField = 'projectIds'; - projectIds.build(); + _projectIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GUpdateIssueInput', _$failedField, e.toString()); @@ -33110,25 +33492,26 @@ class GUpdateIssueInputBuilder class _$GUpdateProjectCardInput extends GUpdateProjectCardInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final bool isArchived; + final bool? isArchived; @override - final String note; + final String? note; @override final String projectCardId; factory _$GUpdateProjectCardInput( - [void Function(GUpdateProjectCardInputBuilder) updates]) => + [void Function(GUpdateProjectCardInputBuilder)? updates]) => (new GUpdateProjectCardInputBuilder()..update(updates)).build(); _$GUpdateProjectCardInput._( - {this.clientMutationId, this.isArchived, this.note, this.projectCardId}) + {this.clientMutationId, + this.isArchived, + this.note, + required this.projectCardId}) : super._() { - if (projectCardId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateProjectCardInput', 'projectCardId'); - } + BuiltValueNullFieldError.checkNotNull( + projectCardId, 'GUpdateProjectCardInput', 'projectCardId'); } @override @@ -33172,34 +33555,35 @@ class _$GUpdateProjectCardInput extends GUpdateProjectCardInput { class GUpdateProjectCardInputBuilder implements Builder { - _$GUpdateProjectCardInput _$v; + _$GUpdateProjectCardInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - bool _isArchived; - bool get isArchived => _$this._isArchived; - set isArchived(bool isArchived) => _$this._isArchived = isArchived; + bool? _isArchived; + bool? get isArchived => _$this._isArchived; + set isArchived(bool? isArchived) => _$this._isArchived = isArchived; - String _note; - String get note => _$this._note; - set note(String note) => _$this._note = note; + String? _note; + String? get note => _$this._note; + set note(String? note) => _$this._note = note; - String _projectCardId; - String get projectCardId => _$this._projectCardId; - set projectCardId(String projectCardId) => + String? _projectCardId; + String? get projectCardId => _$this._projectCardId; + set projectCardId(String? projectCardId) => _$this._projectCardId = projectCardId; GUpdateProjectCardInputBuilder(); GUpdateProjectCardInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _isArchived = _$v.isArchived; - _note = _$v.note; - _projectCardId = _$v.projectCardId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _isArchived = $v.isArchived; + _note = $v.note; + _projectCardId = $v.projectCardId; _$v = null; } return this; @@ -33207,14 +33591,12 @@ class GUpdateProjectCardInputBuilder @override void replace(GUpdateProjectCardInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateProjectCardInput; } @override - void update(void Function(GUpdateProjectCardInputBuilder) updates) { + void update(void Function(GUpdateProjectCardInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33225,7 +33607,8 @@ class GUpdateProjectCardInputBuilder clientMutationId: clientMutationId, isArchived: isArchived, note: note, - projectCardId: projectCardId); + projectCardId: BuiltValueNullFieldError.checkNotNull( + projectCardId, 'GUpdateProjectCardInput', 'projectCardId')); replace(_$result); return _$result; } @@ -33233,26 +33616,25 @@ class GUpdateProjectCardInputBuilder class _$GUpdateProjectColumnInput extends GUpdateProjectColumnInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String name; @override final String projectColumnId; factory _$GUpdateProjectColumnInput( - [void Function(GUpdateProjectColumnInputBuilder) updates]) => + [void Function(GUpdateProjectColumnInputBuilder)? updates]) => (new GUpdateProjectColumnInputBuilder()..update(updates)).build(); _$GUpdateProjectColumnInput._( - {this.clientMutationId, this.name, this.projectColumnId}) + {this.clientMutationId, + required this.name, + required this.projectColumnId}) : super._() { - if (name == null) { - throw new BuiltValueNullFieldError('GUpdateProjectColumnInput', 'name'); - } - if (projectColumnId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateProjectColumnInput', 'projectColumnId'); - } + BuiltValueNullFieldError.checkNotNull( + name, 'GUpdateProjectColumnInput', 'name'); + BuiltValueNullFieldError.checkNotNull( + projectColumnId, 'GUpdateProjectColumnInput', 'projectColumnId'); } @override @@ -33292,29 +33674,30 @@ class _$GUpdateProjectColumnInput extends GUpdateProjectColumnInput { class GUpdateProjectColumnInputBuilder implements Builder { - _$GUpdateProjectColumnInput _$v; + _$GUpdateProjectColumnInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _projectColumnId; - String get projectColumnId => _$this._projectColumnId; - set projectColumnId(String projectColumnId) => + String? _projectColumnId; + String? get projectColumnId => _$this._projectColumnId; + set projectColumnId(String? projectColumnId) => _$this._projectColumnId = projectColumnId; GUpdateProjectColumnInputBuilder(); GUpdateProjectColumnInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _projectColumnId = _$v.projectColumnId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _projectColumnId = $v.projectColumnId; _$v = null; } return this; @@ -33322,14 +33705,12 @@ class GUpdateProjectColumnInputBuilder @override void replace(GUpdateProjectColumnInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateProjectColumnInput; } @override - void update(void Function(GUpdateProjectColumnInputBuilder) updates) { + void update(void Function(GUpdateProjectColumnInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33338,8 +33719,12 @@ class GUpdateProjectColumnInputBuilder final _$result = _$v ?? new _$GUpdateProjectColumnInput._( clientMutationId: clientMutationId, - name: name, - projectColumnId: projectColumnId); + name: BuiltValueNullFieldError.checkNotNull( + name, 'GUpdateProjectColumnInput', 'name'), + projectColumnId: BuiltValueNullFieldError.checkNotNull( + projectColumnId, + 'GUpdateProjectColumnInput', + 'projectColumnId')); replace(_$result); return _$result; } @@ -33347,33 +33732,32 @@ class GUpdateProjectColumnInputBuilder class _$GUpdateProjectInput extends GUpdateProjectInput { @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override - final String name; + final String? name; @override final String projectId; @override - final bool public; + final bool? public; @override - final GProjectState state; + final GProjectState? state; factory _$GUpdateProjectInput( - [void Function(GUpdateProjectInputBuilder) updates]) => + [void Function(GUpdateProjectInputBuilder)? updates]) => (new GUpdateProjectInputBuilder()..update(updates)).build(); _$GUpdateProjectInput._( {this.body, this.clientMutationId, this.name, - this.projectId, + required this.projectId, this.public, this.state}) : super._() { - if (projectId == null) { - throw new BuiltValueNullFieldError('GUpdateProjectInput', 'projectId'); - } + BuiltValueNullFieldError.checkNotNull( + projectId, 'GUpdateProjectInput', 'projectId'); } @override @@ -33424,43 +33808,44 @@ class _$GUpdateProjectInput extends GUpdateProjectInput { class GUpdateProjectInputBuilder implements Builder { - _$GUpdateProjectInput _$v; + _$GUpdateProjectInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _projectId; - String get projectId => _$this._projectId; - set projectId(String projectId) => _$this._projectId = projectId; + String? _projectId; + String? get projectId => _$this._projectId; + set projectId(String? projectId) => _$this._projectId = projectId; - bool _public; - bool get public => _$this._public; - set public(bool public) => _$this._public = public; + bool? _public; + bool? get public => _$this._public; + set public(bool? public) => _$this._public = public; - GProjectState _state; - GProjectState get state => _$this._state; - set state(GProjectState state) => _$this._state = state; + GProjectState? _state; + GProjectState? get state => _$this._state; + set state(GProjectState? state) => _$this._state = state; GUpdateProjectInputBuilder(); GUpdateProjectInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _name = _$v.name; - _projectId = _$v.projectId; - _public = _$v.public; - _state = _$v.state; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _name = $v.name; + _projectId = $v.projectId; + _public = $v.public; + _state = $v.state; _$v = null; } return this; @@ -33468,14 +33853,12 @@ class GUpdateProjectInputBuilder @override void replace(GUpdateProjectInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateProjectInput; } @override - void update(void Function(GUpdateProjectInputBuilder) updates) { + void update(void Function(GUpdateProjectInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33486,7 +33869,8 @@ class GUpdateProjectInputBuilder body: body, clientMutationId: clientMutationId, name: name, - projectId: projectId, + projectId: BuiltValueNullFieldError.checkNotNull( + projectId, 'GUpdateProjectInput', 'projectId'), public: public, state: state); replace(_$result); @@ -33496,30 +33880,30 @@ class GUpdateProjectInputBuilder class _$GUpdatePullRequestInput extends GUpdatePullRequestInput { @override - final BuiltList assigneeIds; + final BuiltList? assigneeIds; @override - final String baseRefName; + final String? baseRefName; @override - final String body; + final String? body; @override - final String clientMutationId; + final String? clientMutationId; @override - final BuiltList labelIds; + final BuiltList? labelIds; @override - final bool maintainerCanModify; + final bool? maintainerCanModify; @override - final String milestoneId; + final String? milestoneId; @override - final BuiltList projectIds; + final BuiltList? projectIds; @override final String pullRequestId; @override - final GPullRequestUpdateState state; + final GPullRequestUpdateState? state; @override - final String title; + final String? title; factory _$GUpdatePullRequestInput( - [void Function(GUpdatePullRequestInputBuilder) updates]) => + [void Function(GUpdatePullRequestInputBuilder)? updates]) => (new GUpdatePullRequestInputBuilder()..update(updates)).build(); _$GUpdatePullRequestInput._( @@ -33531,25 +33915,12 @@ class _$GUpdatePullRequestInput extends GUpdatePullRequestInput { this.maintainerCanModify, this.milestoneId, this.projectIds, - this.pullRequestId, + required this.pullRequestId, this.state, this.title}) : super._() { - if (assigneeIds == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestInput', 'assigneeIds'); - } - if (labelIds == null) { - throw new BuiltValueNullFieldError('GUpdatePullRequestInput', 'labelIds'); - } - if (projectIds == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestInput', 'projectIds'); - } - if (pullRequestId == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestInput', 'pullRequestId'); - } + BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GUpdatePullRequestInput', 'pullRequestId'); } @override @@ -33623,75 +33994,76 @@ class _$GUpdatePullRequestInput extends GUpdatePullRequestInput { class GUpdatePullRequestInputBuilder implements Builder { - _$GUpdatePullRequestInput _$v; + _$GUpdatePullRequestInput? _$v; - ListBuilder _assigneeIds; + ListBuilder? _assigneeIds; ListBuilder get assigneeIds => _$this._assigneeIds ??= new ListBuilder(); - set assigneeIds(ListBuilder assigneeIds) => + set assigneeIds(ListBuilder? assigneeIds) => _$this._assigneeIds = assigneeIds; - String _baseRefName; - String get baseRefName => _$this._baseRefName; - set baseRefName(String baseRefName) => _$this._baseRefName = baseRefName; + String? _baseRefName; + String? get baseRefName => _$this._baseRefName; + set baseRefName(String? baseRefName) => _$this._baseRefName = baseRefName; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - ListBuilder _labelIds; + ListBuilder? _labelIds; ListBuilder get labelIds => _$this._labelIds ??= new ListBuilder(); - set labelIds(ListBuilder labelIds) => _$this._labelIds = labelIds; + set labelIds(ListBuilder? labelIds) => _$this._labelIds = labelIds; - bool _maintainerCanModify; - bool get maintainerCanModify => _$this._maintainerCanModify; - set maintainerCanModify(bool maintainerCanModify) => + bool? _maintainerCanModify; + bool? get maintainerCanModify => _$this._maintainerCanModify; + set maintainerCanModify(bool? maintainerCanModify) => _$this._maintainerCanModify = maintainerCanModify; - String _milestoneId; - String get milestoneId => _$this._milestoneId; - set milestoneId(String milestoneId) => _$this._milestoneId = milestoneId; + String? _milestoneId; + String? get milestoneId => _$this._milestoneId; + set milestoneId(String? milestoneId) => _$this._milestoneId = milestoneId; - ListBuilder _projectIds; + ListBuilder? _projectIds; ListBuilder get projectIds => _$this._projectIds ??= new ListBuilder(); - set projectIds(ListBuilder projectIds) => + set projectIds(ListBuilder? projectIds) => _$this._projectIds = projectIds; - String _pullRequestId; - String get pullRequestId => _$this._pullRequestId; - set pullRequestId(String pullRequestId) => + String? _pullRequestId; + String? get pullRequestId => _$this._pullRequestId; + set pullRequestId(String? pullRequestId) => _$this._pullRequestId = pullRequestId; - GPullRequestUpdateState _state; - GPullRequestUpdateState get state => _$this._state; - set state(GPullRequestUpdateState state) => _$this._state = state; + GPullRequestUpdateState? _state; + GPullRequestUpdateState? get state => _$this._state; + set state(GPullRequestUpdateState? state) => _$this._state = state; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GUpdatePullRequestInputBuilder(); GUpdatePullRequestInputBuilder get _$this { - if (_$v != null) { - _assigneeIds = _$v.assigneeIds?.toBuilder(); - _baseRefName = _$v.baseRefName; - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _labelIds = _$v.labelIds?.toBuilder(); - _maintainerCanModify = _$v.maintainerCanModify; - _milestoneId = _$v.milestoneId; - _projectIds = _$v.projectIds?.toBuilder(); - _pullRequestId = _$v.pullRequestId; - _state = _$v.state; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _assigneeIds = $v.assigneeIds?.toBuilder(); + _baseRefName = $v.baseRefName; + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _labelIds = $v.labelIds?.toBuilder(); + _maintainerCanModify = $v.maintainerCanModify; + _milestoneId = $v.milestoneId; + _projectIds = $v.projectIds?.toBuilder(); + _pullRequestId = $v.pullRequestId; + _state = $v.state; + _title = $v.title; _$v = null; } return this; @@ -33699,14 +34071,12 @@ class GUpdatePullRequestInputBuilder @override void replace(GUpdatePullRequestInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdatePullRequestInput; } @override - void update(void Function(GUpdatePullRequestInputBuilder) updates) { + void update(void Function(GUpdatePullRequestInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33716,28 +34086,29 @@ class GUpdatePullRequestInputBuilder try { _$result = _$v ?? new _$GUpdatePullRequestInput._( - assigneeIds: assigneeIds.build(), + assigneeIds: _assigneeIds?.build(), baseRefName: baseRefName, body: body, clientMutationId: clientMutationId, - labelIds: labelIds.build(), + labelIds: _labelIds?.build(), maintainerCanModify: maintainerCanModify, milestoneId: milestoneId, - projectIds: projectIds.build(), - pullRequestId: pullRequestId, + projectIds: _projectIds?.build(), + pullRequestId: BuiltValueNullFieldError.checkNotNull( + pullRequestId, 'GUpdatePullRequestInput', 'pullRequestId'), state: state, title: title); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'assigneeIds'; - assigneeIds.build(); + _assigneeIds?.build(); _$failedField = 'labelIds'; - labelIds.build(); + _labelIds?.build(); _$failedField = 'projectIds'; - projectIds.build(); + _projectIds?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'GUpdatePullRequestInput', _$failedField, e.toString()); @@ -33754,27 +34125,25 @@ class _$GUpdatePullRequestReviewCommentInput @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override final String pullRequestReviewCommentId; factory _$GUpdatePullRequestReviewCommentInput( - [void Function(GUpdatePullRequestReviewCommentInputBuilder) + [void Function(GUpdatePullRequestReviewCommentInputBuilder)? updates]) => (new GUpdatePullRequestReviewCommentInputBuilder()..update(updates)) .build(); _$GUpdatePullRequestReviewCommentInput._( - {this.body, this.clientMutationId, this.pullRequestReviewCommentId}) + {required this.body, + this.clientMutationId, + required this.pullRequestReviewCommentId}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestReviewCommentInput', 'body'); - } - if (pullRequestReviewCommentId == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestReviewCommentInput', 'pullRequestReviewCommentId'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GUpdatePullRequestReviewCommentInput', 'body'); + BuiltValueNullFieldError.checkNotNull(pullRequestReviewCommentId, + 'GUpdatePullRequestReviewCommentInput', 'pullRequestReviewCommentId'); } @override @@ -33815,29 +34184,30 @@ class GUpdatePullRequestReviewCommentInputBuilder implements Builder { - _$GUpdatePullRequestReviewCommentInput _$v; + _$GUpdatePullRequestReviewCommentInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _pullRequestReviewCommentId; - String get pullRequestReviewCommentId => _$this._pullRequestReviewCommentId; - set pullRequestReviewCommentId(String pullRequestReviewCommentId) => + String? _pullRequestReviewCommentId; + String? get pullRequestReviewCommentId => _$this._pullRequestReviewCommentId; + set pullRequestReviewCommentId(String? pullRequestReviewCommentId) => _$this._pullRequestReviewCommentId = pullRequestReviewCommentId; GUpdatePullRequestReviewCommentInputBuilder(); GUpdatePullRequestReviewCommentInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _pullRequestReviewCommentId = _$v.pullRequestReviewCommentId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _pullRequestReviewCommentId = $v.pullRequestReviewCommentId; _$v = null; } return this; @@ -33845,15 +34215,13 @@ class GUpdatePullRequestReviewCommentInputBuilder @override void replace(GUpdatePullRequestReviewCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdatePullRequestReviewCommentInput; } @override void update( - void Function(GUpdatePullRequestReviewCommentInputBuilder) updates) { + void Function(GUpdatePullRequestReviewCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33861,9 +34229,13 @@ class GUpdatePullRequestReviewCommentInputBuilder _$GUpdatePullRequestReviewCommentInput build() { final _$result = _$v ?? new _$GUpdatePullRequestReviewCommentInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GUpdatePullRequestReviewCommentInput', 'body'), clientMutationId: clientMutationId, - pullRequestReviewCommentId: pullRequestReviewCommentId); + pullRequestReviewCommentId: BuiltValueNullFieldError.checkNotNull( + pullRequestReviewCommentId, + 'GUpdatePullRequestReviewCommentInput', + 'pullRequestReviewCommentId')); replace(_$result); return _$result; } @@ -33873,25 +34245,23 @@ class _$GUpdatePullRequestReviewInput extends GUpdatePullRequestReviewInput { @override final String body; @override - final String clientMutationId; + final String? clientMutationId; @override final String pullRequestReviewId; factory _$GUpdatePullRequestReviewInput( - [void Function(GUpdatePullRequestReviewInputBuilder) updates]) => + [void Function(GUpdatePullRequestReviewInputBuilder)? updates]) => (new GUpdatePullRequestReviewInputBuilder()..update(updates)).build(); _$GUpdatePullRequestReviewInput._( - {this.body, this.clientMutationId, this.pullRequestReviewId}) + {required this.body, + this.clientMutationId, + required this.pullRequestReviewId}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestReviewInput', 'body'); - } - if (pullRequestReviewId == null) { - throw new BuiltValueNullFieldError( - 'GUpdatePullRequestReviewInput', 'pullRequestReviewId'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GUpdatePullRequestReviewInput', 'body'); + BuiltValueNullFieldError.checkNotNull(pullRequestReviewId, + 'GUpdatePullRequestReviewInput', 'pullRequestReviewId'); } @override @@ -33932,29 +34302,30 @@ class GUpdatePullRequestReviewInputBuilder implements Builder { - _$GUpdatePullRequestReviewInput _$v; + _$GUpdatePullRequestReviewInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _pullRequestReviewId; - String get pullRequestReviewId => _$this._pullRequestReviewId; - set pullRequestReviewId(String pullRequestReviewId) => + String? _pullRequestReviewId; + String? get pullRequestReviewId => _$this._pullRequestReviewId; + set pullRequestReviewId(String? pullRequestReviewId) => _$this._pullRequestReviewId = pullRequestReviewId; GUpdatePullRequestReviewInputBuilder(); GUpdatePullRequestReviewInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _clientMutationId = _$v.clientMutationId; - _pullRequestReviewId = _$v.pullRequestReviewId; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _clientMutationId = $v.clientMutationId; + _pullRequestReviewId = $v.pullRequestReviewId; _$v = null; } return this; @@ -33962,14 +34333,12 @@ class GUpdatePullRequestReviewInputBuilder @override void replace(GUpdatePullRequestReviewInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdatePullRequestReviewInput; } @override - void update(void Function(GUpdatePullRequestReviewInputBuilder) updates) { + void update(void Function(GUpdatePullRequestReviewInputBuilder)? updates) { if (updates != null) updates(this); } @@ -33977,9 +34346,13 @@ class GUpdatePullRequestReviewInputBuilder _$GUpdatePullRequestReviewInput build() { final _$result = _$v ?? new _$GUpdatePullRequestReviewInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GUpdatePullRequestReviewInput', 'body'), clientMutationId: clientMutationId, - pullRequestReviewId: pullRequestReviewId); + pullRequestReviewId: BuiltValueNullFieldError.checkNotNull( + pullRequestReviewId, + 'GUpdatePullRequestReviewInput', + 'pullRequestReviewId')); replace(_$result); return _$result; } @@ -33987,25 +34360,25 @@ class GUpdatePullRequestReviewInputBuilder class _$GUpdateRefInput extends GUpdateRefInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final bool force; + final bool? force; @override final GGitObjectID oid; @override final String refId; - factory _$GUpdateRefInput([void Function(GUpdateRefInputBuilder) updates]) => + factory _$GUpdateRefInput([void Function(GUpdateRefInputBuilder)? updates]) => (new GUpdateRefInputBuilder()..update(updates)).build(); - _$GUpdateRefInput._({this.clientMutationId, this.force, this.oid, this.refId}) + _$GUpdateRefInput._( + {this.clientMutationId, + this.force, + required this.oid, + required this.refId}) : super._() { - if (oid == null) { - throw new BuiltValueNullFieldError('GUpdateRefInput', 'oid'); - } - if (refId == null) { - throw new BuiltValueNullFieldError('GUpdateRefInput', 'refId'); - } + BuiltValueNullFieldError.checkNotNull(oid, 'GUpdateRefInput', 'oid'); + BuiltValueNullFieldError.checkNotNull(refId, 'GUpdateRefInput', 'refId'); } @override @@ -34047,33 +34420,34 @@ class _$GUpdateRefInput extends GUpdateRefInput { class GUpdateRefInputBuilder implements Builder { - _$GUpdateRefInput _$v; + _$GUpdateRefInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - bool _force; - bool get force => _$this._force; - set force(bool force) => _$this._force = force; + bool? _force; + bool? get force => _$this._force; + set force(bool? force) => _$this._force = force; - GGitObjectIDBuilder _oid; + GGitObjectIDBuilder? _oid; GGitObjectIDBuilder get oid => _$this._oid ??= new GGitObjectIDBuilder(); - set oid(GGitObjectIDBuilder oid) => _$this._oid = oid; + set oid(GGitObjectIDBuilder? oid) => _$this._oid = oid; - String _refId; - String get refId => _$this._refId; - set refId(String refId) => _$this._refId = refId; + String? _refId; + String? get refId => _$this._refId; + set refId(String? refId) => _$this._refId = refId; GUpdateRefInputBuilder(); GUpdateRefInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _force = _$v.force; - _oid = _$v.oid?.toBuilder(); - _refId = _$v.refId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _force = $v.force; + _oid = $v.oid.toBuilder(); + _refId = $v.refId; _$v = null; } return this; @@ -34081,14 +34455,12 @@ class GUpdateRefInputBuilder @override void replace(GUpdateRefInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateRefInput; } @override - void update(void Function(GUpdateRefInputBuilder) updates) { + void update(void Function(GUpdateRefInputBuilder)? updates) { if (updates != null) updates(this); } @@ -34101,9 +34473,10 @@ class GUpdateRefInputBuilder clientMutationId: clientMutationId, force: force, oid: oid.build(), - refId: refId); + refId: BuiltValueNullFieldError.checkNotNull( + refId, 'GUpdateRefInput', 'refId')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'oid'; oid.build(); @@ -34120,26 +34493,26 @@ class GUpdateRefInputBuilder class _$GUpdateRepositoryInput extends GUpdateRepositoryInput { @override - final String clientMutationId; + final String? clientMutationId; @override - final String description; + final String? description; @override - final bool hasIssuesEnabled; + final bool? hasIssuesEnabled; @override - final bool hasProjectsEnabled; + final bool? hasProjectsEnabled; @override - final bool hasWikiEnabled; + final bool? hasWikiEnabled; @override - final GURI homepageUrl; + final GURI? homepageUrl; @override - final String name; + final String? name; @override final String repositoryId; @override - final bool template; + final bool? template; factory _$GUpdateRepositoryInput( - [void Function(GUpdateRepositoryInputBuilder) updates]) => + [void Function(GUpdateRepositoryInputBuilder)? updates]) => (new GUpdateRepositoryInputBuilder()..update(updates)).build(); _$GUpdateRepositoryInput._( @@ -34150,13 +34523,11 @@ class _$GUpdateRepositoryInput extends GUpdateRepositoryInput { this.hasWikiEnabled, this.homepageUrl, this.name, - this.repositoryId, + required this.repositoryId, this.template}) : super._() { - if (repositoryId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateRepositoryInput', 'repositoryId'); - } + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUpdateRepositoryInput', 'repositoryId'); } @override @@ -34221,61 +34592,63 @@ class _$GUpdateRepositoryInput extends GUpdateRepositoryInput { class GUpdateRepositoryInputBuilder implements Builder { - _$GUpdateRepositoryInput _$v; + _$GUpdateRepositoryInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _description; - String get description => _$this._description; - set description(String description) => _$this._description = description; + String? _description; + String? get description => _$this._description; + set description(String? description) => _$this._description = description; - bool _hasIssuesEnabled; - bool get hasIssuesEnabled => _$this._hasIssuesEnabled; - set hasIssuesEnabled(bool hasIssuesEnabled) => + bool? _hasIssuesEnabled; + bool? get hasIssuesEnabled => _$this._hasIssuesEnabled; + set hasIssuesEnabled(bool? hasIssuesEnabled) => _$this._hasIssuesEnabled = hasIssuesEnabled; - bool _hasProjectsEnabled; - bool get hasProjectsEnabled => _$this._hasProjectsEnabled; - set hasProjectsEnabled(bool hasProjectsEnabled) => + bool? _hasProjectsEnabled; + bool? get hasProjectsEnabled => _$this._hasProjectsEnabled; + set hasProjectsEnabled(bool? hasProjectsEnabled) => _$this._hasProjectsEnabled = hasProjectsEnabled; - bool _hasWikiEnabled; - bool get hasWikiEnabled => _$this._hasWikiEnabled; - set hasWikiEnabled(bool hasWikiEnabled) => + bool? _hasWikiEnabled; + bool? get hasWikiEnabled => _$this._hasWikiEnabled; + set hasWikiEnabled(bool? hasWikiEnabled) => _$this._hasWikiEnabled = hasWikiEnabled; - GURIBuilder _homepageUrl; + GURIBuilder? _homepageUrl; GURIBuilder get homepageUrl => _$this._homepageUrl ??= new GURIBuilder(); - set homepageUrl(GURIBuilder homepageUrl) => _$this._homepageUrl = homepageUrl; + set homepageUrl(GURIBuilder? homepageUrl) => + _$this._homepageUrl = homepageUrl; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - bool _template; - bool get template => _$this._template; - set template(bool template) => _$this._template = template; + bool? _template; + bool? get template => _$this._template; + set template(bool? template) => _$this._template = template; GUpdateRepositoryInputBuilder(); GUpdateRepositoryInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _description = _$v.description; - _hasIssuesEnabled = _$v.hasIssuesEnabled; - _hasProjectsEnabled = _$v.hasProjectsEnabled; - _hasWikiEnabled = _$v.hasWikiEnabled; - _homepageUrl = _$v.homepageUrl?.toBuilder(); - _name = _$v.name; - _repositoryId = _$v.repositoryId; - _template = _$v.template; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _description = $v.description; + _hasIssuesEnabled = $v.hasIssuesEnabled; + _hasProjectsEnabled = $v.hasProjectsEnabled; + _hasWikiEnabled = $v.hasWikiEnabled; + _homepageUrl = $v.homepageUrl?.toBuilder(); + _name = $v.name; + _repositoryId = $v.repositoryId; + _template = $v.template; _$v = null; } return this; @@ -34283,14 +34656,12 @@ class GUpdateRepositoryInputBuilder @override void replace(GUpdateRepositoryInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateRepositoryInput; } @override - void update(void Function(GUpdateRepositoryInputBuilder) updates) { + void update(void Function(GUpdateRepositoryInputBuilder)? updates) { if (updates != null) updates(this); } @@ -34307,10 +34678,11 @@ class GUpdateRepositoryInputBuilder hasWikiEnabled: hasWikiEnabled, homepageUrl: _homepageUrl?.build(), name: name, - repositoryId: repositoryId, + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUpdateRepositoryInput', 'repositoryId'), template: template); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'homepageUrl'; _homepageUrl?.build(); @@ -34327,26 +34699,25 @@ class GUpdateRepositoryInputBuilder class _$GUpdateSubscriptionInput extends GUpdateSubscriptionInput { @override - final String clientMutationId; + final String? clientMutationId; @override final GSubscriptionState state; @override final String subscribableId; factory _$GUpdateSubscriptionInput( - [void Function(GUpdateSubscriptionInputBuilder) updates]) => + [void Function(GUpdateSubscriptionInputBuilder)? updates]) => (new GUpdateSubscriptionInputBuilder()..update(updates)).build(); _$GUpdateSubscriptionInput._( - {this.clientMutationId, this.state, this.subscribableId}) + {this.clientMutationId, + required this.state, + required this.subscribableId}) : super._() { - if (state == null) { - throw new BuiltValueNullFieldError('GUpdateSubscriptionInput', 'state'); - } - if (subscribableId == null) { - throw new BuiltValueNullFieldError( - 'GUpdateSubscriptionInput', 'subscribableId'); - } + BuiltValueNullFieldError.checkNotNull( + state, 'GUpdateSubscriptionInput', 'state'); + BuiltValueNullFieldError.checkNotNull( + subscribableId, 'GUpdateSubscriptionInput', 'subscribableId'); } @override @@ -34386,29 +34757,30 @@ class _$GUpdateSubscriptionInput extends GUpdateSubscriptionInput { class GUpdateSubscriptionInputBuilder implements Builder { - _$GUpdateSubscriptionInput _$v; + _$GUpdateSubscriptionInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - GSubscriptionState _state; - GSubscriptionState get state => _$this._state; - set state(GSubscriptionState state) => _$this._state = state; + GSubscriptionState? _state; + GSubscriptionState? get state => _$this._state; + set state(GSubscriptionState? state) => _$this._state = state; - String _subscribableId; - String get subscribableId => _$this._subscribableId; - set subscribableId(String subscribableId) => + String? _subscribableId; + String? get subscribableId => _$this._subscribableId; + set subscribableId(String? subscribableId) => _$this._subscribableId = subscribableId; GUpdateSubscriptionInputBuilder(); GUpdateSubscriptionInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _state = _$v.state; - _subscribableId = _$v.subscribableId; + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _state = $v.state; + _subscribableId = $v.subscribableId; _$v = null; } return this; @@ -34416,14 +34788,12 @@ class GUpdateSubscriptionInputBuilder @override void replace(GUpdateSubscriptionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateSubscriptionInput; } @override - void update(void Function(GUpdateSubscriptionInputBuilder) updates) { + void update(void Function(GUpdateSubscriptionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -34432,8 +34802,10 @@ class GUpdateSubscriptionInputBuilder final _$result = _$v ?? new _$GUpdateSubscriptionInput._( clientMutationId: clientMutationId, - state: state, - subscribableId: subscribableId); + state: BuiltValueNullFieldError.checkNotNull( + state, 'GUpdateSubscriptionInput', 'state'), + subscribableId: BuiltValueNullFieldError.checkNotNull( + subscribableId, 'GUpdateSubscriptionInput', 'subscribableId')); replace(_$result); return _$result; } @@ -34444,27 +34816,26 @@ class _$GUpdateTeamDiscussionCommentInput @override final String body; @override - final String bodyVersion; + final String? bodyVersion; @override - final String clientMutationId; + final String? clientMutationId; @override final String id; factory _$GUpdateTeamDiscussionCommentInput( - [void Function(GUpdateTeamDiscussionCommentInputBuilder) updates]) => + [void Function(GUpdateTeamDiscussionCommentInputBuilder)? updates]) => (new GUpdateTeamDiscussionCommentInputBuilder()..update(updates)).build(); _$GUpdateTeamDiscussionCommentInput._( - {this.body, this.bodyVersion, this.clientMutationId, this.id}) + {required this.body, + this.bodyVersion, + this.clientMutationId, + required this.id}) : super._() { - if (body == null) { - throw new BuiltValueNullFieldError( - 'GUpdateTeamDiscussionCommentInput', 'body'); - } - if (id == null) { - throw new BuiltValueNullFieldError( - 'GUpdateTeamDiscussionCommentInput', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + body, 'GUpdateTeamDiscussionCommentInput', 'body'); + BuiltValueNullFieldError.checkNotNull( + id, 'GUpdateTeamDiscussionCommentInput', 'id'); } @override @@ -34509,33 +34880,34 @@ class GUpdateTeamDiscussionCommentInputBuilder implements Builder { - _$GUpdateTeamDiscussionCommentInput _$v; + _$GUpdateTeamDiscussionCommentInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _bodyVersion; - String get bodyVersion => _$this._bodyVersion; - set bodyVersion(String bodyVersion) => _$this._bodyVersion = bodyVersion; + String? _bodyVersion; + String? get bodyVersion => _$this._bodyVersion; + set bodyVersion(String? bodyVersion) => _$this._bodyVersion = bodyVersion; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; GUpdateTeamDiscussionCommentInputBuilder(); GUpdateTeamDiscussionCommentInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _bodyVersion = _$v.bodyVersion; - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _bodyVersion = $v.bodyVersion; + _clientMutationId = $v.clientMutationId; + _id = $v.id; _$v = null; } return this; @@ -34543,14 +34915,13 @@ class GUpdateTeamDiscussionCommentInputBuilder @override void replace(GUpdateTeamDiscussionCommentInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateTeamDiscussionCommentInput; } @override - void update(void Function(GUpdateTeamDiscussionCommentInputBuilder) updates) { + void update( + void Function(GUpdateTeamDiscussionCommentInputBuilder)? updates) { if (updates != null) updates(this); } @@ -34558,10 +34929,12 @@ class GUpdateTeamDiscussionCommentInputBuilder _$GUpdateTeamDiscussionCommentInput build() { final _$result = _$v ?? new _$GUpdateTeamDiscussionCommentInput._( - body: body, + body: BuiltValueNullFieldError.checkNotNull( + body, 'GUpdateTeamDiscussionCommentInput', 'body'), bodyVersion: bodyVersion, clientMutationId: clientMutationId, - id: id); + id: BuiltValueNullFieldError.checkNotNull( + id, 'GUpdateTeamDiscussionCommentInput', 'id')); replace(_$result); return _$result; } @@ -34569,33 +34942,32 @@ class GUpdateTeamDiscussionCommentInputBuilder class _$GUpdateTeamDiscussionInput extends GUpdateTeamDiscussionInput { @override - final String body; + final String? body; @override - final String bodyVersion; + final String? bodyVersion; @override - final String clientMutationId; + final String? clientMutationId; @override final String id; @override - final bool pinned; + final bool? pinned; @override - final String title; + final String? title; factory _$GUpdateTeamDiscussionInput( - [void Function(GUpdateTeamDiscussionInputBuilder) updates]) => + [void Function(GUpdateTeamDiscussionInputBuilder)? updates]) => (new GUpdateTeamDiscussionInputBuilder()..update(updates)).build(); _$GUpdateTeamDiscussionInput._( {this.body, this.bodyVersion, this.clientMutationId, - this.id, + required this.id, this.pinned, this.title}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('GUpdateTeamDiscussionInput', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + id, 'GUpdateTeamDiscussionInput', 'id'); } @override @@ -34647,43 +35019,44 @@ class _$GUpdateTeamDiscussionInput extends GUpdateTeamDiscussionInput { class GUpdateTeamDiscussionInputBuilder implements Builder { - _$GUpdateTeamDiscussionInput _$v; + _$GUpdateTeamDiscussionInput? _$v; - String _body; - String get body => _$this._body; - set body(String body) => _$this._body = body; + String? _body; + String? get body => _$this._body; + set body(String? body) => _$this._body = body; - String _bodyVersion; - String get bodyVersion => _$this._bodyVersion; - set bodyVersion(String bodyVersion) => _$this._bodyVersion = bodyVersion; + String? _bodyVersion; + String? get bodyVersion => _$this._bodyVersion; + set bodyVersion(String? bodyVersion) => _$this._bodyVersion = bodyVersion; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - bool _pinned; - bool get pinned => _$this._pinned; - set pinned(bool pinned) => _$this._pinned = pinned; + bool? _pinned; + bool? get pinned => _$this._pinned; + set pinned(bool? pinned) => _$this._pinned = pinned; - String _title; - String get title => _$this._title; - set title(String title) => _$this._title = title; + String? _title; + String? get title => _$this._title; + set title(String? title) => _$this._title = title; GUpdateTeamDiscussionInputBuilder(); GUpdateTeamDiscussionInputBuilder get _$this { - if (_$v != null) { - _body = _$v.body; - _bodyVersion = _$v.bodyVersion; - _clientMutationId = _$v.clientMutationId; - _id = _$v.id; - _pinned = _$v.pinned; - _title = _$v.title; + final $v = _$v; + if ($v != null) { + _body = $v.body; + _bodyVersion = $v.bodyVersion; + _clientMutationId = $v.clientMutationId; + _id = $v.id; + _pinned = $v.pinned; + _title = $v.title; _$v = null; } return this; @@ -34691,14 +35064,12 @@ class GUpdateTeamDiscussionInputBuilder @override void replace(GUpdateTeamDiscussionInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateTeamDiscussionInput; } @override - void update(void Function(GUpdateTeamDiscussionInputBuilder) updates) { + void update(void Function(GUpdateTeamDiscussionInputBuilder)? updates) { if (updates != null) updates(this); } @@ -34709,7 +35080,8 @@ class GUpdateTeamDiscussionInputBuilder body: body, bodyVersion: bodyVersion, clientMutationId: clientMutationId, - id: id, + id: BuiltValueNullFieldError.checkNotNull( + id, 'GUpdateTeamDiscussionInput', 'id'), pinned: pinned, title: title); replace(_$result); @@ -34719,25 +35091,25 @@ class GUpdateTeamDiscussionInputBuilder class _$GUpdateTopicsInput extends GUpdateTopicsInput { @override - final String clientMutationId; + final String? clientMutationId; @override final String repositoryId; @override final BuiltList topicNames; factory _$GUpdateTopicsInput( - [void Function(GUpdateTopicsInputBuilder) updates]) => + [void Function(GUpdateTopicsInputBuilder)? updates]) => (new GUpdateTopicsInputBuilder()..update(updates)).build(); _$GUpdateTopicsInput._( - {this.clientMutationId, this.repositoryId, this.topicNames}) + {this.clientMutationId, + required this.repositoryId, + required this.topicNames}) : super._() { - if (repositoryId == null) { - throw new BuiltValueNullFieldError('GUpdateTopicsInput', 'repositoryId'); - } - if (topicNames == null) { - throw new BuiltValueNullFieldError('GUpdateTopicsInput', 'topicNames'); - } + BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUpdateTopicsInput', 'repositoryId'); + BuiltValueNullFieldError.checkNotNull( + topicNames, 'GUpdateTopicsInput', 'topicNames'); } @override @@ -34777,30 +35149,31 @@ class _$GUpdateTopicsInput extends GUpdateTopicsInput { class GUpdateTopicsInputBuilder implements Builder { - _$GUpdateTopicsInput _$v; + _$GUpdateTopicsInput? _$v; - String _clientMutationId; - String get clientMutationId => _$this._clientMutationId; - set clientMutationId(String clientMutationId) => + String? _clientMutationId; + String? get clientMutationId => _$this._clientMutationId; + set clientMutationId(String? clientMutationId) => _$this._clientMutationId = clientMutationId; - String _repositoryId; - String get repositoryId => _$this._repositoryId; - set repositoryId(String repositoryId) => _$this._repositoryId = repositoryId; + String? _repositoryId; + String? get repositoryId => _$this._repositoryId; + set repositoryId(String? repositoryId) => _$this._repositoryId = repositoryId; - ListBuilder _topicNames; + ListBuilder? _topicNames; ListBuilder get topicNames => _$this._topicNames ??= new ListBuilder(); - set topicNames(ListBuilder topicNames) => + set topicNames(ListBuilder? topicNames) => _$this._topicNames = topicNames; GUpdateTopicsInputBuilder(); GUpdateTopicsInputBuilder get _$this { - if (_$v != null) { - _clientMutationId = _$v.clientMutationId; - _repositoryId = _$v.repositoryId; - _topicNames = _$v.topicNames?.toBuilder(); + final $v = _$v; + if ($v != null) { + _clientMutationId = $v.clientMutationId; + _repositoryId = $v.repositoryId; + _topicNames = $v.topicNames.toBuilder(); _$v = null; } return this; @@ -34808,14 +35181,12 @@ class GUpdateTopicsInputBuilder @override void replace(GUpdateTopicsInput other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUpdateTopicsInput; } @override - void update(void Function(GUpdateTopicsInputBuilder) updates) { + void update(void Function(GUpdateTopicsInputBuilder)? updates) { if (updates != null) updates(this); } @@ -34826,10 +35197,11 @@ class GUpdateTopicsInputBuilder _$result = _$v ?? new _$GUpdateTopicsInput._( clientMutationId: clientMutationId, - repositoryId: repositoryId, + repositoryId: BuiltValueNullFieldError.checkNotNull( + repositoryId, 'GUpdateTopicsInput', 'repositoryId'), topicNames: topicNames.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'topicNames'; topicNames.build(); @@ -34851,16 +35223,14 @@ class _$GUserStatusOrder extends GUserStatusOrder { final GUserStatusOrderField field; factory _$GUserStatusOrder( - [void Function(GUserStatusOrderBuilder) updates]) => + [void Function(GUserStatusOrderBuilder)? updates]) => (new GUserStatusOrderBuilder()..update(updates)).build(); - _$GUserStatusOrder._({this.direction, this.field}) : super._() { - if (direction == null) { - throw new BuiltValueNullFieldError('GUserStatusOrder', 'direction'); - } - if (field == null) { - throw new BuiltValueNullFieldError('GUserStatusOrder', 'field'); - } + _$GUserStatusOrder._({required this.direction, required this.field}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + direction, 'GUserStatusOrder', 'direction'); + BuiltValueNullFieldError.checkNotNull(field, 'GUserStatusOrder', 'field'); } @override @@ -34895,22 +35265,23 @@ class _$GUserStatusOrder extends GUserStatusOrder { class GUserStatusOrderBuilder implements Builder { - _$GUserStatusOrder _$v; + _$GUserStatusOrder? _$v; - GOrderDirection _direction; - GOrderDirection get direction => _$this._direction; - set direction(GOrderDirection direction) => _$this._direction = direction; + GOrderDirection? _direction; + GOrderDirection? get direction => _$this._direction; + set direction(GOrderDirection? direction) => _$this._direction = direction; - GUserStatusOrderField _field; - GUserStatusOrderField get field => _$this._field; - set field(GUserStatusOrderField field) => _$this._field = field; + GUserStatusOrderField? _field; + GUserStatusOrderField? get field => _$this._field; + set field(GUserStatusOrderField? field) => _$this._field = field; GUserStatusOrderBuilder(); GUserStatusOrderBuilder get _$this { - if (_$v != null) { - _direction = _$v.direction; - _field = _$v.field; + final $v = _$v; + if ($v != null) { + _direction = $v.direction; + _field = $v.field; _$v = null; } return this; @@ -34918,21 +35289,23 @@ class GUserStatusOrderBuilder @override void replace(GUserStatusOrder other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GUserStatusOrder; } @override - void update(void Function(GUserStatusOrderBuilder) updates) { + void update(void Function(GUserStatusOrderBuilder)? updates) { if (updates != null) updates(this); } @override _$GUserStatusOrder build() { - final _$result = - _$v ?? new _$GUserStatusOrder._(direction: direction, field: field); + final _$result = _$v ?? + new _$GUserStatusOrder._( + direction: BuiltValueNullFieldError.checkNotNull( + direction, 'GUserStatusOrder', 'direction'), + field: BuiltValueNullFieldError.checkNotNull( + field, 'GUserStatusOrder', 'field')); replace(_$result); return _$result; } @@ -34943,13 +35316,11 @@ class _$GX509Certificate extends GX509Certificate { final String value; factory _$GX509Certificate( - [void Function(GX509CertificateBuilder) updates]) => + [void Function(GX509CertificateBuilder)? updates]) => (new GX509CertificateBuilder()..update(updates)).build(); - _$GX509Certificate._({this.value}) : super._() { - if (value == null) { - throw new BuiltValueNullFieldError('GX509Certificate', 'value'); - } + _$GX509Certificate._({required this.value}) : super._() { + BuiltValueNullFieldError.checkNotNull(value, 'GX509Certificate', 'value'); } @override @@ -34981,17 +35352,18 @@ class _$GX509Certificate extends GX509Certificate { class GX509CertificateBuilder implements Builder { - _$GX509Certificate _$v; + _$GX509Certificate? _$v; - String _value; - String get value => _$this._value; - set value(String value) => _$this._value = value; + String? _value; + String? get value => _$this._value; + set value(String? value) => _$this._value = value; GX509CertificateBuilder(); GX509CertificateBuilder get _$this { - if (_$v != null) { - _value = _$v.value; + final $v = _$v; + if ($v != null) { + _value = $v.value; _$v = null; } return this; @@ -34999,20 +35371,21 @@ class GX509CertificateBuilder @override void replace(GX509Certificate other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GX509Certificate; } @override - void update(void Function(GX509CertificateBuilder) updates) { + void update(void Function(GX509CertificateBuilder)? updates) { if (updates != null) updates(this); } @override _$GX509Certificate build() { - final _$result = _$v ?? new _$GX509Certificate._(value: value); + final _$result = _$v ?? + new _$GX509Certificate._( + value: BuiltValueNullFieldError.checkNotNull( + value, 'GX509Certificate', 'value')); replace(_$result); return _$result; } diff --git a/examples/gql_example_cli_github/pubspec.yaml b/examples/gql_example_cli_github/pubspec.yaml index fc9d95471..336eb134e 100644 --- a/examples/gql_example_cli_github/pubspec.yaml +++ b/examples/gql_example_cli_github/pubspec.yaml @@ -1,14 +1,13 @@ name: gql_example_cli_github environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - args: any - gql: ^0.12.3 - gql_link: ^0.3.1 - gql_exec: ^0.2.5 - gql_http_link: ^0.3.2 - gql_transform_link: ^0.1.5 + args: ^2.0.0 + gql: ^0.13.0-nullsafety.2 + gql_exec: ^0.3.0-nullsafety.2 + gql_http_link: ^0.4.0-nullsafety.1 + gql_transform_link: ^0.2.0-nullsafety.1 dev_dependencies: - build_runner: ^1.10.1 + build_runner: ^2.0.0 + gql_build: ^0.2.0-nullsafety.0 gql_pedantic: ^1.0.2 - gql_build: ^0.1.3 diff --git a/examples/gql_example_dio_link/pubspec.yaml b/examples/gql_example_dio_link/pubspec.yaml index 83f13778b..180de61a7 100644 --- a/examples/gql_example_dio_link/pubspec.yaml +++ b/examples/gql_example_dio_link/pubspec.yaml @@ -3,8 +3,8 @@ description: A simple example to show gql_dio_link environment: sdk: '>=2.7.0 <3.0.0' dependencies: - dio: ^3.0.9 - gql: ^0.12.3 - gql_link: ^0.3.1 - gql_exec: ^0.2.5 - gql_dio_link: ^0.0.4 + dio: ^4.0.0 + gql: ^0.13.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.1 + gql_exec: ^0.3.0-nullsafety.1 + gql_dio_link: ^0.1.0-nullsafety.1 diff --git a/examples/gql_example_flutter/analysis_options.yaml b/examples/gql_example_flutter/analysis_options.yaml new file mode 100644 index 000000000..d4e97bfa3 --- /dev/null +++ b/examples/gql_example_flutter/analysis_options.yaml @@ -0,0 +1,5 @@ +#include: package:gql_pedantic/analysis_options.yaml +analyzer: + exclude: + - lib/**/*.gql.dart + - lib/**/*.gql.g.dart diff --git a/examples/gql_example_flutter/ios/Runner.xcodeproj/project.pbxproj b/examples/gql_example_flutter/ios/Runner.xcodeproj/project.pbxproj index daaaefcc8..1b7a3e4f9 100644 --- a/examples/gql_example_flutter/ios/Runner.xcodeproj/project.pbxproj +++ b/examples/gql_example_flutter/ios/Runner.xcodeproj/project.pbxproj @@ -241,7 +241,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -318,7 +317,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -374,7 +372,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; diff --git a/examples/gql_example_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/gql_example_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16e..919434a62 100644 --- a/examples/gql_example_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/examples/gql_example_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/examples/gql_example_flutter/lib/graphql/serializers.gql.dart b/examples/gql_example_flutter/lib/graphql/serializers.gql.dart index 9aade2c37..87a288b1d 100644 --- a/examples/gql_example_flutter/lib/graphql/serializers.gql.dart +++ b/examples/gql_example_flutter/lib/graphql/serializers.gql.dart @@ -21,8 +21,8 @@ import 'package:gql_example_flutter/src/pokemon_detail/graphql/pokemon_detail.da show GPokemonDetailData, GPokemonDetailData_pokemon, - GPokemonDetailData_pokemon_weight, - GPokemonDetailData_pokemon_height; + GPokemonDetailData_pokemon_height, + GPokemonDetailData_pokemon_weight; import 'package:gql_example_flutter/src/pokemon_detail/graphql/pokemon_detail.req.gql.dart' show GPokemonDetail; import 'package:gql_example_flutter/src/pokemon_detail/graphql/pokemon_detail.var.gql.dart' @@ -34,19 +34,19 @@ final SerializersBuilder _serializersBuilder = _$serializers.toBuilder() ..add(OperationSerializer()) ..addPlugin(StandardJsonPlugin()); @SerializersFor([ - GPokemonDetailData, - GPokemonDetailData_pokemon, - GPokemonDetailData_pokemon_weight, - GPokemonDetailData_pokemon_height, - GNestedFragmentData, - GPokemonCardData, + GAllPokemon, GAllPokemonData, GAllPokemonData_pokemons, - GPokemonDetail, - GAllPokemon, - GPokemonDetailVars, + GAllPokemonVars, + GNestedFragmentData, GNestedFragmentVars, + GPokemonCardData, GPokemonCardVars, - GAllPokemonVars + GPokemonDetail, + GPokemonDetailData, + GPokemonDetailData_pokemon, + GPokemonDetailData_pokemon_height, + GPokemonDetailData_pokemon_weight, + GPokemonDetailVars ]) final Serializers serializers = _serializersBuilder.build(); diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/all_pokemon.dart b/examples/gql_example_flutter/lib/src/all_pokemon/all_pokemon.dart index 2c006f2af..2638e023a 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/all_pokemon.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/all_pokemon.dart @@ -28,12 +28,12 @@ class AllPokemonScreen extends StatelessWidget { if (snapshot.data?.data == null) return Center(child: CircularProgressIndicator()); - final data = GAllPokemonData.fromJson(snapshot.data.data); + final data = GAllPokemonData.fromJson(snapshot.data!.data!); return ListView.builder( - itemCount: data.pokemons.length, + itemCount: data!.pokemons!.length, itemBuilder: (context, index) => PokemonCard( - pokemon: data.pokemons[index], + pokemon: data.pokemons![index], ), ); }, diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.dart b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.dart index a6a1a8eb5..f25ed7979 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.dart @@ -20,13 +20,13 @@ abstract class GAllPokemonData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - BuiltList get pokemons; + BuiltList? get pokemons; static Serializer get serializer => _$gAllPokemonDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GAllPokemonData.serializer, this); - static GAllPokemonData fromJson(Map json) => + (_i1.serializers.serializeWith(GAllPokemonData.serializer, this) + as Map); + static GAllPokemonData? fromJson(Map json) => _i1.serializers.deserializeWith(GAllPokemonData.serializer, json); } @@ -45,17 +45,15 @@ abstract class GAllPokemonData_pokemons @BuiltValueField(wireName: '__typename') String get G__typename; String get id; - @nullable - String get name; - @nullable - int get maxHP; - @nullable - String get image; + String? get name; + int? get maxHP; + String? get image; static Serializer get serializer => _$gAllPokemonDataPokemonsSerializer; Map toJson() => - _i1.serializers.serializeWith(GAllPokemonData_pokemons.serializer, this); - static GAllPokemonData_pokemons fromJson(Map json) => + (_i1.serializers.serializeWith(GAllPokemonData_pokemons.serializer, this) + as Map); + static GAllPokemonData_pokemons? fromJson(Map json) => _i1.serializers .deserializeWith(GAllPokemonData_pokemons.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.g.dart b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.g.dart index 119394f56..c85bb72b2 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.data.gql.g.dart @@ -19,17 +19,19 @@ class _$GAllPokemonDataSerializer final String wireName = 'GAllPokemonData'; @override - Iterable serialize(Serializers serializers, GAllPokemonData object, + Iterable serialize(Serializers serializers, GAllPokemonData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.pokemons != null) { + Object? value; + value = object.pokemons; + if (value != null) { result ..add('pokemons') - ..add(serializers.serialize(object.pokemons, + ..add(serializers.serialize(value, specifiedType: const FullType( BuiltList, const [const FullType(GAllPokemonData_pokemons)]))); } @@ -38,7 +40,7 @@ class _$GAllPokemonDataSerializer @override GAllPokemonData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAllPokemonDataBuilder(); @@ -46,7 +48,7 @@ class _$GAllPokemonDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -56,7 +58,7 @@ class _$GAllPokemonDataSerializer result.pokemons.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltList, const [ const FullType(GAllPokemonData_pokemons) - ])) as BuiltList); + ]))! as BuiltList); break; } } @@ -76,32 +78,35 @@ class _$GAllPokemonData_pokemonsSerializer final String wireName = 'GAllPokemonData_pokemons'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GAllPokemonData_pokemons object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.name != null) { + Object? value; + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maxHP != null) { + value = object.maxHP; + if (value != null) { result ..add('maxHP') - ..add(serializers.serialize(object.maxHP, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.image != null) { + value = object.image; + if (value != null) { result ..add('image') - ..add(serializers.serialize(object.image, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -109,7 +114,7 @@ class _$GAllPokemonData_pokemonsSerializer @override GAllPokemonData_pokemons deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAllPokemonData_pokemonsBuilder(); @@ -117,7 +122,7 @@ class _$GAllPokemonData_pokemonsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -150,15 +155,14 @@ class _$GAllPokemonData extends GAllPokemonData { @override final String G__typename; @override - final BuiltList pokemons; + final BuiltList? pokemons; - factory _$GAllPokemonData([void Function(GAllPokemonDataBuilder) updates]) => + factory _$GAllPokemonData([void Function(GAllPokemonDataBuilder)? updates]) => (new GAllPokemonDataBuilder()..update(updates)).build(); - _$GAllPokemonData._({this.G__typename, this.pokemons}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GAllPokemonData', 'G__typename'); - } + _$GAllPokemonData._({required this.G__typename, this.pokemons}) : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAllPokemonData', 'G__typename'); } @override @@ -193,16 +197,16 @@ class _$GAllPokemonData extends GAllPokemonData { class GAllPokemonDataBuilder implements Builder { - _$GAllPokemonData _$v; + _$GAllPokemonData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - ListBuilder _pokemons; + ListBuilder? _pokemons; ListBuilder get pokemons => _$this._pokemons ??= new ListBuilder(); - set pokemons(ListBuilder pokemons) => + set pokemons(ListBuilder? pokemons) => _$this._pokemons = pokemons; GAllPokemonDataBuilder() { @@ -210,9 +214,10 @@ class GAllPokemonDataBuilder } GAllPokemonDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _pokemons = _$v.pokemons?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _pokemons = $v.pokemons?.toBuilder(); _$v = null; } return this; @@ -220,14 +225,12 @@ class GAllPokemonDataBuilder @override void replace(GAllPokemonData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAllPokemonData; } @override - void update(void Function(GAllPokemonDataBuilder) updates) { + void update(void Function(GAllPokemonDataBuilder)? updates) { if (updates != null) updates(this); } @@ -237,9 +240,11 @@ class GAllPokemonDataBuilder try { _$result = _$v ?? new _$GAllPokemonData._( - G__typename: G__typename, pokemons: _pokemons?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAllPokemonData', 'G__typename'), + pokemons: _pokemons?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'pokemons'; _pokemons?.build(); @@ -260,26 +265,26 @@ class _$GAllPokemonData_pokemons extends GAllPokemonData_pokemons { @override final String id; @override - final String name; + final String? name; @override - final int maxHP; + final int? maxHP; @override - final String image; + final String? image; factory _$GAllPokemonData_pokemons( - [void Function(GAllPokemonData_pokemonsBuilder) updates]) => + [void Function(GAllPokemonData_pokemonsBuilder)? updates]) => (new GAllPokemonData_pokemonsBuilder()..update(updates)).build(); _$GAllPokemonData_pokemons._( - {this.G__typename, this.id, this.name, this.maxHP, this.image}) + {required this.G__typename, + required this.id, + this.name, + this.maxHP, + this.image}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GAllPokemonData_pokemons', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GAllPokemonData_pokemons', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAllPokemonData_pokemons', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, 'GAllPokemonData_pokemons', 'id'); } @override @@ -325,39 +330,40 @@ class _$GAllPokemonData_pokemons extends GAllPokemonData_pokemons { class GAllPokemonData_pokemonsBuilder implements Builder { - _$GAllPokemonData_pokemons _$v; + _$GAllPokemonData_pokemons? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - int _maxHP; - int get maxHP => _$this._maxHP; - set maxHP(int maxHP) => _$this._maxHP = maxHP; + int? _maxHP; + int? get maxHP => _$this._maxHP; + set maxHP(int? maxHP) => _$this._maxHP = maxHP; - String _image; - String get image => _$this._image; - set image(String image) => _$this._image = image; + String? _image; + String? get image => _$this._image; + set image(String? image) => _$this._image = image; GAllPokemonData_pokemonsBuilder() { GAllPokemonData_pokemons._initializeBuilder(this); } GAllPokemonData_pokemonsBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _maxHP = _$v.maxHP; - _image = _$v.image; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _maxHP = $v.maxHP; + _image = $v.image; _$v = null; } return this; @@ -365,14 +371,12 @@ class GAllPokemonData_pokemonsBuilder @override void replace(GAllPokemonData_pokemons other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAllPokemonData_pokemons; } @override - void update(void Function(GAllPokemonData_pokemonsBuilder) updates) { + void update(void Function(GAllPokemonData_pokemonsBuilder)? updates) { if (updates != null) updates(this); } @@ -380,8 +384,10 @@ class GAllPokemonData_pokemonsBuilder _$GAllPokemonData_pokemons build() { final _$result = _$v ?? new _$GAllPokemonData_pokemons._( - G__typename: G__typename, - id: id, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GAllPokemonData_pokemons', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GAllPokemonData_pokemons', 'id'), name: name, maxHP: maxHP, image: image); diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.dart b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.dart index 7eb200457..878ab0ff7 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.dart @@ -23,7 +23,8 @@ abstract class GAllPokemon implements Built { _i1.Operation get operation; static Serializer get serializer => _$gAllPokemonSerializer; Map toJson() => - _i4.serializers.serializeWith(GAllPokemon.serializer, this); - static GAllPokemon fromJson(Map json) => + (_i4.serializers.serializeWith(GAllPokemon.serializer, this) + as Map); + static GAllPokemon? fromJson(Map json) => _i4.serializers.deserializeWith(GAllPokemon.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.g.dart b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.g.dart index d31c759cf..7ef6053dd 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.req.gql.g.dart @@ -15,9 +15,9 @@ class _$GAllPokemonSerializer implements StructuredSerializer { final String wireName = 'GAllPokemon'; @override - Iterable serialize(Serializers serializers, GAllPokemon object, + Iterable serialize(Serializers serializers, GAllPokemon object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GAllPokemonVars)), @@ -30,7 +30,7 @@ class _$GAllPokemonSerializer implements StructuredSerializer { } @override - GAllPokemon deserialize(Serializers serializers, Iterable serialized, + GAllPokemon deserialize(Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAllPokemonBuilder(); @@ -38,11 +38,11 @@ class _$GAllPokemonSerializer implements StructuredSerializer { while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GAllPokemonVars)) + specifiedType: const FullType(_i3.GAllPokemonVars))! as _i3.GAllPokemonVars); break; case 'operation': @@ -62,16 +62,13 @@ class _$GAllPokemon extends GAllPokemon { @override final _i1.Operation operation; - factory _$GAllPokemon([void Function(GAllPokemonBuilder) updates]) => + factory _$GAllPokemon([void Function(GAllPokemonBuilder)? updates]) => (new GAllPokemonBuilder()..update(updates)).build(); - _$GAllPokemon._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GAllPokemon', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GAllPokemon', 'operation'); - } + _$GAllPokemon._({required this.vars, required this.operation}) : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GAllPokemon', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GAllPokemon', 'operation'); } @override @@ -104,25 +101,26 @@ class _$GAllPokemon extends GAllPokemon { } class GAllPokemonBuilder implements Builder { - _$GAllPokemon _$v; + _$GAllPokemon? _$v; - _i3.GAllPokemonVarsBuilder _vars; + _i3.GAllPokemonVarsBuilder? _vars; _i3.GAllPokemonVarsBuilder get vars => _$this._vars ??= new _i3.GAllPokemonVarsBuilder(); - set vars(_i3.GAllPokemonVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GAllPokemonVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GAllPokemonBuilder() { GAllPokemon._initializeBuilder(this); } GAllPokemonBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -130,14 +128,12 @@ class GAllPokemonBuilder implements Builder { @override void replace(GAllPokemon other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAllPokemon; } @override - void update(void Function(GAllPokemonBuilder) updates) { + void update(void Function(GAllPokemonBuilder)? updates) { if (updates != null) updates(this); } @@ -145,10 +141,13 @@ class GAllPokemonBuilder implements Builder { _$GAllPokemon build() { _$GAllPokemon _$result; try { - _$result = - _$v ?? new _$GAllPokemon._(vars: vars.build(), operation: operation); + _$result = _$v ?? + new _$GAllPokemon._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GAllPokemon', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.dart b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.dart index d2a280b87..5ab5a4fc8 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.dart @@ -17,7 +17,8 @@ abstract class GAllPokemonVars static Serializer get serializer => _$gAllPokemonVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GAllPokemonVars.serializer, this); - static GAllPokemonVars fromJson(Map json) => + (_i1.serializers.serializeWith(GAllPokemonVars.serializer, this) + as Map); + static GAllPokemonVars? fromJson(Map json) => _i1.serializers.deserializeWith(GAllPokemonVars.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.g.dart b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.g.dart index 934610532..77f3232c6 100644 --- a/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/all_pokemon/graphql/all_pokemon.var.gql.g.dart @@ -17,9 +17,9 @@ class _$GAllPokemonVarsSerializer final String wireName = 'GAllPokemonVars'; @override - Iterable serialize(Serializers serializers, GAllPokemonVars object, + Iterable serialize(Serializers serializers, GAllPokemonVars object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'first', serializers.serialize(object.first, specifiedType: const FullType(int)), ]; @@ -29,7 +29,7 @@ class _$GAllPokemonVarsSerializer @override GAllPokemonVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GAllPokemonVarsBuilder(); @@ -37,7 +37,7 @@ class _$GAllPokemonVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'first': result.first = serializers.deserialize(value, @@ -54,13 +54,11 @@ class _$GAllPokemonVars extends GAllPokemonVars { @override final int first; - factory _$GAllPokemonVars([void Function(GAllPokemonVarsBuilder) updates]) => + factory _$GAllPokemonVars([void Function(GAllPokemonVarsBuilder)? updates]) => (new GAllPokemonVarsBuilder()..update(updates)).build(); - _$GAllPokemonVars._({this.first}) : super._() { - if (first == null) { - throw new BuiltValueNullFieldError('GAllPokemonVars', 'first'); - } + _$GAllPokemonVars._({required this.first}) : super._() { + BuiltValueNullFieldError.checkNotNull(first, 'GAllPokemonVars', 'first'); } @override @@ -91,17 +89,18 @@ class _$GAllPokemonVars extends GAllPokemonVars { class GAllPokemonVarsBuilder implements Builder { - _$GAllPokemonVars _$v; + _$GAllPokemonVars? _$v; - int _first; - int get first => _$this._first; - set first(int first) => _$this._first = first; + int? _first; + int? get first => _$this._first; + set first(int? first) => _$this._first = first; GAllPokemonVarsBuilder(); GAllPokemonVarsBuilder get _$this { - if (_$v != null) { - _first = _$v.first; + final $v = _$v; + if ($v != null) { + _first = $v.first; _$v = null; } return this; @@ -109,20 +108,21 @@ class GAllPokemonVarsBuilder @override void replace(GAllPokemonVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GAllPokemonVars; } @override - void update(void Function(GAllPokemonVarsBuilder) updates) { + void update(void Function(GAllPokemonVarsBuilder)? updates) { if (updates != null) updates(this); } @override _$GAllPokemonVars build() { - final _$result = _$v ?? new _$GAllPokemonVars._(first: first); + final _$result = _$v ?? + new _$GAllPokemonVars._( + first: BuiltValueNullFieldError.checkNotNull( + first, 'GAllPokemonVars', 'first')); replace(_$result); return _$result; } diff --git a/examples/gql_example_flutter/lib/src/app.dart b/examples/gql_example_flutter/lib/src/app.dart index 2c94fc4f6..cbbf4cb47 100644 --- a/examples/gql_example_flutter/lib/src/app.dart +++ b/examples/gql_example_flutter/lib/src/app.dart @@ -14,8 +14,10 @@ class App extends StatelessWidget { return MaterialPageRoute(builder: (_) => AllPokemonScreen()); case 'detail': return MaterialPageRoute( - builder: (_) => PokemonDetailScreen( - id: (settings.arguments as Map)["id"])); + builder: (_) => PokemonDetailScreen( + id: (settings.arguments as Map)["id"]!, + ), + ); default: return MaterialPageRoute(builder: (_) => Scaffold()); } diff --git a/examples/gql_example_flutter/lib/src/config.dart b/examples/gql_example_flutter/lib/src/config.dart index d84f3cac2..d63873bb9 100644 --- a/examples/gql_example_flutter/lib/src/config.dart +++ b/examples/gql_example_flutter/lib/src/config.dart @@ -1,5 +1,5 @@ import 'package:gql_http_link/gql_http_link.dart'; final link = HttpLink( - "https://graphql-pokemon.now.sh/graphql", + "https://graphql-pokemon2.vercel.app", ); diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.dart index 5dc8dd094..87cd71920 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.dart @@ -9,7 +9,7 @@ part 'nested_fragment.data.gql.g.dart'; abstract class GNestedFragment { String get G__typename; String get id; - String get name; + String? get name; Map toJson(); } @@ -27,12 +27,12 @@ abstract class GNestedFragmentData @BuiltValueField(wireName: '__typename') String get G__typename; String get id; - @nullable - String get name; + String? get name; static Serializer get serializer => _$gNestedFragmentDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GNestedFragmentData.serializer, this); - static GNestedFragmentData fromJson(Map json) => + (_i1.serializers.serializeWith(GNestedFragmentData.serializer, this) + as Map); + static GNestedFragmentData? fromJson(Map json) => _i1.serializers.deserializeWith(GNestedFragmentData.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.g.dart index 71c8a61c9..b6e4d9ff4 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.data.gql.g.dart @@ -20,20 +20,22 @@ class _$GNestedFragmentDataSerializer final String wireName = 'GNestedFragmentData'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GNestedFragmentData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.name != null) { + Object? value; + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -41,7 +43,7 @@ class _$GNestedFragmentDataSerializer @override GNestedFragmentData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GNestedFragmentDataBuilder(); @@ -49,7 +51,7 @@ class _$GNestedFragmentDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -76,19 +78,18 @@ class _$GNestedFragmentData extends GNestedFragmentData { @override final String id; @override - final String name; + final String? name; factory _$GNestedFragmentData( - [void Function(GNestedFragmentDataBuilder) updates]) => + [void Function(GNestedFragmentDataBuilder)? updates]) => (new GNestedFragmentDataBuilder()..update(updates)).build(); - _$GNestedFragmentData._({this.G__typename, this.id, this.name}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GNestedFragmentData', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GNestedFragmentData', 'id'); - } + _$GNestedFragmentData._( + {required this.G__typename, required this.id, this.name}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GNestedFragmentData', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, 'GNestedFragmentData', 'id'); } @override @@ -127,29 +128,30 @@ class _$GNestedFragmentData extends GNestedFragmentData { class GNestedFragmentDataBuilder implements Builder { - _$GNestedFragmentData _$v; + _$GNestedFragmentData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GNestedFragmentDataBuilder() { GNestedFragmentData._initializeBuilder(this); } GNestedFragmentDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; _$v = null; } return this; @@ -157,14 +159,12 @@ class GNestedFragmentDataBuilder @override void replace(GNestedFragmentData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GNestedFragmentData; } @override - void update(void Function(GNestedFragmentDataBuilder) updates) { + void update(void Function(GNestedFragmentDataBuilder)? updates) { if (updates != null) updates(this); } @@ -172,7 +172,11 @@ class GNestedFragmentDataBuilder _$GNestedFragmentData build() { final _$result = _$v ?? new _$GNestedFragmentData._( - G__typename: G__typename, id: id, name: name); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GNestedFragmentData', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GNestedFragmentData', 'id'), + name: name); replace(_$result); return _$result; } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.dart index 9a09c1069..587fab9ef 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.dart @@ -16,7 +16,8 @@ abstract class GNestedFragmentVars static Serializer get serializer => _$gNestedFragmentVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GNestedFragmentVars.serializer, this); - static GNestedFragmentVars fromJson(Map json) => + (_i1.serializers.serializeWith(GNestedFragmentVars.serializer, this) + as Map); + static GNestedFragmentVars? fromJson(Map json) => _i1.serializers.deserializeWith(GNestedFragmentVars.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.g.dart index bc9df7192..fac31b65a 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/nested_fragment.var.gql.g.dart @@ -20,15 +20,15 @@ class _$GNestedFragmentVarsSerializer final String wireName = 'GNestedFragmentVars'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GNestedFragmentVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override GNestedFragmentVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GNestedFragmentVarsBuilder().build(); } @@ -36,7 +36,7 @@ class _$GNestedFragmentVarsSerializer class _$GNestedFragmentVars extends GNestedFragmentVars { factory _$GNestedFragmentVars( - [void Function(GNestedFragmentVarsBuilder) updates]) => + [void Function(GNestedFragmentVarsBuilder)? updates]) => (new GNestedFragmentVarsBuilder()..update(updates)).build(); _$GNestedFragmentVars._() : super._(); @@ -69,20 +69,18 @@ class _$GNestedFragmentVars extends GNestedFragmentVars { class GNestedFragmentVarsBuilder implements Builder { - _$GNestedFragmentVars _$v; + _$GNestedFragmentVars? _$v; GNestedFragmentVarsBuilder(); @override void replace(GNestedFragmentVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GNestedFragmentVars; } @override - void update(void Function(GNestedFragmentVarsBuilder) updates) { + void update(void Function(GNestedFragmentVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.dart index 5e903dc87..a58dbb18e 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.dart @@ -11,9 +11,9 @@ part 'pokemon_card_fragment.data.gql.g.dart'; abstract class GPokemonCard implements _i1.GNestedFragment { String get G__typename; String get id; - String get name; - int get maxHP; - String get image; + String? get name; + int? get maxHP; + String? get image; Map toJson(); } @@ -32,16 +32,14 @@ abstract class GPokemonCardData @BuiltValueField(wireName: '__typename') String get G__typename; String get id; - @nullable - String get name; - @nullable - int get maxHP; - @nullable - String get image; + String? get name; + int? get maxHP; + String? get image; static Serializer get serializer => _$gPokemonCardDataSerializer; Map toJson() => - _i2.serializers.serializeWith(GPokemonCardData.serializer, this); - static GPokemonCardData fromJson(Map json) => + (_i2.serializers.serializeWith(GPokemonCardData.serializer, this) + as Map); + static GPokemonCardData? fromJson(Map json) => _i2.serializers.deserializeWith(GPokemonCardData.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.g.dart index a7bb28326..34aaf4f4c 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.data.gql.g.dart @@ -17,31 +17,34 @@ class _$GPokemonCardDataSerializer final String wireName = 'GPokemonCardData'; @override - Iterable serialize(Serializers serializers, GPokemonCardData object, + Iterable serialize(Serializers serializers, GPokemonCardData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.name != null) { + Object? value; + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maxHP != null) { + value = object.maxHP; + if (value != null) { result ..add('maxHP') - ..add(serializers.serialize(object.maxHP, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.image != null) { + value = object.image; + if (value != null) { result ..add('image') - ..add(serializers.serialize(object.image, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -49,7 +52,7 @@ class _$GPokemonCardDataSerializer @override GPokemonCardData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonCardDataBuilder(); @@ -57,7 +60,7 @@ class _$GPokemonCardDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -92,25 +95,26 @@ class _$GPokemonCardData extends GPokemonCardData { @override final String id; @override - final String name; + final String? name; @override - final int maxHP; + final int? maxHP; @override - final String image; + final String? image; factory _$GPokemonCardData( - [void Function(GPokemonCardDataBuilder) updates]) => + [void Function(GPokemonCardDataBuilder)? updates]) => (new GPokemonCardDataBuilder()..update(updates)).build(); _$GPokemonCardData._( - {this.G__typename, this.id, this.name, this.maxHP, this.image}) + {required this.G__typename, + required this.id, + this.name, + this.maxHP, + this.image}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GPokemonCardData', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GPokemonCardData', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonCardData', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, 'GPokemonCardData', 'id'); } @override @@ -154,39 +158,40 @@ class _$GPokemonCardData extends GPokemonCardData { class GPokemonCardDataBuilder implements Builder { - _$GPokemonCardData _$v; + _$GPokemonCardData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - int _maxHP; - int get maxHP => _$this._maxHP; - set maxHP(int maxHP) => _$this._maxHP = maxHP; + int? _maxHP; + int? get maxHP => _$this._maxHP; + set maxHP(int? maxHP) => _$this._maxHP = maxHP; - String _image; - String get image => _$this._image; - set image(String image) => _$this._image = image; + String? _image; + String? get image => _$this._image; + set image(String? image) => _$this._image = image; GPokemonCardDataBuilder() { GPokemonCardData._initializeBuilder(this); } GPokemonCardDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _maxHP = _$v.maxHP; - _image = _$v.image; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _maxHP = $v.maxHP; + _image = $v.image; _$v = null; } return this; @@ -194,14 +199,12 @@ class GPokemonCardDataBuilder @override void replace(GPokemonCardData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonCardData; } @override - void update(void Function(GPokemonCardDataBuilder) updates) { + void update(void Function(GPokemonCardDataBuilder)? updates) { if (updates != null) updates(this); } @@ -209,8 +212,10 @@ class GPokemonCardDataBuilder _$GPokemonCardData build() { final _$result = _$v ?? new _$GPokemonCardData._( - G__typename: G__typename, - id: id, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonCardData', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GPokemonCardData', 'id'), name: name, maxHP: maxHP, image: image); diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.dart index fe072f8d2..9e6e7e212 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.dart @@ -16,7 +16,8 @@ abstract class GPokemonCardVars static Serializer get serializer => _$gPokemonCardVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GPokemonCardVars.serializer, this); - static GPokemonCardVars fromJson(Map json) => + (_i1.serializers.serializeWith(GPokemonCardVars.serializer, this) + as Map); + static GPokemonCardVars? fromJson(Map json) => _i1.serializers.deserializeWith(GPokemonCardVars.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.g.dart index bd9c5f457..14244b656 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/graphql/pokemon_card_fragment.var.gql.g.dart @@ -17,14 +17,14 @@ class _$GPokemonCardVarsSerializer final String wireName = 'GPokemonCardVars'; @override - Iterable serialize(Serializers serializers, GPokemonCardVars object, + Iterable serialize(Serializers serializers, GPokemonCardVars object, {FullType specifiedType = FullType.unspecified}) { - return []; + return []; } @override GPokemonCardVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { return new GPokemonCardVarsBuilder().build(); } @@ -32,7 +32,7 @@ class _$GPokemonCardVarsSerializer class _$GPokemonCardVars extends GPokemonCardVars { factory _$GPokemonCardVars( - [void Function(GPokemonCardVarsBuilder) updates]) => + [void Function(GPokemonCardVarsBuilder)? updates]) => (new GPokemonCardVarsBuilder()..update(updates)).build(); _$GPokemonCardVars._() : super._(); @@ -64,20 +64,18 @@ class _$GPokemonCardVars extends GPokemonCardVars { class GPokemonCardVarsBuilder implements Builder { - _$GPokemonCardVars _$v; + _$GPokemonCardVars? _$v; GPokemonCardVarsBuilder(); @override void replace(GPokemonCardVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonCardVars; } @override - void update(void Function(GPokemonCardVarsBuilder) updates) { + void update(void Function(GPokemonCardVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_card/pokemon_card.dart b/examples/gql_example_flutter/lib/src/pokemon_card/pokemon_card.dart index 76eab96cf..47ae6730c 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_card/pokemon_card.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_card/pokemon_card.dart @@ -5,7 +5,7 @@ import './graphql/pokemon_card_fragment.data.gql.dart'; class PokemonCard extends StatelessWidget { final GPokemonCard pokemon; - const PokemonCard({this.pokemon}); + const PokemonCard({required this.pokemon}); @override Widget build(BuildContext context) { @@ -18,13 +18,14 @@ class PokemonCard extends StatelessWidget { child: Column( children: [ SizedBox( - child: Ink.image(image: NetworkImage(pokemon.image)), + child: Ink.image(image: NetworkImage(pokemon.image!)), height: 200, width: 200, ), - Text(pokemon.name, style: Theme.of(context).textTheme.title), + Text(pokemon.name ?? '', + style: Theme.of(context).textTheme.headline6), Text('HP: ${pokemon.maxHP}', - style: Theme.of(context).textTheme.subhead) + style: Theme.of(context).textTheme.subtitle1) ], ), ), diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.dart index a68cb1537..9a5a4bbf3 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.dart @@ -19,13 +19,13 @@ abstract class GPokemonDetailData b..G__typename = 'Query'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - GPokemonDetailData_pokemon get pokemon; + GPokemonDetailData_pokemon? get pokemon; static Serializer get serializer => _$gPokemonDetailDataSerializer; Map toJson() => - _i1.serializers.serializeWith(GPokemonDetailData.serializer, this); - static GPokemonDetailData fromJson(Map json) => + (_i1.serializers.serializeWith(GPokemonDetailData.serializer, this) + as Map); + static GPokemonDetailData? fromJson(Map json) => _i1.serializers.deserializeWith(GPokemonDetailData.serializer, json); } @@ -44,21 +44,16 @@ abstract class GPokemonDetailData_pokemon @BuiltValueField(wireName: '__typename') String get G__typename; String get id; - @nullable - String get name; - @nullable - int get maxHP; - @nullable - String get image; - @nullable - GPokemonDetailData_pokemon_weight get weight; - @nullable - GPokemonDetailData_pokemon_height get height; + String? get name; + int? get maxHP; + String? get image; + GPokemonDetailData_pokemon_weight? get weight; + GPokemonDetailData_pokemon_height? get height; static Serializer get serializer => _$gPokemonDetailDataPokemonSerializer; - Map toJson() => _i1.serializers - .serializeWith(GPokemonDetailData_pokemon.serializer, this); - static GPokemonDetailData_pokemon fromJson(Map json) => + Map toJson() => (_i1.serializers.serializeWith( + GPokemonDetailData_pokemon.serializer, this) as Map); + static GPokemonDetailData_pokemon? fromJson(Map json) => _i1.serializers .deserializeWith(GPokemonDetailData_pokemon.serializer, json); } @@ -77,15 +72,14 @@ abstract class GPokemonDetailData_pokemon_weight b..G__typename = 'PokemonDimension'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get minimum; - @nullable - String get maximum; + String? get minimum; + String? get maximum; static Serializer get serializer => _$gPokemonDetailDataPokemonWeightSerializer; - Map toJson() => _i1.serializers - .serializeWith(GPokemonDetailData_pokemon_weight.serializer, this); - static GPokemonDetailData_pokemon_weight fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GPokemonDetailData_pokemon_weight.serializer, this) + as Map); + static GPokemonDetailData_pokemon_weight? fromJson( Map json) => _i1.serializers .deserializeWith(GPokemonDetailData_pokemon_weight.serializer, json); @@ -105,15 +99,14 @@ abstract class GPokemonDetailData_pokemon_height b..G__typename = 'PokemonDimension'; @BuiltValueField(wireName: '__typename') String get G__typename; - @nullable - String get minimum; - @nullable - String get maximum; + String? get minimum; + String? get maximum; static Serializer get serializer => _$gPokemonDetailDataPokemonHeightSerializer; - Map toJson() => _i1.serializers - .serializeWith(GPokemonDetailData_pokemon_height.serializer, this); - static GPokemonDetailData_pokemon_height fromJson( + Map toJson() => (_i1.serializers + .serializeWith(GPokemonDetailData_pokemon_height.serializer, this) + as Map); + static GPokemonDetailData_pokemon_height? fromJson( Map json) => _i1.serializers .deserializeWith(GPokemonDetailData_pokemon_height.serializer, json); diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.g.dart index e20a7e76a..0b2b8b24f 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.data.gql.g.dart @@ -25,17 +25,20 @@ class _$GPokemonDetailDataSerializer final String wireName = 'GPokemonDetailData'; @override - Iterable serialize(Serializers serializers, GPokemonDetailData object, + Iterable serialize( + Serializers serializers, GPokemonDetailData object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.pokemon != null) { + Object? value; + value = object.pokemon; + if (value != null) { result ..add('pokemon') - ..add(serializers.serialize(object.pokemon, + ..add(serializers.serialize(value, specifiedType: const FullType(GPokemonDetailData_pokemon))); } return result; @@ -43,7 +46,7 @@ class _$GPokemonDetailDataSerializer @override GPokemonDetailData deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonDetailDataBuilder(); @@ -51,7 +54,7 @@ class _$GPokemonDetailDataSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -59,7 +62,7 @@ class _$GPokemonDetailDataSerializer break; case 'pokemon': result.pokemon.replace(serializers.deserialize(value, - specifiedType: const FullType(GPokemonDetailData_pokemon)) + specifiedType: const FullType(GPokemonDetailData_pokemon))! as GPokemonDetailData_pokemon); break; } @@ -80,44 +83,49 @@ class _$GPokemonDetailData_pokemonSerializer final String wireName = 'GPokemonDetailData_pokemon'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GPokemonDetailData_pokemon object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), 'id', serializers.serialize(object.id, specifiedType: const FullType(String)), ]; - if (object.name != null) { + Object? value; + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maxHP != null) { + value = object.maxHP; + if (value != null) { result ..add('maxHP') - ..add(serializers.serialize(object.maxHP, - specifiedType: const FullType(int))); + ..add(serializers.serialize(value, specifiedType: const FullType(int))); } - if (object.image != null) { + value = object.image; + if (value != null) { result ..add('image') - ..add(serializers.serialize(object.image, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.weight != null) { + value = object.weight; + if (value != null) { result ..add('weight') - ..add(serializers.serialize(object.weight, + ..add(serializers.serialize(value, specifiedType: const FullType(GPokemonDetailData_pokemon_weight))); } - if (object.height != null) { + value = object.height; + if (value != null) { result ..add('height') - ..add(serializers.serialize(object.height, + ..add(serializers.serialize(value, specifiedType: const FullType(GPokemonDetailData_pokemon_height))); } return result; @@ -125,7 +133,7 @@ class _$GPokemonDetailData_pokemonSerializer @override GPokemonDetailData_pokemon deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonDetailData_pokemonBuilder(); @@ -133,7 +141,7 @@ class _$GPokemonDetailData_pokemonSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -158,13 +166,13 @@ class _$GPokemonDetailData_pokemonSerializer case 'weight': result.weight.replace(serializers.deserialize(value, specifiedType: - const FullType(GPokemonDetailData_pokemon_weight)) + const FullType(GPokemonDetailData_pokemon_weight))! as GPokemonDetailData_pokemon_weight); break; case 'height': result.height.replace(serializers.deserialize(value, specifiedType: - const FullType(GPokemonDetailData_pokemon_height)) + const FullType(GPokemonDetailData_pokemon_height))! as GPokemonDetailData_pokemon_height); break; } @@ -185,24 +193,27 @@ class _$GPokemonDetailData_pokemon_weightSerializer final String wireName = 'GPokemonDetailData_pokemon_weight'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GPokemonDetailData_pokemon_weight object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.minimum != null) { + Object? value; + value = object.minimum; + if (value != null) { result ..add('minimum') - ..add(serializers.serialize(object.minimum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maximum != null) { + value = object.maximum; + if (value != null) { result ..add('maximum') - ..add(serializers.serialize(object.maximum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -210,7 +221,7 @@ class _$GPokemonDetailData_pokemon_weightSerializer @override GPokemonDetailData_pokemon_weight deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonDetailData_pokemon_weightBuilder(); @@ -218,7 +229,7 @@ class _$GPokemonDetailData_pokemon_weightSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -250,24 +261,27 @@ class _$GPokemonDetailData_pokemon_heightSerializer final String wireName = 'GPokemonDetailData_pokemon_height'; @override - Iterable serialize( + Iterable serialize( Serializers serializers, GPokemonDetailData_pokemon_height object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ '__typename', serializers.serialize(object.G__typename, specifiedType: const FullType(String)), ]; - if (object.minimum != null) { + Object? value; + value = object.minimum; + if (value != null) { result ..add('minimum') - ..add(serializers.serialize(object.minimum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.maximum != null) { + value = object.maximum; + if (value != null) { result ..add('maximum') - ..add(serializers.serialize(object.maximum, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -275,7 +289,7 @@ class _$GPokemonDetailData_pokemon_heightSerializer @override GPokemonDetailData_pokemon_height deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonDetailData_pokemon_heightBuilder(); @@ -283,7 +297,7 @@ class _$GPokemonDetailData_pokemon_heightSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case '__typename': result.G__typename = serializers.deserialize(value, @@ -308,16 +322,16 @@ class _$GPokemonDetailData extends GPokemonDetailData { @override final String G__typename; @override - final GPokemonDetailData_pokemon pokemon; + final GPokemonDetailData_pokemon? pokemon; factory _$GPokemonDetailData( - [void Function(GPokemonDetailDataBuilder) updates]) => + [void Function(GPokemonDetailDataBuilder)? updates]) => (new GPokemonDetailDataBuilder()..update(updates)).build(); - _$GPokemonDetailData._({this.G__typename, this.pokemon}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError('GPokemonDetailData', 'G__typename'); - } + _$GPokemonDetailData._({required this.G__typename, this.pokemon}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonDetailData', 'G__typename'); } @override @@ -353,16 +367,16 @@ class _$GPokemonDetailData extends GPokemonDetailData { class GPokemonDetailDataBuilder implements Builder { - _$GPokemonDetailData _$v; + _$GPokemonDetailData? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - GPokemonDetailData_pokemonBuilder _pokemon; + GPokemonDetailData_pokemonBuilder? _pokemon; GPokemonDetailData_pokemonBuilder get pokemon => _$this._pokemon ??= new GPokemonDetailData_pokemonBuilder(); - set pokemon(GPokemonDetailData_pokemonBuilder pokemon) => + set pokemon(GPokemonDetailData_pokemonBuilder? pokemon) => _$this._pokemon = pokemon; GPokemonDetailDataBuilder() { @@ -370,9 +384,10 @@ class GPokemonDetailDataBuilder } GPokemonDetailDataBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _pokemon = _$v.pokemon?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _pokemon = $v.pokemon?.toBuilder(); _$v = null; } return this; @@ -380,14 +395,12 @@ class GPokemonDetailDataBuilder @override void replace(GPokemonDetailData other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonDetailData; } @override - void update(void Function(GPokemonDetailDataBuilder) updates) { + void update(void Function(GPokemonDetailDataBuilder)? updates) { if (updates != null) updates(this); } @@ -397,9 +410,11 @@ class GPokemonDetailDataBuilder try { _$result = _$v ?? new _$GPokemonDetailData._( - G__typename: G__typename, pokemon: _pokemon?.build()); + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonDetailData', 'G__typename'), + pokemon: _pokemon?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'pokemon'; _pokemon?.build(); @@ -420,36 +435,33 @@ class _$GPokemonDetailData_pokemon extends GPokemonDetailData_pokemon { @override final String id; @override - final String name; + final String? name; @override - final int maxHP; + final int? maxHP; @override - final String image; + final String? image; @override - final GPokemonDetailData_pokemon_weight weight; + final GPokemonDetailData_pokemon_weight? weight; @override - final GPokemonDetailData_pokemon_height height; + final GPokemonDetailData_pokemon_height? height; factory _$GPokemonDetailData_pokemon( - [void Function(GPokemonDetailData_pokemonBuilder) updates]) => + [void Function(GPokemonDetailData_pokemonBuilder)? updates]) => (new GPokemonDetailData_pokemonBuilder()..update(updates)).build(); _$GPokemonDetailData_pokemon._( - {this.G__typename, - this.id, + {required this.G__typename, + required this.id, this.name, this.maxHP, this.image, this.weight, this.height}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GPokemonDetailData_pokemon', 'G__typename'); - } - if (id == null) { - throw new BuiltValueNullFieldError('GPokemonDetailData_pokemon', 'id'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonDetailData_pokemon', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, 'GPokemonDetailData_pokemon', 'id'); } @override @@ -505,38 +517,38 @@ class _$GPokemonDetailData_pokemon extends GPokemonDetailData_pokemon { class GPokemonDetailData_pokemonBuilder implements Builder { - _$GPokemonDetailData_pokemon _$v; + _$GPokemonDetailData_pokemon? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; - int _maxHP; - int get maxHP => _$this._maxHP; - set maxHP(int maxHP) => _$this._maxHP = maxHP; + int? _maxHP; + int? get maxHP => _$this._maxHP; + set maxHP(int? maxHP) => _$this._maxHP = maxHP; - String _image; - String get image => _$this._image; - set image(String image) => _$this._image = image; + String? _image; + String? get image => _$this._image; + set image(String? image) => _$this._image = image; - GPokemonDetailData_pokemon_weightBuilder _weight; + GPokemonDetailData_pokemon_weightBuilder? _weight; GPokemonDetailData_pokemon_weightBuilder get weight => _$this._weight ??= new GPokemonDetailData_pokemon_weightBuilder(); - set weight(GPokemonDetailData_pokemon_weightBuilder weight) => + set weight(GPokemonDetailData_pokemon_weightBuilder? weight) => _$this._weight = weight; - GPokemonDetailData_pokemon_heightBuilder _height; + GPokemonDetailData_pokemon_heightBuilder? _height; GPokemonDetailData_pokemon_heightBuilder get height => _$this._height ??= new GPokemonDetailData_pokemon_heightBuilder(); - set height(GPokemonDetailData_pokemon_heightBuilder height) => + set height(GPokemonDetailData_pokemon_heightBuilder? height) => _$this._height = height; GPokemonDetailData_pokemonBuilder() { @@ -544,14 +556,15 @@ class GPokemonDetailData_pokemonBuilder } GPokemonDetailData_pokemonBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _id = _$v.id; - _name = _$v.name; - _maxHP = _$v.maxHP; - _image = _$v.image; - _weight = _$v.weight?.toBuilder(); - _height = _$v.height?.toBuilder(); + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _maxHP = $v.maxHP; + _image = $v.image; + _weight = $v.weight?.toBuilder(); + _height = $v.height?.toBuilder(); _$v = null; } return this; @@ -559,14 +572,12 @@ class GPokemonDetailData_pokemonBuilder @override void replace(GPokemonDetailData_pokemon other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonDetailData_pokemon; } @override - void update(void Function(GPokemonDetailData_pokemonBuilder) updates) { + void update(void Function(GPokemonDetailData_pokemonBuilder)? updates) { if (updates != null) updates(this); } @@ -576,15 +587,17 @@ class GPokemonDetailData_pokemonBuilder try { _$result = _$v ?? new _$GPokemonDetailData_pokemon._( - G__typename: G__typename, - id: id, + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonDetailData_pokemon', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, 'GPokemonDetailData_pokemon', 'id'), name: name, maxHP: maxHP, image: image, weight: _weight?.build(), height: _height?.build()); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'weight'; _weight?.build(); @@ -606,21 +619,19 @@ class _$GPokemonDetailData_pokemon_weight @override final String G__typename; @override - final String minimum; + final String? minimum; @override - final String maximum; + final String? maximum; factory _$GPokemonDetailData_pokemon_weight( - [void Function(GPokemonDetailData_pokemon_weightBuilder) updates]) => + [void Function(GPokemonDetailData_pokemon_weightBuilder)? updates]) => (new GPokemonDetailData_pokemon_weightBuilder()..update(updates)).build(); _$GPokemonDetailData_pokemon_weight._( - {this.G__typename, this.minimum, this.maximum}) + {required this.G__typename, this.minimum, this.maximum}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GPokemonDetailData_pokemon_weight', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonDetailData_pokemon_weight', 'G__typename'); } @override @@ -661,29 +672,30 @@ class GPokemonDetailData_pokemon_weightBuilder implements Builder { - _$GPokemonDetailData_pokemon_weight _$v; + _$GPokemonDetailData_pokemon_weight? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _minimum; - String get minimum => _$this._minimum; - set minimum(String minimum) => _$this._minimum = minimum; + String? _minimum; + String? get minimum => _$this._minimum; + set minimum(String? minimum) => _$this._minimum = minimum; - String _maximum; - String get maximum => _$this._maximum; - set maximum(String maximum) => _$this._maximum = maximum; + String? _maximum; + String? get maximum => _$this._maximum; + set maximum(String? maximum) => _$this._maximum = maximum; GPokemonDetailData_pokemon_weightBuilder() { GPokemonDetailData_pokemon_weight._initializeBuilder(this); } GPokemonDetailData_pokemon_weightBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _minimum = _$v.minimum; - _maximum = _$v.maximum; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _minimum = $v.minimum; + _maximum = $v.maximum; _$v = null; } return this; @@ -691,14 +703,13 @@ class GPokemonDetailData_pokemon_weightBuilder @override void replace(GPokemonDetailData_pokemon_weight other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonDetailData_pokemon_weight; } @override - void update(void Function(GPokemonDetailData_pokemon_weightBuilder) updates) { + void update( + void Function(GPokemonDetailData_pokemon_weightBuilder)? updates) { if (updates != null) updates(this); } @@ -706,7 +717,10 @@ class GPokemonDetailData_pokemon_weightBuilder _$GPokemonDetailData_pokemon_weight build() { final _$result = _$v ?? new _$GPokemonDetailData_pokemon_weight._( - G__typename: G__typename, minimum: minimum, maximum: maximum); + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GPokemonDetailData_pokemon_weight', 'G__typename'), + minimum: minimum, + maximum: maximum); replace(_$result); return _$result; } @@ -717,21 +731,19 @@ class _$GPokemonDetailData_pokemon_height @override final String G__typename; @override - final String minimum; + final String? minimum; @override - final String maximum; + final String? maximum; factory _$GPokemonDetailData_pokemon_height( - [void Function(GPokemonDetailData_pokemon_heightBuilder) updates]) => + [void Function(GPokemonDetailData_pokemon_heightBuilder)? updates]) => (new GPokemonDetailData_pokemon_heightBuilder()..update(updates)).build(); _$GPokemonDetailData_pokemon_height._( - {this.G__typename, this.minimum, this.maximum}) + {required this.G__typename, this.minimum, this.maximum}) : super._() { - if (G__typename == null) { - throw new BuiltValueNullFieldError( - 'GPokemonDetailData_pokemon_height', 'G__typename'); - } + BuiltValueNullFieldError.checkNotNull( + G__typename, 'GPokemonDetailData_pokemon_height', 'G__typename'); } @override @@ -772,29 +784,30 @@ class GPokemonDetailData_pokemon_heightBuilder implements Builder { - _$GPokemonDetailData_pokemon_height _$v; + _$GPokemonDetailData_pokemon_height? _$v; - String _G__typename; - String get G__typename => _$this._G__typename; - set G__typename(String G__typename) => _$this._G__typename = G__typename; + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; - String _minimum; - String get minimum => _$this._minimum; - set minimum(String minimum) => _$this._minimum = minimum; + String? _minimum; + String? get minimum => _$this._minimum; + set minimum(String? minimum) => _$this._minimum = minimum; - String _maximum; - String get maximum => _$this._maximum; - set maximum(String maximum) => _$this._maximum = maximum; + String? _maximum; + String? get maximum => _$this._maximum; + set maximum(String? maximum) => _$this._maximum = maximum; GPokemonDetailData_pokemon_heightBuilder() { GPokemonDetailData_pokemon_height._initializeBuilder(this); } GPokemonDetailData_pokemon_heightBuilder get _$this { - if (_$v != null) { - _G__typename = _$v.G__typename; - _minimum = _$v.minimum; - _maximum = _$v.maximum; + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _minimum = $v.minimum; + _maximum = $v.maximum; _$v = null; } return this; @@ -802,14 +815,13 @@ class GPokemonDetailData_pokemon_heightBuilder @override void replace(GPokemonDetailData_pokemon_height other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonDetailData_pokemon_height; } @override - void update(void Function(GPokemonDetailData_pokemon_heightBuilder) updates) { + void update( + void Function(GPokemonDetailData_pokemon_heightBuilder)? updates) { if (updates != null) updates(this); } @@ -817,7 +829,10 @@ class GPokemonDetailData_pokemon_heightBuilder _$GPokemonDetailData_pokemon_height build() { final _$result = _$v ?? new _$GPokemonDetailData_pokemon_height._( - G__typename: G__typename, minimum: minimum, maximum: maximum); + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + 'GPokemonDetailData_pokemon_height', 'G__typename'), + minimum: minimum, + maximum: maximum); replace(_$result); return _$result; } diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.dart index eeab4e726..8e2b4b1c4 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.dart @@ -26,7 +26,8 @@ abstract class GPokemonDetail static Serializer get serializer => _$gPokemonDetailSerializer; Map toJson() => - _i4.serializers.serializeWith(GPokemonDetail.serializer, this); - static GPokemonDetail fromJson(Map json) => + (_i4.serializers.serializeWith(GPokemonDetail.serializer, this) + as Map); + static GPokemonDetail? fromJson(Map json) => _i4.serializers.deserializeWith(GPokemonDetail.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.g.dart index ab553cb4f..19231a52d 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.req.gql.g.dart @@ -17,9 +17,9 @@ class _$GPokemonDetailSerializer final String wireName = 'GPokemonDetail'; @override - Iterable serialize(Serializers serializers, GPokemonDetail object, + Iterable serialize(Serializers serializers, GPokemonDetail object, {FullType specifiedType = FullType.unspecified}) { - final result = [ + final result = [ 'vars', serializers.serialize(object.vars, specifiedType: const FullType(_i3.GPokemonDetailVars)), @@ -33,7 +33,7 @@ class _$GPokemonDetailSerializer @override GPokemonDetail deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonDetailBuilder(); @@ -41,11 +41,11 @@ class _$GPokemonDetailSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'vars': result.vars.replace(serializers.deserialize(value, - specifiedType: const FullType(_i3.GPokemonDetailVars)) + specifiedType: const FullType(_i3.GPokemonDetailVars))! as _i3.GPokemonDetailVars); break; case 'operation': @@ -65,16 +65,14 @@ class _$GPokemonDetail extends GPokemonDetail { @override final _i1.Operation operation; - factory _$GPokemonDetail([void Function(GPokemonDetailBuilder) updates]) => + factory _$GPokemonDetail([void Function(GPokemonDetailBuilder)? updates]) => (new GPokemonDetailBuilder()..update(updates)).build(); - _$GPokemonDetail._({this.vars, this.operation}) : super._() { - if (vars == null) { - throw new BuiltValueNullFieldError('GPokemonDetail', 'vars'); - } - if (operation == null) { - throw new BuiltValueNullFieldError('GPokemonDetail', 'operation'); - } + _$GPokemonDetail._({required this.vars, required this.operation}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, 'GPokemonDetail', 'vars'); + BuiltValueNullFieldError.checkNotNull( + operation, 'GPokemonDetail', 'operation'); } @override @@ -109,25 +107,26 @@ class _$GPokemonDetail extends GPokemonDetail { class GPokemonDetailBuilder implements Builder { - _$GPokemonDetail _$v; + _$GPokemonDetail? _$v; - _i3.GPokemonDetailVarsBuilder _vars; + _i3.GPokemonDetailVarsBuilder? _vars; _i3.GPokemonDetailVarsBuilder get vars => _$this._vars ??= new _i3.GPokemonDetailVarsBuilder(); - set vars(_i3.GPokemonDetailVarsBuilder vars) => _$this._vars = vars; + set vars(_i3.GPokemonDetailVarsBuilder? vars) => _$this._vars = vars; - _i1.Operation _operation; - _i1.Operation get operation => _$this._operation; - set operation(_i1.Operation operation) => _$this._operation = operation; + _i1.Operation? _operation; + _i1.Operation? get operation => _$this._operation; + set operation(_i1.Operation? operation) => _$this._operation = operation; GPokemonDetailBuilder() { GPokemonDetail._initializeBuilder(this); } GPokemonDetailBuilder get _$this { - if (_$v != null) { - _vars = _$v.vars?.toBuilder(); - _operation = _$v.operation; + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _operation = $v.operation; _$v = null; } return this; @@ -135,14 +134,12 @@ class GPokemonDetailBuilder @override void replace(GPokemonDetail other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonDetail; } @override - void update(void Function(GPokemonDetailBuilder) updates) { + void update(void Function(GPokemonDetailBuilder)? updates) { if (updates != null) updates(this); } @@ -151,9 +148,12 @@ class GPokemonDetailBuilder _$GPokemonDetail _$result; try { _$result = _$v ?? - new _$GPokemonDetail._(vars: vars.build(), operation: operation); + new _$GPokemonDetail._( + vars: vars.build(), + operation: BuiltValueNullFieldError.checkNotNull( + operation, 'GPokemonDetail', 'operation')); } catch (_) { - String _$failedField; + late String _$failedField; try { _$failedField = 'vars'; vars.build(); diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.dart index ece5324ce..5dba18313 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.dart @@ -13,14 +13,13 @@ abstract class GPokemonDetailVars factory GPokemonDetailVars([Function(GPokemonDetailVarsBuilder b) updates]) = _$GPokemonDetailVars; - @nullable - String get id; - @nullable - String get name; + String? get id; + String? get name; static Serializer get serializer => _$gPokemonDetailVarsSerializer; Map toJson() => - _i1.serializers.serializeWith(GPokemonDetailVars.serializer, this); - static GPokemonDetailVars fromJson(Map json) => + (_i1.serializers.serializeWith(GPokemonDetailVars.serializer, this) + as Map); + static GPokemonDetailVars? fromJson(Map json) => _i1.serializers.deserializeWith(GPokemonDetailVars.serializer, json); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.g.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.g.dart index 42581d563..a09dc4cca 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.g.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/graphql/pokemon_detail.var.gql.g.dart @@ -17,19 +17,23 @@ class _$GPokemonDetailVarsSerializer final String wireName = 'GPokemonDetailVars'; @override - Iterable serialize(Serializers serializers, GPokemonDetailVars object, + Iterable serialize( + Serializers serializers, GPokemonDetailVars object, {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { + final result = []; + Object? value; + value = object.id; + if (value != null) { result ..add('id') - ..add(serializers.serialize(object.id, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } - if (object.name != null) { + value = object.name; + if (value != null) { result ..add('name') - ..add(serializers.serialize(object.name, + ..add(serializers.serialize(value, specifiedType: const FullType(String))); } return result; @@ -37,7 +41,7 @@ class _$GPokemonDetailVarsSerializer @override GPokemonDetailVars deserialize( - Serializers serializers, Iterable serialized, + Serializers serializers, Iterable serialized, {FullType specifiedType = FullType.unspecified}) { final result = new GPokemonDetailVarsBuilder(); @@ -45,7 +49,7 @@ class _$GPokemonDetailVarsSerializer while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); - final dynamic value = iterator.current; + final Object? value = iterator.current; switch (key) { case 'id': result.id = serializers.deserialize(value, @@ -64,12 +68,12 @@ class _$GPokemonDetailVarsSerializer class _$GPokemonDetailVars extends GPokemonDetailVars { @override - final String id; + final String? id; @override - final String name; + final String? name; factory _$GPokemonDetailVars( - [void Function(GPokemonDetailVarsBuilder) updates]) => + [void Function(GPokemonDetailVarsBuilder)? updates]) => (new GPokemonDetailVarsBuilder()..update(updates)).build(); _$GPokemonDetailVars._({this.id, this.name}) : super._(); @@ -105,22 +109,23 @@ class _$GPokemonDetailVars extends GPokemonDetailVars { class GPokemonDetailVarsBuilder implements Builder { - _$GPokemonDetailVars _$v; + _$GPokemonDetailVars? _$v; - String _id; - String get id => _$this._id; - set id(String id) => _$this._id = id; + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; GPokemonDetailVarsBuilder(); GPokemonDetailVarsBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _name = _$v.name; + final $v = _$v; + if ($v != null) { + _id = $v.id; + _name = $v.name; _$v = null; } return this; @@ -128,14 +133,12 @@ class GPokemonDetailVarsBuilder @override void replace(GPokemonDetailVars other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$GPokemonDetailVars; } @override - void update(void Function(GPokemonDetailVarsBuilder) updates) { + void update(void Function(GPokemonDetailVarsBuilder)? updates) { if (updates != null) updates(this); } diff --git a/examples/gql_example_flutter/lib/src/pokemon_detail/pokemon_detail.dart b/examples/gql_example_flutter/lib/src/pokemon_detail/pokemon_detail.dart index 5230539f3..b588ed2af 100644 --- a/examples/gql_example_flutter/lib/src/pokemon_detail/pokemon_detail.dart +++ b/examples/gql_example_flutter/lib/src/pokemon_detail/pokemon_detail.dart @@ -9,7 +9,7 @@ import '../pokemon_card/pokemon_card.dart'; class PokemonDetailScreen extends StatelessWidget { final String id; - const PokemonDetailScreen({this.id}); + const PokemonDetailScreen({required this.id}); @override Widget build(BuildContext context) { @@ -29,37 +29,37 @@ class PokemonDetailScreen extends StatelessWidget { appBar: AppBar(), body: Center(child: CircularProgressIndicator())); - final data = GPokemonDetailData.fromJson(snapshot.data.data); + final data = GPokemonDetailData.fromJson(snapshot.data!.data!); return Scaffold( appBar: AppBar( title: Text( - data.pokemon.name, + data!.pokemon!.name ?? '', )), body: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ PokemonCard( - pokemon: data.pokemon, + pokemon: data.pokemon!, ), Padding( padding: const EdgeInsets.all(8.0), ), Text( 'Height', - style: Theme.of(context).textTheme.title, + style: Theme.of(context).textTheme.headline6, ), - Text('min: ${data.pokemon.height.minimum}'), - Text('max: ${data.pokemon.height.maximum}'), + Text('min: ${data.pokemon!.height!.minimum}'), + Text('max: ${data.pokemon!.height!.maximum}'), Padding( padding: const EdgeInsets.all(8.0), ), Text( 'Weight', - style: Theme.of(context).textTheme.title, + style: Theme.of(context).textTheme.headline6, ), - Text('min: ${data.pokemon.weight.minimum}'), - Text('max: ${data.pokemon.weight.maximum}'), + Text('min: ${data.pokemon!.weight!.minimum}'), + Text('max: ${data.pokemon!.weight!.maximum}'), ], ), ); diff --git a/examples/gql_example_flutter/pubspec.yaml b/examples/gql_example_flutter/pubspec.yaml index 2fc4a034e..bad97239f 100644 --- a/examples/gql_example_flutter/pubspec.yaml +++ b/examples/gql_example_flutter/pubspec.yaml @@ -1,19 +1,19 @@ name: gql_example_flutter version: 1.0.0+1 environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - gql: ^0.12.3 - gql_link: ^0.3.1 - gql_http_link: ^0.3.2 - gql_exec: ^0.2.5 - cupertino_icons: ^0.1.2 + gql: ^0.13.0-nullsafety.2 + gql_link: ^0.4.0-nullsafety.3 + gql_http_link: ^0.4.0-nullsafety.1 + gql_exec: ^0.3.0-nullsafety.2 + cupertino_icons: ^1.0.2 flutter: sdk: flutter dev_dependencies: - build_runner: ^1.10.1 + build_runner: ^1.11.1 gql_pedantic: ^1.0.2 - gql_build: ^0.1.3 + gql_build: ^0.2.0-nullsafety.0 flutter_test: sdk: flutter flutter: diff --git a/examples/gql_example_http_auth_link/bin/main.dart b/examples/gql_example_http_auth_link/bin/main.dart index 6a69bedab..08b74efa8 100644 --- a/examples/gql_example_http_auth_link/bin/main.dart +++ b/examples/gql_example_http_auth_link/bin/main.dart @@ -9,15 +9,17 @@ final fakeHttpLink = Link.function( (request, [forward]) async* { final headers = request.context.entry(); - if (headers.headers["Authorization"] == null) { + if ((headers?.headers ?? {})["Authorization"] == null) { throw HttpLinkServerException( response: http.Response("", 401), + parsedResponse: Response(), ); } yield Response( data: { - "authHeader": headers.headers["Authorization"], + "authHeader": + (headers?.headers ?? {})["Authorization"]!, }, ); }, diff --git a/examples/gql_example_http_auth_link/lib/http_auth_link.dart b/examples/gql_example_http_auth_link/lib/http_auth_link.dart index b044d2b92..098cd658a 100644 --- a/examples/gql_example_http_auth_link/lib/http_auth_link.dart +++ b/examples/gql_example_http_auth_link/lib/http_auth_link.dart @@ -5,8 +5,8 @@ import "package:gql_link/gql_link.dart"; import "package:gql_transform_link/gql_transform_link.dart"; class HttpAuthLink extends Link { - Link _link; - String _token; + late Link _link; + String? _token; HttpAuthLink() { _link = Link.concat( @@ -39,15 +39,25 @@ class HttpAuthLink extends Link { throw exception; } - Request transformRequest(Request request) => - request.updateContextEntry( + Request transformRequest(Request request) { + var updatedRequest = request.updateContextEntry( + (headers) => HttpLinkHeaders( + headers: { + ...headers?.headers ?? {}, + }, + ), + ); + if (_token != null) { + updatedRequest = request.updateContextEntry( (headers) => HttpLinkHeaders( headers: { - ...headers?.headers ?? {}, - "Authorization": _token, + "Authorization": _token!, }, ), ); + } + return updatedRequest; + } @override Stream request(Request request, [forward]) async* { diff --git a/examples/gql_example_http_auth_link/pubspec.yaml b/examples/gql_example_http_auth_link/pubspec.yaml index 9d8a28ea2..100923ec1 100644 --- a/examples/gql_example_http_auth_link/pubspec.yaml +++ b/examples/gql_example_http_auth_link/pubspec.yaml @@ -1,14 +1,14 @@ name: gql_example_http_auth_link environment: - sdk: '>=2.7.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - gql: ^0.12.3 - gql_link: ^0.3.1 - gql_exec: ^0.2.5 - gql_error_link: ^0.1.0 - gql_transform_link: ^0.1.5 - gql_http_link: ^0.3.2 - http: ^0.12.0+2 + gql: ^0.13.0-nullsafety.2 + gql_error_link: ^0.2.0-nullsafety.1 + gql_exec: ^0.3.0-nullsafety.2 + gql_http_link: ^0.4.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.3 + gql_transform_link: ^0.2.0-nullsafety.1 + http: ^0.13.1 dev_dependencies: + gql_build: ^0.2.0-nullsafety.0 gql_pedantic: ^1.0.2 - gql_build: ^0.1.3 diff --git a/gql/CHANGELOG.md b/gql/CHANGELOG.md index 493ba425d..6b9aa0e27 100644 --- a/gql/CHANGELOG.md +++ b/gql/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.13.0-nullsafety.2 + +Loosen `source_span` constraint for `flutter_test` compatibility + +## 0.13.0-nullsafety.1 + +Null Safety Pre-release + ## 0.12.4 - add enum fallback diff --git a/gql/example/add_typenames.dart b/gql/example/add_typenames.dart index 612367690..baf678043 100644 --- a/gql/example/add_typenames.dart +++ b/gql/example/add_typenames.dart @@ -18,7 +18,7 @@ class AddTypenames extends ast.TransformingVisitor { ast.FieldNode( name: ast.NameNode(value: "__typename"), ), - ...node.selectionSet.selections + ...node.selectionSet!.selections ], ), ); diff --git a/gql/example/inspect.dart b/gql/example/inspect.dart index 85cf0d2c0..12a4d1d36 100644 --- a/gql/example/inspect.dart +++ b/gql/example/inspect.dart @@ -33,7 +33,7 @@ void inspectSchema() { print(character.isImplementedBy(droid)); // prints "true" - print(schema.query.getField("droids").type.toString()); + print(schema.query!.getField("droids").type.toString()); // prints "[Droid!]" } @@ -70,7 +70,7 @@ void inspectQuery() { final query = document.operations.first; final droids = query.selectionSet.fields.first; - final spreadDroidName = droids.selectionSet.fragmentSpreads.first; + final spreadDroidName = droids.selectionSet!.fragmentSpreads.first; print( // dereference fragment spread into fragment definition diff --git a/gql/example/parse.dart b/gql/example/parse.dart index a21ad035d..7990155ff 100644 --- a/gql/example/parse.dart +++ b/gql/example/parse.dart @@ -14,6 +14,6 @@ void main() { ); print( - (doc.definitions.first as ast.OperationDefinitionNode).name.value, + (doc.definitions.first as ast.OperationDefinitionNode).name!.value, ); } diff --git a/gql/lib/src/ast/ast.dart b/gql/lib/src/ast/ast.dart index 58dfa342c..bf9ad6463 100644 --- a/gql/lib/src/ast/ast.dart +++ b/gql/lib/src/ast/ast.dart @@ -7,13 +7,13 @@ void _visitOne( Node node, Visitor v, ) => - node?.accept(v); + node.accept(v); void _visitAll( List nodes, Visitor v, ) => - nodes?.forEach( + nodes.forEach( (node) => _visitOne(node, v), ); @@ -21,11 +21,11 @@ void _visitAll( @immutable abstract class Node { /// [FileSpan] representing the location of the node in the [SourceFile] - final FileSpan span; + final FileSpan? span; const Node(this.span); - List get _children; + List get _children; /// Lets [Visitor] [v] visit children nodes of this node. void visitChildren(Visitor v) => _children.forEach( @@ -43,7 +43,7 @@ abstract class Node { if (identical(this, o)) return true; if (o.runtimeType != runtimeType) return false; - return const ListEquality( + return const ListEquality( DeepCollectionEquality(), ).equals( (o as Node)._children, @@ -52,7 +52,7 @@ abstract class Node { } @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _children, @@ -67,9 +67,8 @@ class DocumentNode extends Node { const DocumentNode({ this.definitions = const [], - FileSpan span, - }) : assert(definitions != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitDocumentNode(this); @@ -81,22 +80,11 @@ class DocumentNode extends Node { } abstract class DefinitionNode extends Node { - final NameNode name; - - const DefinitionNode({ - @required this.name, - FileSpan span, - }) : super(span); + const DefinitionNode(FileSpan? span) : super(span); } abstract class ExecutableDefinitionNode extends DefinitionNode { - const ExecutableDefinitionNode({ - @required NameNode name, - FileSpan span, - }) : super( - name: name, - span: span, - ); + const ExecutableDefinitionNode(FileSpan? span) : super(span); } /// Enumeration of all known GraphQL operation types. @@ -129,6 +117,8 @@ enum DirectiveLocation { } class OperationDefinitionNode extends ExecutableDefinitionNode { + final NameNode? name; + final OperationType type; final List variableDefinitions; @@ -138,25 +128,19 @@ class OperationDefinitionNode extends ExecutableDefinitionNode { final SelectionSetNode selectionSet; const OperationDefinitionNode({ - @required this.type, - NameNode name, + required this.type, + this.name, this.variableDefinitions = const [], this.directives = const [], - @required this.selectionSet, - FileSpan span, - }) : assert(variableDefinitions != null), - assert(directives != null), - assert(selectionSet != null), - super( - name: name, - span: span, - ); + required this.selectionSet, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitOperationDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, type, selectionSet, @@ -170,7 +154,7 @@ class SelectionSetNode extends Node { const SelectionSetNode({ this.selections = const [], - FileSpan span, + FileSpan? span, }) : super(span); @override @@ -183,11 +167,11 @@ class SelectionSetNode extends Node { } abstract class SelectionNode extends Node { - const SelectionNode(FileSpan span) : super(span); + const SelectionNode(FileSpan? span) : super(span); } class FieldNode extends SelectionNode { - final NameNode alias; + final NameNode? alias; final NameNode name; @@ -195,25 +179,22 @@ class FieldNode extends SelectionNode { final List directives; - final SelectionSetNode selectionSet; + final SelectionSetNode? selectionSet; const FieldNode({ this.alias, - @required this.name, + required this.name, this.arguments = const [], this.directives = const [], this.selectionSet, - FileSpan span, - }) : assert(name != null), - assert(arguments != null), - assert(directives != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitFieldNode(this); @override - List get _children => [ + List get _children => [ alias, name, selectionSet, @@ -228,12 +209,10 @@ class ArgumentNode extends Node { final ValueNode value; const ArgumentNode({ - @required this.name, - @required this.value, - FileSpan span, - }) : assert(name != null), - assert(value != null), - super(span); + required this.name, + required this.value, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitArgumentNode(this); @@ -251,12 +230,10 @@ class FragmentSpreadNode extends SelectionNode { final List directives; const FragmentSpreadNode({ - @required this.name, + required this.name, this.directives = const [], - FileSpan span, - }) : assert(name != null), - assert(directives != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitFragmentSpreadNode(this); @@ -269,7 +246,7 @@ class FragmentSpreadNode extends SelectionNode { } class InlineFragmentNode extends SelectionNode { - final TypeConditionNode typeCondition; + final TypeConditionNode? typeCondition; final List directives; @@ -278,17 +255,15 @@ class InlineFragmentNode extends SelectionNode { const InlineFragmentNode({ this.typeCondition, this.directives = const [], - @required this.selectionSet, - FileSpan span, - }) : assert(directives != null), - assert(selectionSet != null), - super(span); + required this.selectionSet, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitInlineFragmentNode(this); @override - List get _children => [ + List get _children => [ typeCondition, selectionSet, directives, @@ -296,6 +271,8 @@ class InlineFragmentNode extends SelectionNode { } class FragmentDefinitionNode extends ExecutableDefinitionNode { + final NameNode name; + final TypeConditionNode typeCondition; final List directives; @@ -303,25 +280,18 @@ class FragmentDefinitionNode extends ExecutableDefinitionNode { final SelectionSetNode selectionSet; const FragmentDefinitionNode({ - @required NameNode name, - @required this.typeCondition, + required this.name, + required this.typeCondition, this.directives = const [], - @required this.selectionSet, - FileSpan span, - }) : assert(name != null), - assert(typeCondition != null), - assert(directives != null), - assert(selectionSet != null), - super( - name: name, - span: span, - ); + required this.selectionSet, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitFragmentDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, typeCondition, selectionSet, @@ -333,10 +303,9 @@ class TypeConditionNode extends Node { final NamedTypeNode on; const TypeConditionNode({ - @required this.on, - FileSpan span, - }) : assert(on != null), - super(span); + required this.on, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitTypeConditionNode(this); @@ -348,17 +317,16 @@ class TypeConditionNode extends Node { } abstract class ValueNode extends Node { - const ValueNode(FileSpan span) : super(span); + const ValueNode(FileSpan? span) : super(span); } class VariableNode extends ValueNode { final NameNode name; const VariableNode({ - @required this.name, - FileSpan span, - }) : assert(name != null), - super(span); + required this.name, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitVariableNode(this); @@ -373,10 +341,9 @@ class IntValueNode extends ValueNode { final String value; const IntValueNode({ - @required this.value, - FileSpan span, - }) : assert(value != null), - super(span); + required this.value, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitIntValueNode(this); @@ -391,10 +358,9 @@ class FloatValueNode extends ValueNode { final String value; const FloatValueNode({ - @required this.value, - FileSpan span, - }) : assert(value != null), - super(span); + required this.value, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitFloatValueNode(this); @@ -411,12 +377,10 @@ class StringValueNode extends ValueNode { final bool isBlock; const StringValueNode({ - @required this.value, - @required this.isBlock, - FileSpan span, - }) : assert(value != null), - assert(isBlock != null), - super(span); + required this.value, + required this.isBlock, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitStringValueNode(this); @@ -432,10 +396,9 @@ class BooleanValueNode extends ValueNode { final bool value; const BooleanValueNode({ - @required this.value, - FileSpan span, - }) : assert(value != null), - super(span); + required this.value, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitBooleanValueNode(this); @@ -448,7 +411,7 @@ class BooleanValueNode extends ValueNode { class NullValueNode extends ValueNode { const NullValueNode({ - FileSpan span, + FileSpan? span, }) : super(span); @override @@ -462,10 +425,9 @@ class EnumValueNode extends ValueNode { final NameNode name; const EnumValueNode({ - @required this.name, - FileSpan span, - }) : assert(name != null), - super(span); + required this.name, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitEnumValueNode(this); @@ -481,7 +443,7 @@ class ListValueNode extends ValueNode { const ListValueNode({ this.values = const [], - FileSpan span, + FileSpan? span, }) : super(span); @override @@ -498,7 +460,7 @@ class ObjectValueNode extends ValueNode { const ObjectValueNode({ this.fields = const [], - FileSpan span, + FileSpan? span, }) : super(span); @override @@ -516,12 +478,10 @@ class ObjectFieldNode extends Node { final ValueNode value; const ObjectFieldNode({ - @required this.name, - @required this.value, - FileSpan span, - }) : assert(name != null), - assert(value != null), - super(span); + required this.name, + required this.value, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitObjectFieldNode(this); @@ -538,26 +498,23 @@ class VariableDefinitionNode extends Node { final TypeNode type; - final DefaultValueNode defaultValue; + final DefaultValueNode? defaultValue; final List directives; const VariableDefinitionNode({ - @required this.variable, - @required this.type, + required this.variable, + required this.type, this.defaultValue, this.directives = const [], - FileSpan span, - }) : assert(variable != null), - assert(type != null), - assert(directives != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitVariableDefinitionNode(this); @override - List get _children => [ + List get _children => [ variable, type, defaultValue, @@ -566,18 +523,18 @@ class VariableDefinitionNode extends Node { } class DefaultValueNode extends Node { - final ValueNode value; + final ValueNode? value; const DefaultValueNode({ - @required this.value, - FileSpan span, + required this.value, + FileSpan? span, }) : super(span); @override R accept(Visitor v) => v.visitDefaultValueNode(this); @override - List get _children => [ + List get _children => [ value, ]; } @@ -585,21 +542,17 @@ class DefaultValueNode extends Node { abstract class TypeNode extends Node { final bool isNonNull; - const TypeNode(this.isNonNull, FileSpan span) - : assert(isNonNull != null), - super(span); + const TypeNode(this.isNonNull, FileSpan? span) : super(span); } class NamedTypeNode extends TypeNode { final NameNode name; const NamedTypeNode({ - @required this.name, + required this.name, bool isNonNull = false, - FileSpan span, - }) : assert(name != null), - assert(isNonNull != null), - super(isNonNull, span); + FileSpan? span, + }) : super(isNonNull, span); @override R accept(Visitor v) => v.visitNamedTypeNode(this); @@ -615,12 +568,10 @@ class ListTypeNode extends TypeNode { final TypeNode type; const ListTypeNode({ - @required this.type, - @required bool isNonNull, - FileSpan span, - }) : assert(type != null), - assert(isNonNull != null), - super(isNonNull, span); + required this.type, + required bool isNonNull, + FileSpan? span, + }) : super(isNonNull, span); @override R accept(Visitor v) => v.visitListTypeNode(this); @@ -638,12 +589,10 @@ class DirectiveNode extends Node { final List arguments; const DirectiveNode({ - @required this.name, + required this.name, this.arguments = const [], - FileSpan span, - }) : assert(name != null), - assert(arguments != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitDirectiveNode(this); @@ -659,10 +608,9 @@ class NameNode extends Node { final String value; const NameNode({ - @required this.value, - FileSpan span, - }) : assert(value != null), - super(span); + required this.value, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitNameNode(this); @@ -674,55 +622,37 @@ class NameNode extends Node { } abstract class TypeSystemDefinitionNode extends DefinitionNode { - const TypeSystemDefinitionNode({ - @required NameNode name, - FileSpan span, - }) : super( - name: name, - span: span, - ); + const TypeSystemDefinitionNode(FileSpan? span) : super(span); } abstract class TypeDefinitionNode extends TypeSystemDefinitionNode { - final StringValueNode description; + final NameNode name; + final StringValueNode? description; final List directives; const TypeDefinitionNode({ this.description, - @required NameNode name, + required this.name, this.directives = const [], - FileSpan span, - }) : assert(name != null), - assert(directives != null), - super( - name: name, - span: span, - ); + FileSpan? span, + }) : super(span); } abstract class TypeSystemExtensionNode extends TypeSystemDefinitionNode { - const TypeSystemExtensionNode({ - @required NameNode name, - FileSpan span, - }) : super( - name: name, - span: span, - ); + const TypeSystemExtensionNode( + FileSpan? span, + ) : super(span); } abstract class TypeExtensionNode extends TypeSystemExtensionNode { + final NameNode name; final List directives; const TypeExtensionNode({ - FileSpan span, - @required NameNode name, + FileSpan? span, + required this.name, this.directives = const [], - }) : assert(name != null), - assert(directives != null), - super( - name: name, - span: span, - ); + }) : super(span); } class SchemaDefinitionNode extends TypeSystemDefinitionNode { @@ -732,13 +662,8 @@ class SchemaDefinitionNode extends TypeSystemDefinitionNode { const SchemaDefinitionNode({ this.directives = const [], this.operationTypes = const [], - FileSpan span, - }) : assert(directives != null), - assert(operationTypes != null), - super( - name: null, - span: span, - ); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitSchemaDefinitionNode(this); @@ -755,12 +680,10 @@ class OperationTypeDefinitionNode extends Node { final NamedTypeNode type; const OperationTypeDefinitionNode({ - @required this.operation, - @required this.type, - FileSpan span, - }) : assert(operation != null), - assert(type != null), - super(span); + required this.operation, + required this.type, + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitOperationTypeDefinitionNode(this); @@ -774,13 +697,11 @@ class OperationTypeDefinitionNode extends Node { class ScalarTypeDefinitionNode extends TypeDefinitionNode { const ScalarTypeDefinitionNode({ - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(name != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, description: description, @@ -791,7 +712,7 @@ class ScalarTypeDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitScalarTypeDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -805,15 +726,11 @@ class ObjectTypeDefinitionNode extends TypeDefinitionNode { const ObjectTypeDefinitionNode({ this.interfaces = const [], this.fields = const [], - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(interfaces != null), - assert(fields != null), - assert(name != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, description: description, @@ -824,7 +741,7 @@ class ObjectTypeDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitObjectTypeDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -834,7 +751,7 @@ class ObjectTypeDefinitionNode extends TypeDefinitionNode { } class FieldDefinitionNode extends Node { - final StringValueNode description; + final StringValueNode? description; final NameNode name; final TypeNode type; final List directives; @@ -842,22 +759,18 @@ class FieldDefinitionNode extends Node { const FieldDefinitionNode({ this.description, - @required this.name, - @required this.type, + required this.name, + required this.type, this.args = const [], this.directives = const [], - FileSpan span, - }) : assert(type != null), - assert(args != null), - assert(name != null), - assert(directives != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitFieldDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -867,30 +780,26 @@ class FieldDefinitionNode extends Node { } class InputValueDefinitionNode extends Node { - final StringValueNode description; + final StringValueNode? description; final NameNode name; final TypeNode type; - final ValueNode defaultValue; + final ValueNode? defaultValue; final List directives; const InputValueDefinitionNode({ this.description, - @required this.name, - @required this.type, + required this.name, + required this.type, this.defaultValue, this.directives = const [], - FileSpan span, - }) : assert(type != null), - assert(name != null), - assert(type != null), - assert(directives != null), - super(span); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitInputValueDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -904,14 +813,11 @@ class InterfaceTypeDefinitionNode extends TypeDefinitionNode { const InterfaceTypeDefinitionNode({ this.fields = const [], - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(fields != null), - assert(name != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, description: description, @@ -922,7 +828,7 @@ class InterfaceTypeDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitInterfaceTypeDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -935,14 +841,11 @@ class UnionTypeDefinitionNode extends TypeDefinitionNode { const UnionTypeDefinitionNode({ this.types = const [], - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(types != null), - assert(name != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, description: description, @@ -953,7 +856,7 @@ class UnionTypeDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitUnionTypeDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -966,14 +869,11 @@ class EnumTypeDefinitionNode extends TypeDefinitionNode { const EnumTypeDefinitionNode({ this.values = const [], - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(values != null), - assert(name != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, description: description, @@ -984,7 +884,7 @@ class EnumTypeDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitEnumTypeDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -996,15 +896,12 @@ class EnumValueDefinitionNode extends TypeDefinitionNode { final bool fallback; const EnumValueDefinitionNode({ - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, + FileSpan? span, this.fallback = false, - }) : assert(name != null), - assert(directives != null), - assert(fallback != null), - super( + }) : super( span: span, name: name, description: description, @@ -1015,7 +912,7 @@ class EnumValueDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitEnumValueDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -1027,14 +924,11 @@ class InputObjectTypeDefinitionNode extends TypeDefinitionNode { const InputObjectTypeDefinitionNode({ this.fields = const [], - StringValueNode description, - @required NameNode name, + StringValueNode? description, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(fields != null), - assert(name != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, description: description, @@ -1045,7 +939,7 @@ class InputObjectTypeDefinitionNode extends TypeDefinitionNode { R accept(Visitor v) => v.visitInputObjectTypeDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, directives, @@ -1054,32 +948,26 @@ class InputObjectTypeDefinitionNode extends TypeDefinitionNode { } class DirectiveDefinitionNode extends TypeSystemDefinitionNode { - final StringValueNode description; + final NameNode name; + final StringValueNode? description; final List args; final List locations; final bool repeatable; const DirectiveDefinitionNode({ this.description, - @required NameNode name, + required this.name, this.args = const [], this.locations = const [], this.repeatable = false, - FileSpan span, - }) : assert(name != null), - assert(args != null), - assert(locations != null), - assert(repeatable != null), - super( - name: name, - span: span, - ); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitDirectiveDefinitionNode(this); @override - List get _children => [ + List get _children => [ name, description, locations, @@ -1095,20 +983,14 @@ class SchemaExtensionNode extends TypeSystemExtensionNode { const SchemaExtensionNode({ this.directives = const [], this.operationTypes = const [], - FileSpan span, - }) : assert(directives != null), - assert(operationTypes != null), - super( - name: null, - span: span, - ); + FileSpan? span, + }) : super(span); @override R accept(Visitor v) => v.visitSchemaExtensionNode(this); @override - List get _children => [ - name, + List get _children => [ directives, operationTypes, ]; @@ -1116,12 +998,10 @@ class SchemaExtensionNode extends TypeSystemExtensionNode { class ScalarTypeExtensionNode extends TypeExtensionNode { const ScalarTypeExtensionNode({ - FileSpan span, - @required NameNode name, + FileSpan? span, + required NameNode name, List directives = const [], - }) : assert(name != null), - assert(directives != null), - super( + }) : super( span: span, name: name, directives: directives, @@ -1131,7 +1011,7 @@ class ScalarTypeExtensionNode extends TypeExtensionNode { R accept(Visitor v) => v.visitScalarTypeExtensionNode(this); @override - List get _children => [ + List get _children => [ name, directives, ]; @@ -1142,16 +1022,12 @@ class ObjectTypeExtensionNode extends TypeExtensionNode { final List fields; const ObjectTypeExtensionNode({ - @required NameNode name, + required NameNode name, this.interfaces = const [], this.fields = const [], - FileSpan span, + FileSpan? span, List directives = const [], - }) : assert(name != null), - assert(interfaces != null), - assert(fields != null), - assert(directives != null), - super( + }) : super( span: span, name: name, directives: directives, @@ -1161,7 +1037,7 @@ class ObjectTypeExtensionNode extends TypeExtensionNode { R accept(Visitor v) => v.visitObjectTypeExtensionNode(this); @override - List get _children => [ + List get _children => [ name, directives, interfaces, @@ -1174,13 +1050,10 @@ class InterfaceTypeExtensionNode extends TypeExtensionNode { const InterfaceTypeExtensionNode({ this.fields = const [], - @required NameNode name, - FileSpan span, + required NameNode name, + FileSpan? span, List directives = const [], - }) : assert(name != null), - assert(fields != null), - assert(directives != null), - super( + }) : super( span: span, name: name, directives: directives, @@ -1190,7 +1063,7 @@ class InterfaceTypeExtensionNode extends TypeExtensionNode { R accept(Visitor v) => v.visitInterfaceTypeExtensionNode(this); @override - List get _children => [ + List get _children => [ name, directives, fields, @@ -1202,13 +1075,10 @@ class UnionTypeExtensionNode extends TypeExtensionNode { const UnionTypeExtensionNode({ this.types = const [], - @required NameNode name, + required NameNode name, List directives = const [], - FileSpan span, - }) : assert(name != null), - assert(types != null), - assert(directives != null), - super( + FileSpan? span, + }) : super( span: span, name: name, directives: directives, @@ -1218,7 +1088,7 @@ class UnionTypeExtensionNode extends TypeExtensionNode { R accept(Visitor v) => v.visitUnionTypeExtensionNode(this); @override - List get _children => [ + List get _children => [ name, directives, types, @@ -1230,13 +1100,10 @@ class EnumTypeExtensionNode extends TypeExtensionNode { const EnumTypeExtensionNode({ this.values = const [], - FileSpan span, - @required NameNode name, + FileSpan? span, + required NameNode name, List directives = const [], - }) : assert(name != null), - assert(values != null), - assert(directives != null), - super( + }) : super( span: span, name: name, directives: directives, @@ -1246,7 +1113,7 @@ class EnumTypeExtensionNode extends TypeExtensionNode { R accept(Visitor v) => v.visitEnumTypeExtensionNode(this); @override - List get _children => [ + List get _children => [ name, directives, values, @@ -1258,13 +1125,10 @@ class InputObjectTypeExtensionNode extends TypeExtensionNode { const InputObjectTypeExtensionNode({ this.fields = const [], - FileSpan span, - @required NameNode name, + FileSpan? span, + required NameNode name, List directives = const [], - }) : assert(name != null), - assert(fields != null), - assert(directives != null), - super( + }) : super( span: span, name: name, directives: directives, @@ -1274,7 +1138,7 @@ class InputObjectTypeExtensionNode extends TypeExtensionNode { R accept(Visitor v) => v.visitInputObjectTypeExtensionNode(this); @override - List get _children => [ + List get _children => [ name, directives, fields, diff --git a/gql/lib/src/ast/transformer.dart b/gql/lib/src/ast/transformer.dart index 494a2c6da..4d1684f21 100644 --- a/gql/lib/src/ast/transformer.dart +++ b/gql/lib/src/ast/transformer.dart @@ -293,7 +293,7 @@ class _Transformer extends Visitor { this.visitors = const [], }); - N _visitOne( + N _visitOne( N node, ) { if (node == null) return node; @@ -303,19 +303,16 @@ class _Transformer extends Visitor { List _visitAll( List nodes, - ) { - if (nodes == null) return nodes; - - return nodes - .map( - ( - node, - ) => - node.accept(this), - ) - .cast() - .toList(growable: false); - } + ) => + nodes + .map( + ( + node, + ) => + node.accept(this), + ) + .cast() + .toList(growable: false); @override DocumentNode visitDocumentNode( diff --git a/gql/lib/src/ast/visitor.dart b/gql/lib/src/ast/visitor.dart index 17833461d..53b5557d1 100644 --- a/gql/lib/src/ast/visitor.dart +++ b/gql/lib/src/ast/visitor.dart @@ -224,267 +224,267 @@ abstract class Visitor { } /// A simple implementation of [Visitor] returning `null` from each visit method. -class SimpleVisitor implements Visitor { +class SimpleVisitor implements Visitor { @override - R visitDocumentNode( + R? visitDocumentNode( DocumentNode node, ) => null; @override - R visitNameNode( + R? visitNameNode( NameNode node, ) => null; @override - R visitDirectiveNode( + R? visitDirectiveNode( DirectiveNode node, ) => null; @override - R visitListTypeNode( + R? visitListTypeNode( ListTypeNode node, ) => null; @override - R visitNamedTypeNode( + R? visitNamedTypeNode( NamedTypeNode node, ) => null; @override - R visitDefaultValueNode( + R? visitDefaultValueNode( DefaultValueNode node, ) => null; @override - R visitVariableDefinitionNode( + R? visitVariableDefinitionNode( VariableDefinitionNode node, ) => null; @override - R visitObjectFieldNode( + R? visitObjectFieldNode( ObjectFieldNode node, ) => null; @override - R visitObjectValueNode( + R? visitObjectValueNode( ObjectValueNode node, ) => null; @override - R visitListValueNode( + R? visitListValueNode( ListValueNode node, ) => null; @override - R visitEnumValueNode( + R? visitEnumValueNode( EnumValueNode node, ) => null; @override - R visitNullValueNode( + R? visitNullValueNode( NullValueNode node, ) => null; @override - R visitBooleanValueNode( + R? visitBooleanValueNode( BooleanValueNode node, ) => null; @override - R visitStringValueNode( + R? visitStringValueNode( StringValueNode node, ) => null; @override - R visitFloatValueNode( + R? visitFloatValueNode( FloatValueNode node, ) => null; @override - R visitIntValueNode( + R? visitIntValueNode( IntValueNode node, ) => null; @override - R visitVariableNode( + R? visitVariableNode( VariableNode node, ) => null; @override - R visitTypeConditionNode( + R? visitTypeConditionNode( TypeConditionNode node, ) => null; @override - R visitFragmentDefinitionNode( + R? visitFragmentDefinitionNode( FragmentDefinitionNode node, ) => null; @override - R visitInlineFragmentNode( + R? visitInlineFragmentNode( InlineFragmentNode node, ) => null; @override - R visitFragmentSpreadNode( + R? visitFragmentSpreadNode( FragmentSpreadNode node, ) => null; @override - R visitArgumentNode( + R? visitArgumentNode( ArgumentNode node, ) => null; @override - R visitFieldNode( + R? visitFieldNode( FieldNode node, ) => null; @override - R visitSelectionSetNode( + R? visitSelectionSetNode( SelectionSetNode node, ) => null; @override - R visitOperationDefinitionNode( + R? visitOperationDefinitionNode( OperationDefinitionNode node, ) => null; @override - R visitSchemaDefinitionNode( + R? visitSchemaDefinitionNode( SchemaDefinitionNode node, ) => null; @override - R visitOperationTypeDefinitionNode( + R? visitOperationTypeDefinitionNode( OperationTypeDefinitionNode node, ) => null; @override - R visitScalarTypeDefinitionNode( + R? visitScalarTypeDefinitionNode( ScalarTypeDefinitionNode node, ) => null; @override - R visitObjectTypeDefinitionNode( + R? visitObjectTypeDefinitionNode( ObjectTypeDefinitionNode node, ) => null; @override - R visitFieldDefinitionNode( + R? visitFieldDefinitionNode( FieldDefinitionNode node, ) => null; @override - R visitInputValueDefinitionNode( + R? visitInputValueDefinitionNode( InputValueDefinitionNode node, ) => null; @override - R visitInterfaceTypeDefinitionNode( + R? visitInterfaceTypeDefinitionNode( InterfaceTypeDefinitionNode node, ) => null; @override - R visitUnionTypeDefinitionNode( + R? visitUnionTypeDefinitionNode( UnionTypeDefinitionNode node, ) => null; @override - R visitEnumTypeDefinitionNode( + R? visitEnumTypeDefinitionNode( EnumTypeDefinitionNode node, ) => null; @override - R visitEnumValueDefinitionNode( + R? visitEnumValueDefinitionNode( EnumValueDefinitionNode node, ) => null; @override - R visitInputObjectTypeDefinitionNode( + R? visitInputObjectTypeDefinitionNode( InputObjectTypeDefinitionNode node, ) => null; @override - R visitDirectiveDefinitionNode( + R? visitDirectiveDefinitionNode( DirectiveDefinitionNode node, ) => null; @override - R visitSchemaExtensionNode( + R? visitSchemaExtensionNode( SchemaExtensionNode node, ) => null; @override - R visitScalarTypeExtensionNode( + R? visitScalarTypeExtensionNode( ScalarTypeExtensionNode node, ) => null; @override - R visitObjectTypeExtensionNode( + R? visitObjectTypeExtensionNode( ObjectTypeExtensionNode node, ) => null; @override - R visitInterfaceTypeExtensionNode( + R? visitInterfaceTypeExtensionNode( InterfaceTypeExtensionNode node, ) => null; @override - R visitUnionTypeExtensionNode( + R? visitUnionTypeExtensionNode( UnionTypeExtensionNode node, ) => null; @override - R visitEnumTypeExtensionNode( + R? visitEnumTypeExtensionNode( EnumTypeExtensionNode node, ) => null; @override - R visitInputObjectTypeExtensionNode( + R? visitInputObjectTypeExtensionNode( InputObjectTypeExtensionNode node, ) => null; diff --git a/gql/lib/src/language/lexer.dart b/gql/lib/src/language/lexer.dart index e36999594..bd3070665 100644 --- a/gql/lib/src/language/lexer.dart +++ b/gql/lib/src/language/lexer.dart @@ -26,7 +26,7 @@ enum TokenKind { } abstract class Token { - FileSpan get span; + FileSpan? get span; TokenKind get kind; @@ -41,14 +41,14 @@ class _Token implements Token { @override final TokenKind kind; @override - final FileSpan span; + final FileSpan? span; const _Token({ - this.kind, + required this.kind, this.span, }); - String get _text => span.text; + String get _text => span!.text; String _getValue() { switch (kind) { @@ -56,11 +56,11 @@ class _Token implements Token { return _text.substring(1, _text.length - 1).replaceAllMapped( RegExp(r'\\[nrbtf\\/"]'), (match) { - switch (match.group(0).codeUnitAt(1)) { + switch (match.group(0)!.codeUnitAt(1)) { case 34: // " case 47: // / case 92: // \ - return match.group(0)[1]; + return match.group(0)![1]; case 98: // \b return "\b"; case 102: // \f @@ -72,17 +72,17 @@ class _Token implements Token { case 116: // \t return "\t"; default: - return match.group(0); + return match.group(0)!; } }, ).replaceAllMapped( RegExp(r"\\u[0-9A-Za-z]{4}"), (match) => String.fromCharCode( uniCharCode( - match.group(0).codeUnitAt(2), - match.group(0).codeUnitAt(3), - match.group(0).codeUnitAt(4), - match.group(0).codeUnitAt(5), + match.group(0)!.codeUnitAt(2), + match.group(0)!.codeUnitAt(3), + match.group(0)!.codeUnitAt(4), + match.group(0)!.codeUnitAt(5), ), ), ); @@ -91,7 +91,7 @@ class _Token implements Token { _text.substring(3, _text.length - 3).replaceAll('\\"""', '"""'), ); default: - return span.text; + return span!.text; } } @@ -127,7 +127,7 @@ class _Scanner { _Scanner(this.src); - int peek({ + int? peek({ int offset = 0, }) { if (position + offset >= src.length) { @@ -162,15 +162,15 @@ class _Scanner { } consumeWhitespace(); - if (position >= src.length) { + final code = peek(); + + if (code == null) { return _Token( kind: TokenKind.eof, span: src.span(src.length), ); } - final code = peek(); - if ((code >= 65 && code <= 90) || code == 95 || (code >= 97 && code <= 122)) { @@ -234,7 +234,7 @@ class _Scanner { Token scanComment() { var length = 0; - int code; + int? code; do { code = peek(offset: ++length); @@ -301,7 +301,7 @@ class _Scanner { var digitOffset = offset; var code = peek(offset: digitOffset); - if (code >= 48 && code <= 57) { + if (code != null && code >= 48 && code <= 57) { do { code = peek(offset: ++digitOffset); } while (code != null && code >= 48 && code <= 57); @@ -352,7 +352,7 @@ class _Scanner { ); } - if (code == null || (code < 0x0020 && code != 0x0009)) { + if (code < 0x0020 && code != 0x0009) { throw SourceSpanException( "Unexpected character in a string literal", src.span( @@ -378,10 +378,19 @@ class _Scanner { case 116: // \t break; case 117: // \u - final isUnicode = isHex(peek(offset: 1)) && - isHex(peek(offset: 2)) && - isHex(peek(offset: 3)) && - isHex(peek(offset: 4)); + final next1 = peek(offset: 1); + final next2 = peek(offset: 2); + final next3 = peek(offset: 3); + final next4 = peek(offset: 4); + + final isUnicode = next1 != null && + isHex(next1) && + next2 != null && + isHex(next2) && + next3 != null && + isHex(next3) && + next4 != null && + isHex(next4); if (!isUnicode) { throw SourceSpanException( @@ -429,11 +438,7 @@ class _Scanner { ); } - if (code == null || - (code < 0x0020 && - code != 0x0009 && - code != 0x000a && - code != 0x000d)) { + if (code < 0x0020 && code != 0x0009 && code != 0x000a && code != 0x000d) { throw SourceSpanException( "Unexpected character in a string literal", src.span(position, position), @@ -526,7 +531,7 @@ int char2Hex(int a) { String dedentBlockStringValue(String value) { var lines = value.split(RegExp(r"\r\n|[\n\r]")); - int commonIndent; + int? commonIndent; for (var i = 1; i < lines.length; i++) { final line = lines[i]; final indent = leadingWhitespace(line); @@ -542,7 +547,7 @@ String dedentBlockStringValue(String value) { if (commonIndent != null && commonIndent != 0) { lines = lines.map((line) { - if (line.length < commonIndent) { + if (line.length < commonIndent!) { return ""; } else { return line.substring(commonIndent); diff --git a/gql/lib/src/language/parser.dart b/gql/lib/src/language/parser.dart index 3d947b1c2..35d1d1f5b 100644 --- a/gql/lib/src/language/parser.dart +++ b/gql/lib/src/language/parser.dart @@ -51,22 +51,22 @@ class _Parser { ++_position; } - Token _expectToken(TokenKind kind, [String errorMessage]) { + Token _expectToken(TokenKind kind, [String? errorMessage]) { final next = _next(); - if (next.kind == kind) { + if (next != null && next.kind == kind) { _advance(); return next; } throw SourceSpanException( errorMessage ?? "Expected $kind", - _next().span, + _next()?.span, ); } - Token _expectOptionalToken(TokenKind kind) { + Token? _expectOptionalToken(TokenKind kind) { final next = _next(); - if (next.kind == kind) { + if (next != null && next.kind == kind) { _advance(); return next; } @@ -74,22 +74,22 @@ class _Parser { return null; } - Token _expectKeyword(String value, [String errorMessage]) { + Token _expectKeyword(String value, [String? errorMessage]) { final next = _next(); - if (next.kind == TokenKind.name && next.value == value) { + if (next != null && next.kind == TokenKind.name && next.value == value) { _advance(); return next; } throw SourceSpanException( errorMessage ?? "Expected keyword '$value'", - _next().span, + _next()?.span, ); } - Token _expectOptionalKeyword(String value) { + Token? _expectOptionalKeyword(String value) { final next = _next(); - if (next.kind == TokenKind.name && next.value == value) { + if (next != null && next.kind == TokenKind.name && next.value == value) { _advance(); return next; } @@ -97,7 +97,7 @@ class _Parser { return null; } - Token _next({int offset = 0}) { + Token? _next({int offset = 0}) { if (_position + offset >= _length) return null; return _tokens[_position + offset]; @@ -107,7 +107,7 @@ class _Parser { TokenKind open, _ParseFunction parse, TokenKind close, [ - String errorMessage, + String? errorMessage, ]) { _expectToken(open, errorMessage); @@ -124,7 +124,7 @@ class _Parser { TokenKind open, _ParseFunction parse, TokenKind close, [ - String errorMessage, + String? errorMessage, ]) { if (_peek(open)) { return _parseMany( @@ -148,7 +148,7 @@ class _Parser { DefinitionNode _parseDefinition() { if (_peek(TokenKind.name)) { - switch (_next().value) { + switch (_next()!.value) { case "query": case "mutation": case "subscription": @@ -173,14 +173,14 @@ class _Parser { } throw SourceSpanException( - "Unknown definition type '${_next().value}'", - _next().span, + "Unknown definition type '${_next()?.value}'", + _next()?.span, ); } ExecutableDefinitionNode _parseExecutableDefinition() { if (_peek(TokenKind.name)) { - switch (_next().value) { + switch (_next()!.value) { case "query": case "mutation": case "subscription": @@ -193,8 +193,8 @@ class _Parser { } throw SourceSpanException( - "Unknown executable definition '${_next().value}'", - _next().span, + "Unknown executable definition '${_next()?.value}'", + _next()?.span, ); } @@ -224,7 +224,7 @@ class _Parser { } final operationType = _parseOperationType(); - NameNode name; + NameNode? name; if (_peek(TokenKind.name)) name = _parseName(); return OperationDefinitionNode( @@ -249,7 +249,7 @@ class _Parser { final type = _parseType(); - ValueNode defaultValue; + ValueNode? defaultValue; if (_expectOptionalToken(TokenKind.equals) != null) { defaultValue = _parseValue(isConst: true); } @@ -303,7 +303,7 @@ class _Parser { ObjectFieldNode _parseNonConstObjectField() => _parseObjectField(isConst: false); - ObjectFieldNode _parseObjectField({bool isConst}) { + ObjectFieldNode _parseObjectField({bool? isConst}) { final name = _parseName("Expected an object field name"); _expectToken(TokenKind.colon, "Missing ':' before object field value"); @@ -315,13 +315,13 @@ class _Parser { ValueNode _parseNonConstValue() => _parseValue(isConst: false); - ValueNode _parseValue({bool isConst}) { - final token = _next(); + ValueNode _parseValue({bool? isConst}) { + final token = _next()!; switch (token.kind) { case TokenKind.bracketL: - return _parseList(isConst: isConst); + return _parseList(isConst: isConst!); case TokenKind.braceL: - return _parseObject(isConst: isConst); + return _parseObject(isConst: isConst!); case TokenKind.int: _advance(); @@ -354,7 +354,7 @@ class _Parser { name: _parseName(), ); case TokenKind.dollar: - if (!isConst) { + if (!isConst!) { return _parseVariable(); } @@ -371,7 +371,7 @@ class _Parser { } StringValueNode _parseStringValue() { - final valueToken = _next(); + final valueToken = _next()!; _advance(); return StringValueNode( @@ -380,7 +380,7 @@ class _Parser { ); } - ListValueNode _parseList({bool isConst}) => ListValueNode( + ListValueNode _parseList({required bool isConst}) => ListValueNode( values: _parseMany( TokenKind.bracketL, isConst ? _parseConstValue : _parseNonConstValue, @@ -388,7 +388,7 @@ class _Parser { ), ); - ObjectValueNode _parseObject({bool isConst}) => ObjectValueNode( + ObjectValueNode _parseObject({required bool isConst}) => ObjectValueNode( fields: _parseMany( TokenKind.braceL, isConst ? _parseConstObjectField : _parseNonConstObjectField, @@ -405,7 +405,7 @@ class _Parser { return directives; } - DirectiveNode _parseDirective({bool isConst}) { + DirectiveNode _parseDirective({required bool isConst}) { _expectToken(TokenKind.at, "Expected directive name starting with '@'"); return DirectiveNode( @@ -414,7 +414,8 @@ class _Parser { ); } - List _parseArguments({bool isConst}) => _maybeParseMany( + List _parseArguments({required bool isConst}) => + _maybeParseMany( TokenKind.parenL, isConst ? _parseConstArgument : _parseNonConstArgument, TokenKind.parenR, @@ -424,7 +425,7 @@ class _Parser { ArgumentNode _parseNonConstArgument() => _parseArgument(isConst: false); - ArgumentNode _parseArgument({bool isConst}) { + ArgumentNode _parseArgument({bool? isConst}) { final name = _parseName("Expected an argument name"); _expectToken(TokenKind.colon, "Expected ':' followed by argument value"); @@ -491,7 +492,7 @@ class _Parser { } NameNode _parseFragmentName() { - final token = _next(); + final token = _next()!; if (token.value == "on") { throw SourceSpanException( "Invalid fragment name 'on'", @@ -506,7 +507,7 @@ class _Parser { final nameOrAlias = _parseName("Expected a field or field alias name"); NameNode name; - NameNode alias; + NameNode? alias; if (_expectOptionalToken(TokenKind.colon) != null) { alias = nameOrAlias; @@ -518,7 +519,7 @@ class _Parser { final arguments = _parseArguments(isConst: false); final directives = _parseDirectives(isConst: false); - SelectionSetNode selectionSet; + SelectionSetNode? selectionSet; if (_peek(TokenKind.braceL)) { selectionSet = _parseSelectionSet(); } @@ -532,7 +533,7 @@ class _Parser { ); } - NameNode _parseName([String errorMessage]) { + NameNode _parseName([String? errorMessage]) { final token = _expectToken( TokenKind.name, errorMessage ?? "Expected a name", @@ -551,7 +552,7 @@ class _Parser { final token = _next(offset: keywordOffset); if (_peek(TokenKind.name, offset: keywordOffset)) { - switch (token.value) { + switch (token!.value) { case "schema": return _parseSchemaDefinition(); case "scalar": @@ -572,8 +573,8 @@ class _Parser { } throw SourceSpanException( - "Unknown type system definition type '${token.value}'", - token.span, + "Unknown type system definition type '${token?.value}'", + token?.span, ); } @@ -582,8 +583,8 @@ class _Parser { final token = _next(); - if (_peek(TokenKind.name) != null) { - switch (token.value) { + if (_peek(TokenKind.name)) { + switch (token!.value) { case "schema": return _parseSchemaExtension(); case "scalar": @@ -602,8 +603,8 @@ class _Parser { } throw SourceSpanException( - "Unknown type system extension type '${token.value}'", - token.span, + "Unknown type system extension type '${token?.value}'", + token?.span, ); } @@ -647,7 +648,7 @@ class _Parser { ); } - StringValueNode _parseDescription() { + StringValueNode? _parseDescription() { if (_peek(TokenKind.string) || _peek(TokenKind.blockString)) { return _parseStringValue(); } @@ -720,7 +721,7 @@ class _Parser { final name = _parseName("Expected an input value name"); _expectToken(TokenKind.colon, "Expected ':' followed by input value type"); final type = _parseType(); - ValueNode defaultValue; + ValueNode? defaultValue; if (_expectOptionalToken(TokenKind.equals) != null) { defaultValue = _parseConstValue(); } @@ -925,7 +926,7 @@ class _Parser { if (directives.isEmpty && operationTypes.isEmpty) { throw SourceSpanException( "Schema extension must have either directives or operation types defined", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } @@ -946,7 +947,7 @@ class _Parser { if (directives.isEmpty) { throw SourceSpanException( "Scalar extension must have either directives defined", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } @@ -969,7 +970,7 @@ class _Parser { if (interfaces.isEmpty && directives.isEmpty && fields.isEmpty) { throw SourceSpanException( "Object type extension must define at least one directive or field, or implement at lease one interface", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } @@ -993,7 +994,7 @@ class _Parser { if (directives.isEmpty && fields.isEmpty) { throw SourceSpanException( "Interface type extension must define at least one directive or field", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } @@ -1016,7 +1017,7 @@ class _Parser { if (directives.isEmpty && types.isEmpty) { throw SourceSpanException( "Union type extension must define at least one directive or type", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } @@ -1039,7 +1040,7 @@ class _Parser { if (directives.isEmpty && values.isEmpty) { throw SourceSpanException( "Enum type extension must define at least one directive or value", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } @@ -1062,7 +1063,7 @@ class _Parser { if (directives.isEmpty && fields.isEmpty) { throw SourceSpanException( "Input type extension must define at least one directive or field, or implement at lease one interface", - errorToken.span.expand(_next().span), + errorToken!.span!.expand(_next()!.span!), ); } diff --git a/gql/lib/src/language/printer.dart b/gql/lib/src/language/printer.dart index 17a21c8b6..1ec8b8a9f 100644 --- a/gql/lib/src/language/printer.dart +++ b/gql/lib/src/language/printer.dart @@ -68,14 +68,14 @@ class _PrintVisitor extends Visitor { def.variable.accept(this), ": ", def.type.accept(this), - def.defaultValue.accept(this) + def.defaultValue!.accept(this) ].join(); @override String visitDefaultValueNode(DefaultValueNode defaultValueNode) { if (defaultValueNode.value == null) return ""; - return " = ${defaultValueNode.value.accept(this)}"; + return " = ${defaultValueNode.value!.accept(this)}"; } @override @@ -87,11 +87,11 @@ class _PrintVisitor extends Visitor { _opType(op.type), if (op.name != null) ...[ " ", - op.name.accept(this), + op.name!.accept(this), ], - if (op.variableDefinitions != null && op.variableDefinitions.isNotEmpty) + if (op.variableDefinitions.isNotEmpty) visitVariableDefinitionSetNode(op.variableDefinitions), - if (op.directives != null && op.directives.isNotEmpty) ...[ + if (op.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(op.directives), ], @@ -106,8 +106,7 @@ class _PrintVisitor extends Visitor { String visitDirectiveNode(DirectiveNode directiveNode) => [ "@", directiveNode.name.accept(this), - if (directiveNode.arguments != null && - directiveNode.arguments.isNotEmpty) + if (directiveNode.arguments.isNotEmpty) visitArgumentSetNode(directiveNode.arguments), ].join(); @@ -209,45 +208,34 @@ class _PrintVisitor extends Visitor { [ "fragment ", fragmentDefinitionNode.name.accept(this), - if (fragmentDefinitionNode.typeCondition != null) ...[ - " ", - fragmentDefinitionNode.typeCondition.accept(this), - ], - if (fragmentDefinitionNode.directives != null && - fragmentDefinitionNode.directives.isNotEmpty) ...[ + " ", + fragmentDefinitionNode.typeCondition.accept(this), + if (fragmentDefinitionNode.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(fragmentDefinitionNode.directives), ], - if (fragmentDefinitionNode.selectionSet != null) ...[ - " ", - fragmentDefinitionNode.selectionSet.accept(this), - ], + " ", + fragmentDefinitionNode.selectionSet.accept(this), ].join(); @override String visitInlineFragmentNode(InlineFragmentNode inlineFragmentNode) => [ "...", - if (inlineFragmentNode.typeCondition != null) ...[ - " ", - inlineFragmentNode.typeCondition.accept(this), - ], - if (inlineFragmentNode.directives != null && - inlineFragmentNode.directives.isNotEmpty) ...[ + " ", + inlineFragmentNode.typeCondition!.accept(this), + if (inlineFragmentNode.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(inlineFragmentNode.directives), ], - if (inlineFragmentNode.selectionSet != null) ...[ - " ", - inlineFragmentNode.selectionSet.accept(this), - ], + " ", + inlineFragmentNode.selectionSet.accept(this), ].join(); @override String visitFragmentSpreadNode(FragmentSpreadNode fragmentSpreadNode) => [ "...", fragmentSpreadNode.name.accept(this), - if (fragmentSpreadNode.directives != null && - fragmentSpreadNode.directives.isNotEmpty) ...[ + if (fragmentSpreadNode.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(fragmentSpreadNode.directives), ], @@ -263,20 +251,19 @@ class _PrintVisitor extends Visitor { @override String visitFieldNode(FieldNode fieldNode) => [ if (fieldNode.alias != null) ...[ - fieldNode.alias.accept(this), + fieldNode.alias!.accept(this), ": ", ], fieldNode.name.accept(this), - if (fieldNode.arguments != null && fieldNode.arguments.isNotEmpty) + if (fieldNode.arguments.isNotEmpty) visitArgumentSetNode(fieldNode.arguments), - if (fieldNode.directives != null && - fieldNode.directives.isNotEmpty) ...[ + if (fieldNode.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(fieldNode.directives), ], if (fieldNode.selectionSet != null) ...[ " ", - visitSelectionSetNode(fieldNode.selectionSet), + visitSelectionSetNode(fieldNode.selectionSet!), ], ].join(); @@ -317,13 +304,13 @@ class _PrintVisitor extends Visitor { @override String visitScalarTypeDefinitionNode(ScalarTypeDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", ], "scalar", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -332,7 +319,7 @@ class _PrintVisitor extends Visitor { @override String visitObjectTypeDefinitionNode(ObjectTypeDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", ], "type", @@ -386,7 +373,7 @@ class _PrintVisitor extends Visitor { @override String visitFieldDefinitionNode(FieldDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", _indent(_tabs), ], @@ -395,7 +382,7 @@ class _PrintVisitor extends Visitor { ":", " ", node.type.accept(this), - if (node.directives != null && node.directives.isNotEmpty) " ", + if (node.directives.isNotEmpty) " ", visitDirectiveSetNode(node.directives), ].join(); @@ -420,7 +407,7 @@ class _PrintVisitor extends Visitor { @override String visitInputValueDefinitionNode(InputValueDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", _indent(_tabs), ], @@ -432,16 +419,16 @@ class _PrintVisitor extends Visitor { " ", "=", " ", - node.defaultValue.accept(this), + node.defaultValue!.accept(this), ], - if (node.directives != null && node.directives.isNotEmpty) " ", + if (node.directives.isNotEmpty) " ", visitDirectiveSetNode(node.directives), ].join(); @override String visitInterfaceTypeDefinitionNode(InterfaceTypeDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", ], "interface", @@ -455,13 +442,13 @@ class _PrintVisitor extends Visitor { @override String visitUnionTypeDefinitionNode(UnionTypeDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", ], "union", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -494,13 +481,13 @@ class _PrintVisitor extends Visitor { @override String visitEnumTypeDefinitionNode(EnumTypeDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", ], "enum", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -533,12 +520,12 @@ class _PrintVisitor extends Visitor { @override String visitEnumValueDefinitionNode(EnumValueDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", _indent(_tabs), ], node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) " ", + if (node.directives.isNotEmpty) " ", visitDirectiveSetNode(node.directives), ].join(); @@ -547,7 +534,7 @@ class _PrintVisitor extends Visitor { InputObjectTypeDefinitionNode node) => [ if (node.description != null) ...[ - node.description.accept(this), + node.description!.accept(this), "\n", ], "input", @@ -581,22 +568,25 @@ class _PrintVisitor extends Visitor { ].join(); @override - String visitDirectiveDefinitionNode(DirectiveDefinitionNode node) => [ - if (node.description != null) ...[ - node.description.accept(this), - "\n", - ], - "directive", + String visitDirectiveDefinitionNode(DirectiveDefinitionNode node) { + final description = node.description; + return [ + if (description != null) ...[ + description.accept(this), + "\n", + ], + "directive", + " ", + "@", + node.name.accept(this), + visitArgumentDefinitionSetNode(node.args), + if (node.repeatable) ...[ " ", - "@", - node.name.accept(this), - visitArgumentDefinitionSetNode(node.args), - if (node.repeatable) ...[ - " ", - "repeatable", - ], - visitDirectiveLocationSetNode(node.locations), - ].join(); + "repeatable", + ], + visitDirectiveLocationSetNode(node.locations), + ].join(); + } String visitDirectiveLocationSetNode(Iterable locations) => locations.isEmpty @@ -627,11 +617,11 @@ class _PrintVisitor extends Visitor { "extend", " ", "schema", - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], - if (node.operationTypes != null && node.operationTypes.isNotEmpty) ...[ + if (node.operationTypes.isNotEmpty) ...[ " ", visitOperationTypeDefinitionSetNode(node.operationTypes), ], @@ -644,7 +634,7 @@ class _PrintVisitor extends Visitor { "scalar", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -682,7 +672,7 @@ class _PrintVisitor extends Visitor { "union", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -696,7 +686,7 @@ class _PrintVisitor extends Visitor { "enum", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -711,7 +701,7 @@ class _PrintVisitor extends Visitor { "input", " ", node.name.accept(this), - if (node.directives != null && node.directives.isNotEmpty) ...[ + if (node.directives.isNotEmpty) ...[ " ", visitDirectiveSetNode(node.directives), ], @@ -719,7 +709,7 @@ class _PrintVisitor extends Visitor { ].join(); } -String _opType(OperationType t) { +String? _opType(OperationType t) { switch (t) { case OperationType.query: return "query"; @@ -728,12 +718,9 @@ String _opType(OperationType t) { case OperationType.subscription: return "subscription"; } - - // dead code to satisfy lint - return null; } -String _directiveLocation(DirectiveLocation location) { +String? _directiveLocation(DirectiveLocation location) { switch (location) { case DirectiveLocation.query: return "QUERY"; @@ -772,7 +759,4 @@ String _directiveLocation(DirectiveLocation location) { case DirectiveLocation.inputFieldDefinition: return "INPUT_FIELD_DEFINITION"; } - - // dead code to satisfy lint - return null; } diff --git a/gql/lib/src/operation/definitions/base_types.dart b/gql/lib/src/operation/definitions/base_types.dart index c4f6546e1..67683298f 100644 --- a/gql/lib/src/operation/definitions/base_types.dart +++ b/gql/lib/src/operation/definitions/base_types.dart @@ -12,7 +12,7 @@ abstract class ExecutableGraphQLEntity extends GraphQLEntity { @immutable abstract class ExecutableWithResolver extends ExecutableGraphQLEntity implements ExecutableTypeResolver { - const ExecutableWithResolver([GetExecutableType getType]) + const ExecutableWithResolver([GetExecutableType? getType]) : getType = getType ?? GetExecutableType.withoutContext, super(); @@ -32,7 +32,7 @@ abstract class ExecutableWithResolver extends ExecutableGraphQLEntity } @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash([astNode, getType]); } diff --git a/gql/lib/src/operation/definitions/definitions.dart b/gql/lib/src/operation/definitions/definitions.dart index b432585a0..ae54debd9 100644 --- a/gql/lib/src/operation/definitions/definitions.dart +++ b/gql/lib/src/operation/definitions/definitions.dart @@ -9,15 +9,15 @@ import "package:gql/src/operation/definitions/selections.dart"; @immutable abstract class ExecutableDefinition extends ExecutableWithResolver { - const ExecutableDefinition([GetExecutableType getType]) : super(getType); + const ExecutableDefinition([GetExecutableType? getType]) : super(getType); @override ExecutableDefinitionNode get astNode; - String get name => astNode.name?.value; + String? get name; static ExecutableDefinition fromNode(ExecutableDefinitionNode astNode, - [GetExecutableType getType]) { + [GetExecutableType? getType]) { if (astNode is OperationDefinitionNode) { return OperationDefinition(astNode, getType); } @@ -40,23 +40,26 @@ abstract class ExecutableDefinition extends ExecutableWithResolver { class OperationDefinition extends ExecutableDefinition { const OperationDefinition( this.astNode, [ - GetExecutableType getType, + GetExecutableType? getType, ]) : super(getType); @override final OperationDefinitionNode astNode; + @override + String? get name => astNode.name?.value; + OperationType get type => astNode.type; - ObjectTypeDefinition get schemaType => - getType.fromSchema(type.name) as ObjectTypeDefinition; + ObjectTypeDefinition? get schemaType => + getType.fromSchema!(type.name) as ObjectTypeDefinition?; List get variables => astNode.variableDefinitions.map((v) => VariableDefinition(v)).toList(); SelectionSet get selectionSet => SelectionSet( astNode.selectionSet, - getType.fromSchema(type.name) as ObjectTypeDefinition, + getType.fromSchema!(type.name) as ObjectTypeDefinition?, getType, ); } @@ -72,15 +75,18 @@ class OperationDefinition extends ExecutableDefinition { /// when querying against an [InterfaceTypeDefinition] or [UnionTypeDefinition]. @immutable class FragmentDefinition extends ExecutableDefinition { - const FragmentDefinition(this.astNode, [GetExecutableType getType]) + const FragmentDefinition(this.astNode, [GetExecutableType? getType]) : super(getType); @override final FragmentDefinitionNode astNode; + @override + String? get name => astNode.name.value; + TypeCondition get _typeCondition => TypeCondition(astNode.typeCondition); - TypeDefinition get onType => getType.fromSchema(_typeCondition.on.name); + TypeDefinition? get onType => getType.fromSchema!(_typeCondition.on.name); List get directives => astNode.directives.map((d) => Directive(d)).toList(); @@ -104,9 +110,9 @@ class TypeCondition extends ExecutableGraphQLEntity { const TypeCondition(this.astNode); @override - final TypeConditionNode astNode; + final TypeConditionNode? astNode; - NamedType get on => NamedType(astNode.on); + NamedType get on => NamedType(astNode!.on); } /// [Variables](https://spec.graphql.org/June2018/#sec-Language.Variables) @@ -120,7 +126,7 @@ class TypeCondition extends ExecutableGraphQLEntity { /// the execution of that operation. @immutable class VariableDefinition extends ExecutableWithResolver { - const VariableDefinition(this.astNode, [GetExecutableType getType]) + const VariableDefinition(this.astNode, [GetExecutableType? getType]) : super(getType); @override diff --git a/gql/lib/src/operation/definitions/selections.dart b/gql/lib/src/operation/definitions/selections.dart index 32dcddf87..f43720163 100644 --- a/gql/lib/src/operation/definitions/selections.dart +++ b/gql/lib/src/operation/definitions/selections.dart @@ -21,15 +21,15 @@ class SelectionSet extends ExecutableWithResolver { const SelectionSet( this.astNode, [ this.schemaType, - GetExecutableType getType, + GetExecutableType? getType, ]) : super(getType); - final TypeDefinition schemaType; + final TypeDefinition? schemaType; @override - final SelectionSetNode astNode; + final SelectionSetNode? astNode; - List get selections => astNode.selections + List get selections => astNode!.selections .map((selection) => Selection.fromNode(selection, schemaType, getType)) .toList(); @@ -46,9 +46,9 @@ class SelectionSet extends ExecutableWithResolver { /// ([Field]s, [FragmentSpread]s, or [InlineFragment]s)s @immutable abstract class Selection extends ExecutableWithResolver { - const Selection([GetExecutableType getType]) : super(getType); + const Selection([GetExecutableType? getType]) : super(getType); - GraphQLEntity get schemaType; + GraphQLEntity? get schemaType; @override SelectionNode get astNode; @@ -59,8 +59,8 @@ abstract class Selection extends ExecutableWithResolver { SelectionNode astNode, [ /// The [schemaType] of the containing element - TypeDefinition schemaType, - GetExecutableType getType, + TypeDefinition? schemaType, + GetExecutableType? getType, ]) { if (astNode is FieldNode) { // fields can only be selected on Interface and Object types @@ -79,7 +79,7 @@ abstract class Selection extends ExecutableWithResolver { } if (astNode is InlineFragmentNode) { // inline fragments must always specify a type condition - final onType = getType.fromSchema(astNode.typeCondition.on.name.value); + final onType = getType!.fromSchema!(astNode.typeCondition!.on.name.value); return InlineFragment(astNode, onType, getType); } @@ -102,21 +102,21 @@ class Field extends Selection { const Field( this.astNode, [ this.schemaType, - GetExecutableType getType, + GetExecutableType? getType, ]) : super(getType); @override final FieldNode astNode; @override - final FieldDefinition schemaType; + final FieldDefinition? schemaType; @override String get alias => astNode.alias?.value ?? name; String get name => astNode.name.value; - GraphQLType get type => schemaType.type; + GraphQLType? get type => schemaType!.type; List get arguments => astNode.arguments.map((a) => Argument(a)).toList(); @@ -124,10 +124,10 @@ class Field extends Selection { List get directives => astNode.directives.map((d) => Directive(d)).toList(); - SelectionSet get selectionSet => astNode.selectionSet != null + SelectionSet? get selectionSet => astNode.selectionSet != null ? SelectionSet( astNode.selectionSet, - getType.fromSchema(type.baseTypeName), + getType.fromSchema!(type!.baseTypeName), getType, ) : null; @@ -143,14 +143,14 @@ class Field extends Selection { @immutable class FragmentSpread extends Selection { const FragmentSpread(this.astNode, - [this.schemaType, GetExecutableType getType]) + [this.schemaType, GetExecutableType? getType]) : super(getType); @override final FragmentSpreadNode astNode; @override - final TypeDefinition schemaType; + final TypeDefinition? schemaType; String get name => astNode.name.value; @@ -180,7 +180,7 @@ class InlineFragment extends Selection { const InlineFragment( this.astNode, [ this.schemaType, - GetExecutableType getType, + GetExecutableType? getType, ]) : super(getType); @override @@ -188,8 +188,8 @@ class InlineFragment extends Selection { TypeCondition get typeCondition => TypeCondition(astNode.typeCondition); - TypeDefinitionWithFieldSet get onType => - getType.fromSchema(onTypeName) as TypeDefinitionWithFieldSet; + TypeDefinitionWithFieldSet? get onType => + getType.fromSchema!(onTypeName) as TypeDefinitionWithFieldSet?; String get onTypeName => typeCondition.on.name; @@ -197,7 +197,7 @@ class InlineFragment extends Selection { String get alias => "on$onTypeName"; @override - final TypeDefinition schemaType; + final TypeDefinition? schemaType; List get directives => astNode.directives.map((d) => Directive(d)).toList(); diff --git a/gql/lib/src/operation/definitions/type_resolver.dart b/gql/lib/src/operation/definitions/type_resolver.dart index 0a63e7fc3..d63de64cb 100644 --- a/gql/lib/src/operation/definitions/type_resolver.dart +++ b/gql/lib/src/operation/definitions/type_resolver.dart @@ -5,7 +5,7 @@ import "package:gql/src/schema/definitions.dart"; import "package:gql/src/operation/definitions.dart"; /// Callback to dereference a full fragment definition by name -typedef ResolveFragment = FragmentDefinition Function(String name); +typedef ResolveFragment = FragmentDefinition? Function(String name); /// Container for the [fromSchema] and [fromFragments] /// dereferencing callbacks necessary for full type information while @@ -23,7 +23,7 @@ class GetExecutableType { /// usually defined within the given context such as a `GraphQLSchema`. /// /// See `gql/schema.dart`'s [TypeResolver]. - final ResolveType fromSchema; + final ResolveType? fromSchema; final ResolveFragment fromFragments; @@ -40,7 +40,7 @@ class GetExecutableType { } @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash([fromFragments, fromSchema]); diff --git a/gql/lib/src/operation/executable.dart b/gql/lib/src/operation/executable.dart index db43614d3..21530a063 100644 --- a/gql/lib/src/operation/executable.dart +++ b/gql/lib/src/operation/executable.dart @@ -26,7 +26,7 @@ class ExecutableDocument extends ExecutableWithResolver { ]) : _fragmentNodeMap = _collectImportedFragmentNodes([astNode, ...imports]), super(); - final ResolveType getSchemaType; + final ResolveType? getSchemaType; final Map _fragmentNodeMap; @override @@ -36,7 +36,7 @@ class ExecutableDocument extends ExecutableWithResolver { @override final DocumentNode astNode; - FragmentDefinition getFragment(String name) { + FragmentDefinition? getFragment(String name) { final node = _fragmentNodeMap[name]; if (node == null) { return null; diff --git a/gql/lib/src/schema/defaults.dart b/gql/lib/src/schema/defaults.dart index f76ddd881..b9858ee43 100644 --- a/gql/lib/src/schema/defaults.dart +++ b/gql/lib/src/schema/defaults.dart @@ -45,19 +45,19 @@ class _BuiltInFieldDefinition extends FieldDefinition { }) : super(null); @override - final String name; + final String? name; @override - final String description; + final String? description; @override - final GraphQLType type; + final GraphQLType? type; @override - final List directives; + final List? directives; @override - final List args; + final List? args; } const typeNameField = _BuiltInFieldDefinition( @@ -83,15 +83,15 @@ class _BuiltInArgument extends InputValueDefinition { }) : super(null); @override - final String description; + final String? description; @override - final String name; + final String? name; @override - final GraphQLType type; + final GraphQLType? type; @override - final Value defaultValue; + final Value? defaultValue; @override - final List directives; + final List? directives; } @immutable @@ -105,13 +105,13 @@ class _BuiltInDirective extends DirectiveDefinition { }) : super(null); @override - final String name; + final String? name; @override - final String description; + final String? description; @override - final List args; + final List? args; @override - final List locations; + final List? locations; @override final bool repeatable; diff --git a/gql/lib/src/schema/definitions/base_types.dart b/gql/lib/src/schema/definitions/base_types.dart index 4986b673d..794ab1782 100644 --- a/gql/lib/src/schema/definitions/base_types.dart +++ b/gql/lib/src/schema/definitions/base_types.dart @@ -21,9 +21,9 @@ abstract class GraphQLEntity { const GraphQLEntity(); @override - String toString() => printNode(astNode); + String toString() => printNode(astNode!); - Node get astNode; + Node? get astNode; @override bool operator ==(Object o) { @@ -43,7 +43,7 @@ abstract class GraphQLEntity { @immutable abstract class EntityWithResolver extends GraphQLEntity implements TypeResolver { - const EntityWithResolver([ResolveType getType]) + const EntityWithResolver([ResolveType? getType]) : getType = getType ?? TypeResolver.withoutContext, super(); @@ -63,7 +63,7 @@ abstract class EntityWithResolver extends GraphQLEntity } @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash([astNode, getType]); } @@ -109,7 +109,7 @@ abstract class GraphQLType extends EntityWithResolver { static GraphQLType fromNode( TypeNode astNode, [ - ResolveType getType, + ResolveType? getType, ]) { if (astNode is NamedTypeNode) { return NamedType(astNode, getType); @@ -129,7 +129,7 @@ abstract class GraphQLType extends EntityWithResolver { class NamedType extends GraphQLType { const NamedType( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : getType = getType ?? TypeResolver.withoutContext, super(); @@ -142,7 +142,7 @@ class NamedType extends GraphQLType { /// (verifiable via [hasResolver]). /// /// See [TypeResolver] for mor details on type resolution. - TypeDefinition get type => getType(name); + TypeDefinition? get type => getType(name); /// Whether it is safe to resolve the referenced type via [type] bool get hasResolver => getType != TypeResolver.withoutContext; @@ -167,7 +167,7 @@ class NamedType extends GraphQLType { class ListType extends GraphQLType { const ListType( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : getType = getType ?? TypeResolver.withoutContext, super(); @@ -222,9 +222,9 @@ abstract class TypeSystemDefinition extends GraphQLEntity { /// The underlying definition node from `gql/ast.dart` @override - TypeSystemDefinitionNode get astNode; + TypeSystemDefinitionNode? get astNode; - String get name => astNode.name.value; + String? get name; } /// The fundamental unit of any GraphQL Schema ([spec](https://spec.graphql.org/June2018/#TypeDefinition)). @@ -262,7 +262,10 @@ abstract class TypeDefinition extends TypeSystemDefinition { @override TypeDefinitionNode get astNode; - String get description => astNode.description?.value; + @override + String? get name => astNode.name.value; + + String? get description => astNode.description?.value; List get directives => astNode.directives.map((d) => Directive(d)).toList(); @@ -307,7 +310,7 @@ abstract class TypeDefinition extends TypeSystemDefinition { @immutable abstract class TypeDefinitionWithResolver extends TypeDefinition implements TypeResolver { - const TypeDefinitionWithResolver([ResolveType getType]) + const TypeDefinitionWithResolver([ResolveType? getType]) : getType = getType ?? TypeResolver.withoutContext, super(); @@ -327,7 +330,7 @@ abstract class TypeDefinitionWithResolver extends TypeDefinition } @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash([astNode, getType]); } diff --git a/gql/lib/src/schema/definitions/definitions.dart b/gql/lib/src/schema/definitions/definitions.dart index 0b3bb2110..ff8650ca7 100644 --- a/gql/lib/src/schema/definitions/definitions.dart +++ b/gql/lib/src/schema/definitions/definitions.dart @@ -27,7 +27,6 @@ extension WithTypeName on OperationType { case OperationType.subscription: return "subscription"; } - throw StateError("Impossible OperationType $this"); } } @@ -48,8 +47,8 @@ extension WithTypeName on OperationType { class FieldDefinition extends EntityWithResolver { const FieldDefinition( this.astNode, [ - ResolveType getType, - bool isOverride, + ResolveType? getType, + bool? isOverride, ]) : getType = getType ?? TypeResolver.withoutContext, isOverride = isOverride ?? false; @@ -59,18 +58,18 @@ class FieldDefinition extends EntityWithResolver { final bool isOverride; @override - final FieldDefinitionNode astNode; + final FieldDefinitionNode? astNode; - String get name => astNode.name.value; + String? get name => astNode!.name.value; - String get description => astNode.description?.value; + String? get description => astNode!.description?.value; - GraphQLType get type => GraphQLType.fromNode(astNode.type, getType); + GraphQLType? get type => GraphQLType.fromNode(astNode!.type, getType); - List get directives => - astNode.directives.map((d) => Directive(d)).toList(); + List? get directives => + astNode!.directives.map((d) => Directive(d)).toList(); - List get args => astNode.args + List? get args => astNode!.args .map( (arg) => InputValueDefinition(arg, getType), ) @@ -81,7 +80,7 @@ class FieldDefinition extends EntityWithResolver { @immutable abstract class TypeDefinitionWithFieldSet extends TypeDefinitionWithResolver { const TypeDefinitionWithFieldSet([ - ResolveType getType, + ResolveType? getType, ]) : getType = getType ?? TypeResolver.withoutContext, super(); @@ -107,7 +106,7 @@ class InterfaceTypeDefinition extends TypeDefinitionWithFieldSet with AbstractType { const InterfaceTypeDefinition( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : super(getType); @override @@ -150,7 +149,7 @@ class InterfaceTypeDefinition extends TypeDefinitionWithFieldSet class ObjectTypeDefinition extends TypeDefinitionWithFieldSet { const ObjectTypeDefinition( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : super(getType); @override @@ -182,14 +181,14 @@ class ObjectTypeDefinition extends TypeDefinitionWithFieldSet { ) .toList(); - List get interfaces => interfaceNames - .map((i) => getType(i.name) as InterfaceTypeDefinition) + List get interfaces => interfaceNames + .map((i) => getType(i.name) as InterfaceTypeDefinition?) .toList(); /// Extract all inherited interface names recursively - Set get _inheritedFieldNames => interfaces + Set get _inheritedFieldNames => interfaces .expand( - (face) => face._fields.map((f) => f.name), + (face) => face!._fields.map((f) => f.name), ) .toSet(); } @@ -206,7 +205,7 @@ class ObjectTypeDefinition extends TypeDefinitionWithFieldSet { class UnionTypeDefinition extends TypeDefinitionWithResolver with AbstractType { const UnionTypeDefinition( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : getType = getType ?? TypeResolver.withoutContext; @override @@ -242,7 +241,7 @@ class UnionTypeDefinition extends TypeDefinitionWithResolver with AbstractType { class InputObjectTypeDefinition extends TypeDefinitionWithResolver { const InputObjectTypeDefinition( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : getType = getType ?? TypeResolver.withoutContext; @override @@ -264,25 +263,25 @@ class InputObjectTypeDefinition extends TypeDefinitionWithResolver { class InputValueDefinition extends EntityWithResolver { const InputValueDefinition( this.astNode, [ - ResolveType getType, + ResolveType? getType, ]) : getType = getType ?? TypeResolver.withoutContext; @override final ResolveType getType; @override - final InputValueDefinitionNode astNode; + final InputValueDefinitionNode? astNode; - String get name => astNode.name.value; + String? get name => astNode!.name.value; - String get description => astNode.description?.value; + String? get description => astNode!.description?.value; - GraphQLType get type => GraphQLType.fromNode(astNode.type, getType); + GraphQLType? get type => GraphQLType.fromNode(astNode!.type, getType); - Value get defaultValue => Value.fromNode(astNode.defaultValue); + Value? get defaultValue => Value.fromNode(astNode!.defaultValue); - List get directives => - astNode.directives.map((d) => Directive(d)).toList(); + List? get directives => + astNode!.directives.map((d) => Directive(d)).toList(); } /* @@ -341,17 +340,20 @@ class DirectiveDefinition extends TypeSystemDefinition { const DirectiveDefinition(this.astNode); @override - final DirectiveDefinitionNode astNode; + final DirectiveDefinitionNode? astNode; - String get description => astNode.description?.value; + @override + String? get name => astNode!.name.value; + + String? get description => astNode!.description?.value; - List get args => astNode.args + List? get args => astNode!.args .map((inputValue) => InputValueDefinition(inputValue)) .toList(); - List get locations => astNode.locations; + List? get locations => astNode!.locations; - bool get repeatable => astNode.repeatable; + bool get repeatable => astNode!.repeatable; } /// A [Root Operation](https://spec.graphql.org/June2018/#sec-Root-Operation-Types). diff --git a/gql/lib/src/schema/definitions/type_resolver.dart b/gql/lib/src/schema/definitions/type_resolver.dart index 278c6742a..080edff68 100644 --- a/gql/lib/src/schema/definitions/type_resolver.dart +++ b/gql/lib/src/schema/definitions/type_resolver.dart @@ -1,4 +1,3 @@ -import "package:collection/collection.dart"; import "package:meta/meta.dart"; import "./base_types.dart" show TypeDefinition; import "./definitions.dart" @@ -9,7 +8,7 @@ import "./definitions.dart" InputObjectTypeDefinition; /// Callback to dereference a full type definition by name -typedef ResolveType = TypeDefinition Function(String name); +typedef ResolveType = TypeDefinition? Function(String name); /// Enables "type resolution" for implementing classes, /// allowing for type-dereferencing, such as is done by `GraphQLSchema`. @@ -22,8 +21,8 @@ abstract class TypeResolver { ResolveType get getType; /// Saturates the [definition] with a [getType] if it extends from [TypeResolver] - static TypeDefinition addedTo( - TypeDefinition definition, + static TypeDefinition? addedTo( + TypeDefinition? definition, ResolveType getType, ) { if (definition == null) { diff --git a/gql/lib/src/schema/definitions/value_types.dart b/gql/lib/src/schema/definitions/value_types.dart index dd9b373f9..bf92993a8 100644 --- a/gql/lib/src/schema/definitions/value_types.dart +++ b/gql/lib/src/schema/definitions/value_types.dart @@ -21,9 +21,9 @@ abstract class Value extends GraphQLEntity { const Value(); @override - ValueNode get astNode; + ValueNode? get astNode; - static Value fromNode(ValueNode node) { + static Value fromNode(ValueNode? node) { if (node is IntValueNode) { return IntValue(node); } @@ -79,9 +79,9 @@ class StringValue extends Value { const StringValue(this.astNode); @override - final StringValueNode astNode; + final StringValueNode? astNode; - String get value => astNode.value; + String get value => astNode!.value; } @immutable @@ -155,9 +155,9 @@ class DefaultValue extends GraphQLEntity { const DefaultValue(this.astNode); @override - final DefaultValueNode astNode; + final DefaultValueNode? astNode; - Value get value => Value.fromNode(astNode.value); + Value get value => Value.fromNode(astNode!.value); } // While I don't believe VariableValues are possible in the schema definition, diff --git a/gql/lib/src/schema/schema.dart b/gql/lib/src/schema/schema.dart index 66ce0e3d5..b8a097d09 100644 --- a/gql/lib/src/schema/schema.dart +++ b/gql/lib/src/schema/schema.dart @@ -1,5 +1,6 @@ import "dart:collection"; +import "package:collection/collection.dart" show IterableExtension; import "package:meta/meta.dart"; import "package:gql/ast.dart"; @@ -21,35 +22,38 @@ class GraphQLSchema extends TypeSystemDefinition { const GraphQLSchema( this.astNode, { this.fullDocumentAst, - Map typeMap, + Map? typeMap, this.directives, }) : _typeMap = typeMap; @override - final SchemaDefinitionNode astNode; + final SchemaDefinitionNode? astNode; - final DocumentNode fullDocumentAst; + @override + String? get name => null; + + final DocumentNode? fullDocumentAst; - final List directives; + final List? directives; /// Definition for the given directive [name], if any exists - DirectiveDefinition getDirective(String name) => directives.firstWhere( + DirectiveDefinition? getDirective(String name) => + directives!.firstWhereOrNull( (d) => d.name == name, - orElse: () => null, ); - List get operationTypes => astNode.operationTypes + List get operationTypes => astNode!.operationTypes .map( (o) => OperationTypeDefinition(o), ) .toList(); /// Map of all type names to their respective [TypeDefinition]s - final Map _typeMap; + final Map? _typeMap; /// Map of all type names to their respective [TypeDefinition]s, /// with type resolution enabled (if applicable) - Map get typeMap => _typeMap.map( + Map get typeMap => _typeMap!.map( (name, definition) => MapEntry( name, _withAwareness(definition), @@ -60,21 +64,21 @@ class GraphQLSchema extends TypeSystemDefinition { /// /// [EnumTypeDefinition] and [ScalarTypeDefinition] do not accept [getType] /// because they cannot include references - TypeDefinition _withAwareness(TypeDefinition definition) => + TypeDefinition? _withAwareness(TypeDefinition? definition) => TypeResolver.addedTo(definition, getType) ?? definition; /// Resolve the given [name] into a [TypeDefinition] defined within the schema - TypeDefinition getType(String name) => _withAwareness(_typeMap[name]); + TypeDefinition? getType(String name) => _withAwareness(_typeMap![name]); - ObjectTypeDefinition _getObjectType(String name) => - _withAwareness(_typeMap[name]) as ObjectTypeDefinition; + ObjectTypeDefinition? _getObjectType(String name) => + _withAwareness(_typeMap![name]) as ObjectTypeDefinition?; - Iterable get _allTypeDefinitions => - LinkedHashSet.from(_typeMap.values).map(_withAwareness); + Iterable get _allTypeDefinitions => + LinkedHashSet.from(_typeMap!.values).map(_withAwareness); - ObjectTypeDefinition get query => _getObjectType("query"); - ObjectTypeDefinition get mutation => _getObjectType("mutation"); - ObjectTypeDefinition get subscription => _getObjectType("subscription"); + ObjectTypeDefinition? get query => _getObjectType("query"); + ObjectTypeDefinition? get mutation => _getObjectType("mutation"); + ObjectTypeDefinition? get subscription => _getObjectType("subscription"); List get interaces => _getAll(); @@ -93,7 +97,7 @@ class GraphQLSchema extends TypeSystemDefinition { _allTypeDefinitions.whereType().toList(); /// Get the possible [ObjectTypeDefinition]s that the given [abstractType] could be resolved into - List getPossibleTypes(AbstractType abstractType) { + List getPossibleTypes(AbstractType? abstractType) { if (abstractType is UnionTypeDefinition) { return abstractType.types; } @@ -128,7 +132,7 @@ GraphQLSchema buildSchema( assertValidSDL(documentAST); } */ - SchemaDefinitionNode schemaDef; + SchemaDefinitionNode? schemaDef; final _typeDefs = []; final _directiveDefs = []; @@ -165,16 +169,16 @@ GraphQLSchema buildSchema( ); } -Map _operationTypeMap( - Map typeMap, - SchemaDefinitionNode schemaDef, +Map _operationTypeMap( + Map typeMap, + SchemaDefinitionNode? schemaDef, ) { final operationTypeNames = _getOperationTypeNames(schemaDef); return Map.fromEntries( operationTypeNames.entries .map((e) => MapEntry( e.key.name, - typeMap[e.value] as ObjectTypeDefinition, + typeMap[e.value] as ObjectTypeDefinition?, )) .where((e) => e.value != null), ); @@ -182,7 +186,7 @@ Map _operationTypeMap( /// Resolve a map of { [OperationType]: [String] typeName } Map _getOperationTypeNames( - [SchemaDefinitionNode schema]) { + [SchemaDefinitionNode? schema]) { if (schema == null) { return { OperationType.query: "Query", diff --git a/gql/lib/src/validation/rules/lone_schema_definition.dart b/gql/lib/src/validation/rules/lone_schema_definition.dart index c10e17a62..c987d9dd9 100644 --- a/gql/lib/src/validation/rules/lone_schema_definition.dart +++ b/gql/lib/src/validation/rules/lone_schema_definition.dart @@ -4,7 +4,7 @@ import "package:gql/src/validation/validator.dart"; class MultipleSchemaDefinitionsError extends ValidationError { const MultipleSchemaDefinitionsError({ - SchemaDefinitionNode node, + SchemaDefinitionNode? node, }) : super( node: node, ); diff --git a/gql/lib/src/validation/rules/unique_argument_names.dart b/gql/lib/src/validation/rules/unique_argument_names.dart index 31562ada5..2b98a87e1 100644 --- a/gql/lib/src/validation/rules/unique_argument_names.dart +++ b/gql/lib/src/validation/rules/unique_argument_names.dart @@ -4,7 +4,7 @@ import "package:gql/src/validation/validator.dart"; class DuplicateArgumentNameError extends ValidationError { const DuplicateArgumentNameError({ - ArgumentNode node, + ArgumentNode? node, }) : super( node: node, ); diff --git a/gql/lib/src/validation/rules/unique_directive_names.dart b/gql/lib/src/validation/rules/unique_directive_names.dart index 2a1b1351e..64e76ebcb 100644 --- a/gql/lib/src/validation/rules/unique_directive_names.dart +++ b/gql/lib/src/validation/rules/unique_directive_names.dart @@ -4,7 +4,7 @@ import "package:gql/src/validation/validator.dart"; class DuplicateDirectiveNameError extends ValidationError { const DuplicateDirectiveNameError({ - DirectiveDefinitionNode node, + DirectiveDefinitionNode? node, }) : super( node: node, ); diff --git a/gql/lib/src/validation/rules/unique_enum_value_names.dart b/gql/lib/src/validation/rules/unique_enum_value_names.dart index 54a57ef94..4fffa0f5f 100644 --- a/gql/lib/src/validation/rules/unique_enum_value_names.dart +++ b/gql/lib/src/validation/rules/unique_enum_value_names.dart @@ -3,11 +3,11 @@ import "package:gql/src/validation/validating_visitor.dart"; import "package:gql/src/validation/validator.dart"; class DuplicateEnumValueNameError extends ValidationError { - final EnumValueDefinitionNode valueNode; + final EnumValueDefinitionNode? valueNode; const DuplicateEnumValueNameError({ this.valueNode, - NameNode nameNode, + NameNode? nameNode, }) : super( node: nameNode, ); diff --git a/gql/lib/src/validation/rules/unique_field_definition_names.dart b/gql/lib/src/validation/rules/unique_field_definition_names.dart index 42c9e1199..1e874466e 100644 --- a/gql/lib/src/validation/rules/unique_field_definition_names.dart +++ b/gql/lib/src/validation/rules/unique_field_definition_names.dart @@ -3,11 +3,11 @@ import "package:gql/src/validation/validating_visitor.dart"; import "package:gql/src/validation/validator.dart"; class DuplicateFieldDefinitionNameError extends ValidationError { - final TypeDefinitionNode typeNode; + final TypeDefinitionNode? typeNode; const DuplicateFieldDefinitionNameError({ this.typeNode, - NameNode nameNode, + NameNode? nameNode, }) : super( node: nameNode, ); diff --git a/gql/lib/src/validation/rules/unique_input_field_names.dart b/gql/lib/src/validation/rules/unique_input_field_names.dart index 7336fa8f6..5e8f451d7 100644 --- a/gql/lib/src/validation/rules/unique_input_field_names.dart +++ b/gql/lib/src/validation/rules/unique_input_field_names.dart @@ -4,7 +4,7 @@ import "package:gql/src/validation/validator.dart"; class DuplicateInputFieldNameError extends ValidationError { const DuplicateInputFieldNameError({ - ObjectFieldNode node, + ObjectFieldNode? node, }) : super( node: node, ); diff --git a/gql/lib/src/validation/rules/unique_operation_types.dart b/gql/lib/src/validation/rules/unique_operation_types.dart index 5a704b1d0..607fe4c84 100644 --- a/gql/lib/src/validation/rules/unique_operation_types.dart +++ b/gql/lib/src/validation/rules/unique_operation_types.dart @@ -4,7 +4,7 @@ import "package:gql/src/validation/validator.dart"; class DuplicateOperationTypeError extends ValidationError { const DuplicateOperationTypeError({ - OperationTypeDefinitionNode node, + OperationTypeDefinitionNode? node, }) : super( node: node, ); diff --git a/gql/lib/src/validation/rules/unique_type_names.dart b/gql/lib/src/validation/rules/unique_type_names.dart index d05348029..58cdb658f 100644 --- a/gql/lib/src/validation/rules/unique_type_names.dart +++ b/gql/lib/src/validation/rules/unique_type_names.dart @@ -4,7 +4,7 @@ import "package:gql/src/validation/validator.dart"; class DuplicateTypeNameError extends ValidationError { const DuplicateTypeNameError({ - TypeDefinitionNode node, + TypeDefinitionNode? node, }) : super( node: node, ); diff --git a/gql/lib/src/validation/validator.dart b/gql/lib/src/validation/validator.dart index 4c32aff23..c120eacaf 100644 --- a/gql/lib/src/validation/validator.dart +++ b/gql/lib/src/validation/validator.dart @@ -78,8 +78,8 @@ List validateRequest( /// A base class for validation errors @immutable abstract class ValidationError { - final String message; - final ast.Node node; + final String? message; + final ast.Node? node; const ValidationError({ this.message, @@ -99,7 +99,7 @@ enum ValidationRule { uniqueArgumentNames } -ValidatingVisitor _mapRule(ValidationRule rule) { +ValidatingVisitor? _mapRule(ValidationRule rule) { switch (rule) { case ValidationRule.uniqueDirectiveNames: return UniqueDirectiveNames(); @@ -126,14 +126,18 @@ class _Validator { Set rules; _Validator({ - this.rules, + this.rules = const {}, }); List validate({ - ast.Node node, + required ast.Node node, }) { final visitor = ast.AccumulatingVisitor( - visitors: rules.map(_mapRule).toList(), + visitors: rules + .map(_mapRule) + .where((e) => e != null) + .cast() + .toList(), ); node.accept(visitor); diff --git a/gql/pubspec.yaml b/gql/pubspec.yaml index ae23a3775..289b86b8c 100644 --- a/gql/pubspec.yaml +++ b/gql/pubspec.yaml @@ -1,15 +1,15 @@ name: gql -version: 0.12.4 +version: 0.13.0-nullsafety.2 description: GraphQL tools for parsing, transforming and printing GraphQL documents. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - source_span: ^1.5.5 - meta: ^1.1.7 - collection: ^1.14.11 + collection: ^1.15.0 + meta: ^1.3.0 + source_span: ^1.8.0 dev_dependencies: - test: ^1.0.0 - gql_pedantic: ^1.0.1 + gql_pedantic: ^1.0.2 + test: ^1.16.2 cats: path: ../cats diff --git a/gql/test/lexer_test.dart b/gql/test/lexer_test.dart index eb102b744..74eb03f72 100644 --- a/gql/test/lexer_test.dart +++ b/gql/test/lexer_test.dart @@ -3,27 +3,27 @@ import "package:source_span/source_span.dart"; import "package:test/test.dart"; Matcher token({ - TokenKind kind, - int start, - int end, - int line, - int column, - String value, + TokenKind? kind, + int? start, + int? end, + int? line, + int? column, + String? value, }) => predicate( (Token token) => token.kind == kind && - token.span.start.offset == start && - token.span.end.offset == end && - token.span.start.line == line - 1 && - token.span.start.column == column - 1 && + token.span!.start.offset == start && + token.span!.end.offset == end && + token.span!.start.line == line! - 1 && + token.span!.start.column == column! - 1 && (value == null || token.value == value), "token of ${kind} at $line:$column($start-$end) $value", ); void main() { group("Lexer", () { - Lexer lexer; + late Lexer lexer; List tokenize(String text, {bool skipComments = true}) => lexer.tokenize( diff --git a/gql/test/operation_test.dart b/gql/test/operation_test.dart index 20ee0417b..a28285875 100644 --- a/gql/test/operation_test.dart +++ b/gql/test/operation_test.dart @@ -15,7 +15,7 @@ void main() { test("Can dereference schemaType", () { final query = document.operations.first; - expect(query.schemaType.name, equals("StarWarsQuery")); + expect(query.schemaType!.name, equals("StarWarsQuery")); }); }); @@ -29,7 +29,7 @@ void main() { test("Can dereference fragmentType", () { final mutationField = document.operations.first.selectionSet.fields.first; - final spreads = mutationField.selectionSet.fragmentSpreads; + final spreads = mutationField.selectionSet!.fragmentSpreads; expect(spreads.first.fragment.name, equals("info")); final relationships = spreads[1].fragment; @@ -37,7 +37,7 @@ void main() { final relationshipsFriends = relationships.selectionSet.fields.first; expect( - relationshipsFriends.selectionSet.fragmentSpreads.first.fragment.name, + relationshipsFriends.selectionSet!.fragmentSpreads.first.fragment.name, equals("friendNetwork"), ); }); diff --git a/gql/test/parser_test.dart b/gql/test/parser_test.dart index 8172d28a1..5dab499f1 100644 --- a/gql/test/parser_test.dart +++ b/gql/test/parser_test.dart @@ -2,30 +2,31 @@ import "package:gql/src/language/parser.dart"; import "package:source_span/source_span.dart"; import "package:test/test.dart"; -final throwsSourceSpanException = ( +final Matcher Function(String, int, int, [int, int]) throwsSourceSpanException = + ( String message, int startLine, int startColumn, [ - int endLine, - int endColumn, + int? endLine, + int? endColumn, ]) => - throwsA( - allOf( - TypeMatcher(), - predicate( - (SourceSpanException e) => e.message == message, - "error messages match", - ), - predicate( - (SourceSpanException e) => - e.span.start.line == startLine - 1 && - e.span.start.column == startColumn - 1 && - e.span.end.line == (endLine ?? startLine) - 1 && - e.span.end.column == (endColumn ?? startColumn + 1) - 1, - "span matches", - ), - ), - ); + throwsA( + allOf( + TypeMatcher(), + predicate( + (SourceSpanException e) => e.message == message, + "error messages match", + ), + predicate( + (SourceSpanException e) => + e.span!.start.line == startLine - 1 && + e.span!.start.column == startColumn - 1 && + e.span!.end.line == (endLine ?? startLine) - 1 && + e.span!.end.column == (endColumn ?? startColumn + 1) - 1, + "span matches", + ), + ), + ); void main() { group("Parser", () { diff --git a/gql/test/scenarios_test.dart b/gql/test/scenarios_test.dart index 81fd54dec..e6120c06b 100644 --- a/gql/test/scenarios_test.dart +++ b/gql/test/scenarios_test.dart @@ -9,7 +9,7 @@ class RecursiveVisitor extends ast.RecursiveVisitor {} class MyDriver extends CatDriver { @override ast.DocumentNode parse({ - source, + required source, }) => lang.parseString(source); @@ -18,7 +18,7 @@ class MyDriver extends CatDriver { schema, dynamic testData, query, - String operation, + String? operation, variables, }) => null; @@ -29,7 +29,7 @@ class MyDriver extends CatDriver { query, validationRules, }) => - null; + []; } void main() { diff --git a/gql/test/schema_test.dart b/gql/test/schema_test.dart index fc5e6551f..753b52974 100644 --- a/gql/test/schema_test.dart +++ b/gql/test/schema_test.dart @@ -25,7 +25,7 @@ void main() { test("Can dereference an object interace", () { final droid = schema.getType("Droid") as ObjectTypeDefinition; expect( - droid.interfaces[0].name, + droid.interfaces[0]!.name, equals("Character"), ); }); @@ -44,25 +44,25 @@ void main() { }); test("schema.getPossibleTypes results", () { - final character = schema.getType("Character") as InterfaceTypeDefinition; + final character = schema.getType("Character") as InterfaceTypeDefinition?; final searchResult = schema.getType( "SearchResult", - ) as UnionTypeDefinition; + ) as UnionTypeDefinition?; - final human = schema.getType("Human") as ObjectTypeDefinition; - final droid = schema.getType("Droid") as ObjectTypeDefinition; - final starship = schema.getType("Starship") as ObjectTypeDefinition; + final human = schema.getType("Human") as ObjectTypeDefinition?; + final droid = schema.getType("Droid") as ObjectTypeDefinition?; + final starship = schema.getType("Starship") as ObjectTypeDefinition?; expect( schema.getPossibleTypes(searchResult), unorderedEquals( - {droid, starship, human}, + {droid, starship, human}, ), ); expect( schema.getPossibleTypes(character), - unorderedEquals({ + unorderedEquals({ droid, human, }), @@ -70,50 +70,51 @@ void main() { }); test("Type dereferencing", () { - final starshipsType = schema.query.getField("starships").type as ListType; + final starshipsType = + schema.query!.getField("starships").type as ListType; expect(starshipsType.baseTypeName, equals("Starship")); - final starship = (starshipsType.type as NamedType).type; + final starship = (starshipsType.type as NamedType).type!; expect(starship.runtimeType, equals(ObjectTypeDefinition)); expect(starship.name, equals("Starship")); }); test("mutation arguments", () { - final updateHuman = schema.mutation.getField("updateHuman"); + final updateHuman = schema.mutation!.getField("updateHuman"); - expect(updateHuman.args.first.name, equals("id")); - expect(updateHuman.args.first.type.isNonNull, equals(true)); + expect(updateHuman.args!.first.name, equals("id")); + expect(updateHuman.args!.first.type!.isNonNull, equals(true)); - final inputTypeRef = updateHuman.args.last.type as NamedType; + final inputTypeRef = updateHuman.args!.last.type as NamedType; expect(inputTypeRef.name, equals("HumanInput")); expect(inputTypeRef.isNonNull, equals(true)); expect(inputTypeRef.hasResolver, equals(true)); - final inputType = inputTypeRef.type; + final inputType = inputTypeRef.type!; expect(inputType.runtimeType, equals(InputObjectTypeDefinition)); expect(inputType.name, equals("HumanInput")); }); test("mutation arguments", () { - final updateHuman = schema.mutation.getField("updateHuman"); + final updateHuman = schema.mutation!.getField("updateHuman"); - expect(updateHuman.args.first.name, equals("id")); - expect(updateHuman.args.first.type.isNonNull, equals(true)); + expect(updateHuman.args!.first.name, equals("id")); + expect(updateHuman.args!.first.type!.isNonNull, equals(true)); - final inputTypeRef = updateHuman.args.last.type as NamedType; + final inputTypeRef = updateHuman.args!.last.type as NamedType; expect(inputTypeRef.name, equals("HumanInput")); expect(inputTypeRef.isNonNull, equals(true)); expect(inputTypeRef.hasResolver, equals(true)); - final inputType = inputTypeRef.type; + final inputType = inputTypeRef.type!; expect(inputType.runtimeType, equals(InputObjectTypeDefinition)); expect(inputType.name, equals("HumanInput")); }); test("Contains default directives", () { expect( - schema.directives.map((d) => d.name), + schema.directives!.map((d) => d.name), containsAll({"skip", "include", "deprecated"}), ); }); diff --git a/links/gql_dedupe_link/.gitignore b/links/gql_dedupe_link/.gitignore index 50602ac67..41ce92d94 100644 --- a/links/gql_dedupe_link/.gitignore +++ b/links/gql_dedupe_link/.gitignore @@ -4,6 +4,8 @@ # Remove the following pattern if you wish to check in your lock file pubspec.lock +test/**/*.mocks.dart + # Conventional directory for build outputs build/ diff --git a/links/gql_dedupe_link/CHANGELOG.md b/links/gql_dedupe_link/CHANGELOG.md index eb09d7f21..0ad2b6983 100644 --- a/links/gql_dedupe_link/CHANGELOG.md +++ b/links/gql_dedupe_link/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.0-nullsafety.1 + +Null Safety Pre-release + ## 1.0.10 - remove `author` field from `pubspec.yaml` diff --git a/links/gql_dedupe_link/lib/gql_dedupe_link.dart b/links/gql_dedupe_link/lib/gql_dedupe_link.dart index 7b66b942c..c121d8915 100644 --- a/links/gql_dedupe_link/lib/gql_dedupe_link.dart +++ b/links/gql_dedupe_link/lib/gql_dedupe_link.dart @@ -12,13 +12,13 @@ class DedupeLink extends Link { @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) { if (_inFlight.containsKey(request)) { - return _inFlight[request].split(); + return _inFlight[request]!.split(); } - final splitter = StreamSplitter(forward(request)); + final splitter = StreamSplitter(forward!(request)); _inFlight[request] = splitter; diff --git a/links/gql_dedupe_link/pubspec.yaml b/links/gql_dedupe_link/pubspec.yaml index 305dfcba3..ec04051b9 100644 --- a/links/gql_dedupe_link/pubspec.yaml +++ b/links/gql_dedupe_link/pubspec.yaml @@ -1,16 +1,16 @@ name: gql_dedupe_link -version: 1.0.10 +version: 2.0.0-nullsafety.1 description: GQL Link to deduplicate identical in-flight execution requests repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - meta: ^1.1.7 - gql_exec: ^0.2.5 - gql_link: ^0.3.1 - async: ^2.3.0 + meta: ^1.3.0 + gql_exec: ^0.3.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.1 + async: ^2.5.0 dev_dependencies: - test: ^1.0.0 - mockito: ^4.1.1 - gql: ^0.12.3 + test: ^1.16.2 + mockito: ^5.0.0-nullsafety.7 + gql: ^0.13.0-nullsafety.0 gql_pedantic: ^1.0.2 diff --git a/links/gql_dedupe_link/test/gql_dedupe_link_test.dart b/links/gql_dedupe_link/test/gql_dedupe_link_test.dart index edb959002..c2e90db22 100644 --- a/links/gql_dedupe_link/test/gql_dedupe_link_test.dart +++ b/links/gql_dedupe_link/test/gql_dedupe_link_test.dart @@ -7,7 +7,16 @@ import "package:gql_link/gql_link.dart"; import "package:mockito/mockito.dart"; import "package:test/test.dart"; -class MockLink extends Mock implements Link {} +class MockLink extends Mock implements Link { + @override + Stream request(Request? request, [NextLink? forward]) => + super.noSuchMethod( + Invocation.method(#request, [request, forward]), + returnValue: Stream.fromIterable( + [], + ), + ) as Stream; +} void main() { group("DedupeLink", () { diff --git a/links/gql_dio_link/CHANGELOG.md b/links/gql_dio_link/CHANGELOG.md index 1c04021d2..febfd4f05 100644 --- a/links/gql_dio_link/CHANGELOG.md +++ b/links/gql_dio_link/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.1.0-nullsafety.1] + +* Migrate to null-safety. + ## 0.0.5 - Pass original exception inside `DioLinkServerException` also if http request fails with error status and improve `DioLinkServerException.toString` to print part of plain response (even if it was not valid graphQL json). These should be helpful for debugging. diff --git a/links/gql_dio_link/analysis_options.yaml b/links/gql_dio_link/analysis_options.yaml index 8dd3be2b1..c2fb402dc 100644 --- a/links/gql_dio_link/analysis_options.yaml +++ b/links/gql_dio_link/analysis_options.yaml @@ -1 +1,5 @@ include: package:gql_pedantic/analysis_options.yaml + +analyzer: + exclude: + - **/*.mocks.dart diff --git a/links/gql_dio_link/lib/src/dio_link.dart b/links/gql_dio_link/lib/src/dio_link.dart index 3a9099efc..f8c5c480b 100644 --- a/links/gql_dio_link/lib/src/dio_link.dart +++ b/links/gql_dio_link/lib/src/dio_link.dart @@ -15,7 +15,7 @@ class HttpLinkHeaders extends ContextEntry { const HttpLinkHeaders({ this.headers = const {}, - }) : assert(headers != null); + }); @override List get fieldsForEquality => [ @@ -30,8 +30,8 @@ class DioLinkResponseContext extends ContextEntry { final int statusCode; const DioLinkResponseContext({ - @required this.statusCode, - }) : assert(statusCode != null); + required this.statusCode, + }); @override List get fieldsForEquality => [ @@ -41,13 +41,14 @@ class DioLinkResponseContext extends ContextEntry { extension _CastDioResponse on dio.Response { dio.Response castData() => dio.Response( - data: data as T, + data: data as T?, headers: headers, - request: request, + requestOptions: requestOptions, isRedirect: isRedirect, statusCode: statusCode, statusMessage: statusMessage, redirects: redirects, + extra: extra, ); } @@ -73,11 +74,11 @@ class DioLink extends Link { DioLink( this.endpoint, { - @required this.client, + required this.client, this.defaultHeaders = const {}, this.serializer = const RequestSerializer(), this.parser = const ResponseParser(), - }) : assert(client != null); + }); @override Stream request(Request request, [forward]) async* { @@ -85,15 +86,16 @@ class DioLink extends Link { await _executeDioRequest( body: _serializeRequest(request), headers: { - "Accept": "*/*", + dio.Headers.acceptHeader: "*/*", + dio.Headers.contentTypeHeader: dio.Headers.jsonContentType, ...defaultHeaders, ..._getHttpLinkHeaders(request), }, ); - if (dioResponse.statusCode >= 300 || - (dioResponse.data["data"] == null && - dioResponse.data["errors"] == null)) { + if (dioResponse.statusCode! >= 300 || + (dioResponse.data!["data"] == null && + dioResponse.data!["errors"] == null)) { throw DioLinkServerException( response: dioResponse, parsedResponse: _parseDioResponse(dioResponse), @@ -115,7 +117,7 @@ class DioLink extends Link { try { return response.context.withEntry( DioLinkResponseContext( - statusCode: httpResponse.statusCode, + statusCode: httpResponse.statusCode!, ), ); } catch (e) { @@ -126,8 +128,8 @@ class DioLink extends Link { } Future>> _executeDioRequest({ - @required Map body, - @required Map headers, + required Map body, + required Map headers, }) async { try { final res = await client.post( @@ -148,18 +150,18 @@ class DioLink extends Link { return res.castData>(); } on dio.DioError catch (e) { switch (e.type) { - case dio.DioErrorType.CONNECT_TIMEOUT: - case dio.DioErrorType.RECEIVE_TIMEOUT: - case dio.DioErrorType.SEND_TIMEOUT: + case dio.DioErrorType.connectTimeout: + case dio.DioErrorType.receiveTimeout: + case dio.DioErrorType.sendTimeout: throw DioLinkTimeoutException( type: e.type, originalException: e, ); - case dio.DioErrorType.CANCEL: + case dio.DioErrorType.cancel: throw DioLinkCanceledException(originalException: e); - case dio.DioErrorType.RESPONSE: + case dio.DioErrorType.response: { - final res = e.response; + final res = e.response!; final parsedResponse = (res.data is Map) ? parser.parseResponse(res.data as Map) : null; @@ -168,7 +170,7 @@ class DioLink extends Link { parsedResponse: parsedResponse, originalException: e); } - case dio.DioErrorType.DEFAULT: + case dio.DioErrorType.other: default: throw DioLinkUnkownException(originalException: e); } @@ -180,7 +182,7 @@ class DioLink extends Link { Response _parseDioResponse(dio.Response> dioResponse) { try { - return parser.parseResponse(dioResponse.data); + return parser.parseResponse(dioResponse.data!); } catch (e) { throw DioLinkParserException( originalException: e, @@ -202,7 +204,7 @@ class DioLink extends Link { Map _getHttpLinkHeaders(Request request) { try { - final HttpLinkHeaders linkHeaders = request.context.entry(); + final HttpLinkHeaders? linkHeaders = request.context.entry(); return { if (linkHeaders != null) ...linkHeaders.headers, }; @@ -215,6 +217,6 @@ class DioLink extends Link { /// Closes the underlining Dio client void close({bool force = false}) { - client?.close(force: force); + client.close(force: force); } } diff --git a/links/gql_dio_link/lib/src/exceptions.dart b/links/gql_dio_link/lib/src/exceptions.dart index 8cb2848db..a32ddf296 100644 --- a/links/gql_dio_link/lib/src/exceptions.dart +++ b/links/gql_dio_link/lib/src/exceptions.dart @@ -10,8 +10,8 @@ class DioLinkParserException extends ResponseFormatException { final dio.Response response; const DioLinkParserException({ - @required dynamic originalException, - @required this.response, + required dynamic originalException, + required this.response, }) : super( originalException: originalException, ); @@ -24,13 +24,14 @@ class DioLinkServerException extends ServerException { /// Response which caused the exception final dio.Response response; - const DioLinkServerException( - {@required this.response, - @required Response parsedResponse, - dynamic originalException}) - : super( - parsedResponse: parsedResponse, - originalException: originalException); + const DioLinkServerException({ + required this.response, + required Response? parsedResponse, + dynamic originalException, + }) : super( + parsedResponse: parsedResponse, + originalException: originalException, + ); @override String toString() { @@ -47,7 +48,7 @@ class DioLinkServerException extends ServerException { @immutable class DioLinkUnkownException extends LinkException { const DioLinkUnkownException({ - @required dynamic originalException, + required dynamic originalException, }) : super(originalException); } @@ -57,14 +58,14 @@ class DioLinkTimeoutException extends LinkException { final dio.DioErrorType type; const DioLinkTimeoutException({ - @required this.type, - @required dynamic originalException, + required this.type, + required dynamic originalException, }) : super(originalException); } @immutable class DioLinkCanceledException extends LinkException { const DioLinkCanceledException({ - @required dynamic originalException, + required dynamic originalException, }) : super(originalException); } diff --git a/links/gql_dio_link/pubspec.yaml b/links/gql_dio_link/pubspec.yaml index 0cbc54370..14e50ddae 100644 --- a/links/gql_dio_link/pubspec.yaml +++ b/links/gql_dio_link/pubspec.yaml @@ -1,17 +1,18 @@ name: gql_dio_link -version: 0.0.5 +version: 0.1.0-nullsafety.1 description: Similar to gql_http_link, gql_dio_link is a GQL Terminating Link to execute requests via Dio using JSON repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - dio: ^3.0.9 - gql_link: ^0.3.1 - gql_exec: ^0.2.5 - meta: ^1.1.8 + dio: ^4.0.0 + gql_exec: ^0.3.0-nullsafety.2 + gql_link: ^0.4.0-nullsafety.3 + meta: ^1.3.0 dev_dependencies: - test: ^1.0.0 - mockito: ^4.1.1 - gql: ^0.12.3 + build_runner: ^1.11.5 + collection: ^1.15.0 + gql: ^0.13.0-nullsafety.2 gql_pedantic: ^1.0.2 - collection: ^1.14.12 + mockito: ^5.0.0 + test: ^1.14.3 diff --git a/links/gql_dio_link/test/gql_dio_link_test.dart b/links/gql_dio_link/test/gql_dio_link_test.dart index 8b302b628..bd24ad1ab 100644 --- a/links/gql_dio_link/test/gql_dio_link_test.dart +++ b/links/gql_dio_link/test/gql_dio_link_test.dart @@ -9,14 +9,11 @@ import "package:gql/language.dart"; import "package:gql_dio_link/gql_dio_link.dart"; import "package:gql_exec/gql_exec.dart"; import "package:gql_link/gql_link.dart"; +import "package:mockito/annotations.dart"; import "package:mockito/mockito.dart"; import "package:test/test.dart"; -class MockClient extends Mock implements dio.Dio {} - -class MockRequestSerializer extends Mock implements RequestSerializer {} - -class MockResponseParser extends Mock implements ResponseParser {} +import "gql_dio_link_test.mocks.dart"; extension on dio.Options { bool extEqual(Object o) { @@ -31,37 +28,43 @@ extension on dio.Options { o.responseType == responseType && o.contentType == contentType && o.validateStatus == validateStatus && + o.receiveDataWhenStatusError == receiveDataWhenStatusError && + o.followRedirects == followRedirects && o.maxRedirects == maxRedirects && o.requestEncoder == requestEncoder && - o.responseDecoder == responseDecoder; + o.responseDecoder == responseDecoder && + o.listFormat == listFormat; } } -// Adaptd tests from ``gql_http_link`` tests +// Adapted tests from ``gql_http_link`` tests // https://github.com/gql-dart/gql/blob/master/gql_http_link/test/gql_http_link_test.dart +@GenerateMocks([dio.Dio, RequestSerializer]) void main() { group("DioLink", () { - MockClient client; - Request request; - DioLink link; + late MockDio client; + late Request request; + late String path; + late DioLink link; final Stream Function([ - Request customRequest, + Request? customRequest, ]) execute = ([ - Request customRequest, + Request? customRequest, ]) => link.request(customRequest ?? request); setUp(() { - client = MockClient(); + client = MockDio(); request = Request( operation: Operation( document: parseString("query MyQuery {}"), ), variables: const {"i": 12}, ); + path = "/graphql-test"; link = DioLink( - "/graphql-test", + path, client: client, ); }); @@ -80,6 +83,7 @@ void main() { "data": {}, }, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); @@ -117,6 +121,7 @@ void main() { "data": {}, }, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); @@ -125,7 +130,7 @@ void main() { verify( client.post( - "/graphql-test", + path, data: anyNamed("data"), options: anyNamed("options"), ), @@ -140,14 +145,24 @@ void main() { options: anyNamed("options"), ), ).thenAnswer( - (_) => Future.value( - dio.Response>( - data: { - "data": {}, - }, - statusCode: 200, - ), - ), + (invocation) { + final options = invocation.namedArguments.entries + .firstWhere((element) => element.key == Symbol("options")) + .value as dio.Options; + print(options.headers); + return Future.value( + dio.Response>( + data: { + "data": {}, + }, + statusCode: 200, + requestOptions: dio.RequestOptions( + path: path, + headers: options.headers, + ), + ), + ); + }, ); await execute().first; @@ -160,8 +175,8 @@ void main() { predicate((dio.Options o) => o.extEqual(dio.Options( responseType: dio.ResponseType.json, headers: { - dio.Headers.contentTypeHeader: "application/json", - "Accept": "*/*", + dio.Headers.contentTypeHeader: dio.Headers.jsonContentType, + dio.Headers.acceptHeader: "*/*", }, ))), named: "options", @@ -178,14 +193,23 @@ void main() { options: anyNamed("options"), ), ).thenAnswer( - (_) => Future.value( - dio.Response>( - data: { - "data": {}, - }, - statusCode: 200, - ), - ), + (invocation) { + final options = invocation.namedArguments.entries + .firstWhere((element) => element.key == Symbol("options")) + .value as dio.Options; + return Future.value( + dio.Response>( + data: { + "data": {}, + }, + statusCode: 200, + requestOptions: dio.RequestOptions( + path: path, + headers: options.headers, + ), + ), + ); + }, ); await execute( @@ -214,8 +238,8 @@ void main() { predicate((dio.Options o) => o.extEqual(dio.Options( responseType: dio.ResponseType.json, headers: { - dio.Headers.contentTypeHeader: "application/json", - "Accept": "*/*", + dio.Headers.contentTypeHeader: dio.Headers.jsonContentType, + dio.Headers.acceptHeader: "*/*", "foo": "bar", }, ))), @@ -226,9 +250,9 @@ void main() { }); test("adds default headers", () async { - final client = MockClient(); + final client = MockDio(); final link = DioLink( - "/graphql-test", + path, client: client, defaultHeaders: { "foo": "bar", @@ -248,6 +272,7 @@ void main() { "data": {}, }, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); @@ -271,8 +296,9 @@ void main() { predicate((dio.Options o) => o.extEqual(dio.Options( responseType: dio.ResponseType.json, headers: { - dio.Headers.contentTypeHeader: "application/json", - "Accept": "*/*", + dio.Headers.contentTypeHeader: + dio.Headers.jsonContentType, + dio.Headers.acceptHeader: "*/*", "foo": "bar", }))), named: "options", @@ -295,6 +321,7 @@ void main() { "data": {}, }, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); @@ -326,7 +353,7 @@ void main() { responseType: dio.ResponseType.json, headers: { dio.Headers.contentTypeHeader: "application/jsonize", - "Accept": "*/*", + dio.Headers.acceptHeader: "*/*", }))), named: "options", ), @@ -348,6 +375,7 @@ void main() { "data": {}, }, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); @@ -397,6 +425,7 @@ void main() { "data": {}, }, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); @@ -435,6 +464,7 @@ void main() { "data": {"something": "random text 55656"}, }, statusCode: 300, + requestOptions: dio.RequestOptions(path: path), ); when( @@ -449,7 +479,7 @@ void main() { ), ); - DioLinkServerException exception; + DioLinkServerException? exception; try { await execute().first; @@ -462,7 +492,7 @@ void main() { TypeMatcher(), ); expect( - exception.response.data, + exception!.response.data, response.data, ); expect( @@ -489,10 +519,18 @@ void main() { }); test("throws DioLinkServerException for dio error response", () async { + final opts = dio.RequestOptions( + responseType: dio.ResponseType.json, + path: "/", + ); final error = dio.DioError( - response: - dio.Response(data: "Not authenticated", statusCode: 401), - type: dio.DioErrorType.RESPONSE); + requestOptions: opts, + response: dio.Response( + requestOptions: opts, + data: "Not authenticated", + statusCode: 401, + ), + type: dio.DioErrorType.response); when( client.post( @@ -504,7 +542,7 @@ void main() { error, ); - DioLinkServerException exception; + late DioLinkServerException exception; try { await execute().first; @@ -518,11 +556,11 @@ void main() { ); expect( exception.response.data, - error.response.data, + error.response!.data, ); expect( exception.response.statusCode, - error.response.statusCode, + error.response!.statusCode, ); // Failed to parse non-grahpql formatted body, so therefore null expect( @@ -533,12 +571,12 @@ void main() { expect(exception.originalException != null, true); final dioException = exception.originalException as dio.DioError; - expect(dioException.response.data, "Not authenticated"); - expect(dioException.response.statusCode, 401); - expect(dioException.type, dio.DioErrorType.RESPONSE); + expect(dioException.response!.data, "Not authenticated"); + expect(dioException.response!.statusCode, 401); + expect(dioException.type, dio.DioErrorType.response); expect(exception.toString(), - "DioLinkServerException(originalException: DioError [DioErrorType.RESPONSE]: , status: 401, response: Not authenticated"); + "DioLinkServerException(originalException: DioError [DioErrorType.response]: , status: 401, response: Not authenticated"); }); test("throws HttpLinkServerException when no data and errors", () async { @@ -547,6 +585,7 @@ void main() { "test": {"something": "random text 55656"}, }, statusCode: 300, + requestOptions: dio.RequestOptions(path: path), ); when( @@ -561,7 +600,7 @@ void main() { ), ); - DioLinkServerException exception; + DioLinkServerException? exception; try { await execute().first; @@ -574,7 +613,7 @@ void main() { TypeMatcher(), ); expect( - exception.response.data, + exception!.response.data, response.data, ); expect( @@ -596,10 +635,10 @@ void main() { test("throws SerializerException when unable to serialize request", () async { - final client = MockClient(); + final client = MockDio(); final serializer = MockRequestSerializer(); final link = DioLink( - "/graphql-test", + path, client: client, serializer: serializer, ); @@ -615,6 +654,7 @@ void main() { (_) => Future.value(dio.Response>( data: {}, statusCode: 200, + requestOptions: dio.RequestOptions(path: path), )), ); @@ -624,7 +664,7 @@ void main() { ), ).thenThrow(originalException); - RequestFormatException exception; + RequestFormatException? exception; try { await link @@ -646,7 +686,7 @@ void main() { TypeMatcher(), ); expect( - exception.originalException, + exception!.originalException, originalException, ); }); @@ -663,11 +703,12 @@ void main() { dio.Response( data: "foobar", statusCode: 200, + requestOptions: dio.RequestOptions(path: path), ), ), ); - ResponseFormatException exception; + ResponseFormatException? exception; try { await link diff --git a/links/gql_dio_link/test/gql_dio_link_test.mocks.dart b/links/gql_dio_link/test/gql_dio_link_test.mocks.dart new file mode 100644 index 000000000..cec06a87d --- /dev/null +++ b/links/gql_dio_link/test/gql_dio_link_test.mocks.dart @@ -0,0 +1,379 @@ +// Mocks generated by Mockito 5.0.2 from annotations +// in gql_dio_link/test/gql_dio_link_test.dart. +// Do not manually edit this file. + +import "dart:async" as _i8; + +import "package:dio/src/adapter.dart" as _i3; +import "package:dio/src/cancel_token.dart" as _i9; +import "package:dio/src/dio.dart" as _i7; +import "package:dio/src/interceptor.dart" as _i5; +import "package:dio/src/options.dart" as _i2; +import "package:dio/src/response.dart" as _i6; +import "package:dio/src/transformer.dart" as _i4; +import "package:gql_exec/src/request.dart" as _i11; +import "package:gql_link/src/request_serializer.dart" as _i10; +import "package:mockito/mockito.dart" as _i1; + +// ignore_for_file: comment_references +// ignore_for_file: unnecessary_parenthesis + +class _FakeBaseOptions extends _i1.Fake implements _i2.BaseOptions {} + +class _FakeHttpClientAdapter extends _i1.Fake implements _i3.HttpClientAdapter { +} + +class _FakeTransformer extends _i1.Fake implements _i4.Transformer {} + +class _FakeInterceptors extends _i1.Fake implements _i5.Interceptors {} + +class _FakeResponse extends _i1.Fake implements _i6.Response {} + +/// A class which mocks [Dio]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockDio extends _i1.Mock implements _i7.Dio { + MockDio() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.BaseOptions get options => + (super.noSuchMethod(Invocation.getter(#options), + returnValue: _FakeBaseOptions()) as _i2.BaseOptions); + @override + set options(_i2.BaseOptions? _options) => + super.noSuchMethod(Invocation.setter(#options, _options), + returnValueForMissingStub: null); + @override + _i3.HttpClientAdapter get httpClientAdapter => + (super.noSuchMethod(Invocation.getter(#httpClientAdapter), + returnValue: _FakeHttpClientAdapter()) as _i3.HttpClientAdapter); + @override + set httpClientAdapter(_i3.HttpClientAdapter? _httpClientAdapter) => super + .noSuchMethod(Invocation.setter(#httpClientAdapter, _httpClientAdapter), + returnValueForMissingStub: null); + @override + _i4.Transformer get transformer => + (super.noSuchMethod(Invocation.getter(#transformer), + returnValue: _FakeTransformer()) as _i4.Transformer); + @override + set transformer(_i4.Transformer? _transformer) => + super.noSuchMethod(Invocation.setter(#transformer, _transformer), + returnValueForMissingStub: null); + @override + _i5.Interceptors get interceptors => + (super.noSuchMethod(Invocation.getter(#interceptors), + returnValue: _FakeInterceptors()) as _i5.Interceptors); + @override + void close({bool? force = false}) => + super.noSuchMethod(Invocation.method(#close, [], {#force: force}), + returnValueForMissingStub: null); + @override + _i8.Future<_i6.Response> get(String? path, + {Map? queryParameters, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#get, [ + path + ], { + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> getUri(Uri? uri, + {_i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#getUri, [ + uri + ], { + #options: options, + #cancelToken: cancelToken, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> post(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#post, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> postUri(Uri? uri, + {dynamic data, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#postUri, [ + uri + ], { + #data: data, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> put(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#put, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> putUri(Uri? uri, + {dynamic data, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#putUri, [ + uri + ], { + #data: data, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> head(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i9.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#head, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> headUri(Uri? uri, + {dynamic data, _i2.Options? options, _i9.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#headUri, [uri], + {#data: data, #options: options, #cancelToken: cancelToken}), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> delete(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i9.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#delete, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> deleteUri(Uri? uri, + {dynamic data, _i2.Options? options, _i9.CancelToken? cancelToken}) => + (super.noSuchMethod( + Invocation.method(#deleteUri, [uri], + {#data: data, #options: options, #cancelToken: cancelToken}), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> patch(String? path, + {dynamic data, + Map? queryParameters, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#patch, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> patchUri(Uri? uri, + {dynamic data, + _i2.Options? options, + _i9.CancelToken? cancelToken, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#patchUri, [ + uri + ], { + #data: data, + #options: options, + #cancelToken: cancelToken, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> download(String? urlPath, dynamic savePath, + {_i2.ProgressCallback? onReceiveProgress, + Map? queryParameters, + _i9.CancelToken? cancelToken, + bool? deleteOnError = true, + String? lengthHeader = r"content-length", + dynamic data, + _i2.Options? options}) => + (super.noSuchMethod( + Invocation.method(#download, [ + urlPath, + savePath + ], { + #onReceiveProgress: onReceiveProgress, + #queryParameters: queryParameters, + #cancelToken: cancelToken, + #deleteOnError: deleteOnError, + #lengthHeader: lengthHeader, + #data: data, + #options: options + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> downloadUri(Uri? uri, dynamic savePath, + {_i2.ProgressCallback? onReceiveProgress, + _i9.CancelToken? cancelToken, + bool? deleteOnError = true, + String? lengthHeader = r"content-length", + dynamic data, + _i2.Options? options}) => + (super.noSuchMethod( + Invocation.method(#downloadUri, [ + uri, + savePath + ], { + #onReceiveProgress: onReceiveProgress, + #cancelToken: cancelToken, + #deleteOnError: deleteOnError, + #lengthHeader: lengthHeader, + #data: data, + #options: options + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> request(String? path, + {dynamic data, + Map? queryParameters, + _i9.CancelToken? cancelToken, + _i2.Options? options, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#request, [ + path + ], { + #data: data, + #queryParameters: queryParameters, + #cancelToken: cancelToken, + #options: options, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> requestUri(Uri? uri, + {dynamic data, + _i9.CancelToken? cancelToken, + _i2.Options? options, + _i2.ProgressCallback? onSendProgress, + _i2.ProgressCallback? onReceiveProgress}) => + (super.noSuchMethod( + Invocation.method(#requestUri, [ + uri + ], { + #data: data, + #cancelToken: cancelToken, + #options: options, + #onSendProgress: onSendProgress, + #onReceiveProgress: onReceiveProgress + }), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); + @override + _i8.Future<_i6.Response> fetch(_i2.RequestOptions? requestOptions) => + (super.noSuchMethod(Invocation.method(#fetch, [requestOptions]), + returnValue: Future.value(_FakeResponse())) + as _i8.Future<_i6.Response>); +} + +/// A class which mocks [RequestSerializer]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRequestSerializer extends _i1.Mock implements _i10.RequestSerializer { + MockRequestSerializer() { + _i1.throwOnMissingStub(this); + } + + @override + Map serializeRequest(_i11.Request? request) => + (super.noSuchMethod(Invocation.method(#serializeRequest, [request]), + returnValue: {}) as Map); +} diff --git a/links/gql_error_link/CHANGELOG.md b/links/gql_error_link/CHANGELOG.md index 2de4e73c5..93f3b36ee 100644 --- a/links/gql_error_link/CHANGELOG.md +++ b/links/gql_error_link/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.0-nullsafety.1 + +Null Safety Pre-release + ## 0.1.0 - Error Link diff --git a/links/gql_error_link/example/gql_error_link_example.dart b/links/gql_error_link/example/gql_error_link_example.dart index ff7c021c7..b102f5177 100644 --- a/links/gql_error_link/example/gql_error_link_example.dart +++ b/links/gql_error_link/example/gql_error_link_example.dart @@ -16,7 +16,7 @@ final terminatingLink = Link.function( // Otherwise, yield some [Response]. yield Response( - data: { + data: { "magic": token.token, }, ); @@ -25,7 +25,7 @@ final terminatingLink = Link.function( // In this case [AuthToken] is a simple container of a [String] token. class AuthToken extends ContextEntry { - final String token; + final String? token; const AuthToken({this.token}); diff --git a/links/gql_error_link/lib/gql_error_link.dart b/links/gql_error_link/lib/gql_error_link.dart index 1f5a4d261..a8ff98b2d 100644 --- a/links/gql_error_link/lib/gql_error_link.dart +++ b/links/gql_error_link/lib/gql_error_link.dart @@ -7,14 +7,14 @@ import "package:gql_link/gql_link.dart"; import "package:gql_exec/gql_exec.dart"; /// A handler of GraphQL errors. -typedef ErrorHandler = Stream Function( +typedef ErrorHandler = Stream? Function( Request request, NextLink forward, Response response, ); /// A handler of Link Exceptions. -typedef ExceptionHandler = Stream Function( +typedef ExceptionHandler = Stream? Function( Request request, NextLink forward, LinkException exception, @@ -28,8 +28,8 @@ typedef ExceptionHandler = Stream Function( /// `null`, the original stream is left intact and will be allowed to continue /// streaming new events. class ErrorLink extends Link { - final ErrorHandler onGraphQLError; - final ExceptionHandler onException; + final ErrorHandler? onGraphQLError; + final ExceptionHandler? onException; const ErrorLink({ this.onGraphQLError, @@ -41,12 +41,12 @@ class ErrorLink extends Link { Request request, [ forward, ]) async* { - await for (final result in Result.captureStream(forward(request))) { + await for (final result in Result.captureStream(forward!(request))) { if (result.isError) { - final error = result.asError.error; + final error = result.asError!.error; if (onException != null && error is LinkException) { - final stream = onException(request, forward, error); + final stream = onException!(request, forward, error); if (stream != null) { yield* stream; @@ -59,11 +59,11 @@ class ErrorLink extends Link { } if (result.isValue) { - final response = result.asValue.value; + final response = result.asValue!.value; final errors = response.errors; if (onGraphQLError != null && errors != null && errors.isNotEmpty) { - final stream = onGraphQLError(request, forward, response); + final stream = onGraphQLError!(request, forward, response); if (stream != null) { yield* stream; diff --git a/links/gql_error_link/pubspec.yaml b/links/gql_error_link/pubspec.yaml index 5def81362..5b5c9bb0c 100644 --- a/links/gql_error_link/pubspec.yaml +++ b/links/gql_error_link/pubspec.yaml @@ -1,16 +1,16 @@ name: gql_error_link -version: 0.1.0 +version: 0.2.0-nullsafety.1 description: GQL Link to handle execution errors and exceptions repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - async: ^2.3.0 - gql_exec: ^0.2.5 - gql_link: ^0.3.1 - meta: ^1.1.7 + async: ^2.5.0 + gql_exec: ^0.3.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.1 + meta: ^1.3.0 dev_dependencies: - test: ^1.0.0 - mockito: ^4.1.1 - gql: ^0.12.3 + test: ^1.16.2 + mockito: ^5.0.0-nullsafety.7 + gql: ^0.13.0-nullsafety.1 gql_pedantic: ^1.0.2 diff --git a/links/gql_error_link/test/gql_error_link_test.dart b/links/gql_error_link/test/gql_error_link_test.dart index 2e9107c0e..e6f4a9a9e 100644 --- a/links/gql_error_link/test/gql_error_link_test.dart +++ b/links/gql_error_link/test/gql_error_link_test.dart @@ -1,5 +1,6 @@ import "dart:async"; +import "package:gql/language.dart"; import "package:gql_error_link/gql_error_link.dart"; import "package:gql_exec/gql_exec.dart"; import "package:gql_link/gql_link.dart"; @@ -19,13 +20,18 @@ class TestException extends LinkException { } void main() { + Request req() => Request( + operation: Operation(document: parseString("")), + variables: const {"i": 12}, + ); + group("ErrorLink", () { group("passthrough", () { test("response", () { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Stream.fromIterable([ Response(data: const {"a": 1}), ]), @@ -44,7 +50,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Stream.fromIterable([ Response( data: const {"a": 1}, @@ -73,7 +79,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error(TestException(1)), @@ -94,7 +100,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Stream.fromIterable([ Response(data: const {"a": 1}), Response(data: const {"a": 1}), @@ -115,7 +121,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.value(Response(data: const {"a": 1})), @@ -138,7 +144,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error(TestException(1)), @@ -161,7 +167,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error(TestException(1)), @@ -186,7 +192,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error("exception"), @@ -215,7 +221,7 @@ void main() { ); final responseStream = errorLink.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error(TestException(1)), @@ -249,7 +255,7 @@ void main() { ); final responseStream = errorLink.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error(TestException(1)), @@ -280,7 +286,7 @@ void main() { ); final responseStream = errorLink.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.error(TestException(1)), @@ -305,7 +311,7 @@ void main() { final link = ErrorLink(); final responseStream = link.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.value( @@ -336,7 +342,7 @@ void main() { ); final responseStream = errorLink.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.value( @@ -384,7 +390,7 @@ void main() { ); final responseStream = errorLink.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.value( @@ -429,7 +435,7 @@ void main() { ); final responseStream = errorLink.request( - null, + req(), (request) => Result.releaseStream( Stream.fromIterable([ Result.value( diff --git a/links/gql_exec/CHANGELOG.md b/links/gql_exec/CHANGELOG.md index 774603d90..bb6d544b5 100644 --- a/links/gql_exec/CHANGELOG.md +++ b/links/gql_exec/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.0-nullsafety.2 + +Null Safety Pre-release + ## 0.2.5 - Mape `Operation.toString` more interpretable with `json.encode(printNode(document))` diff --git a/links/gql_exec/lib/src/context.dart b/links/gql_exec/lib/src/context.dart index 0574d99a9..a569fc1e7 100644 --- a/links/gql_exec/lib/src/context.dart +++ b/links/gql_exec/lib/src/context.dart @@ -14,13 +14,13 @@ abstract class ContextEntry { const ContextEntry(); /// List of values to be used for equality. - List get fieldsForEquality; + List get fieldsForEquality; @override bool operator ==(Object o) => identical(this, o) || (o.runtimeType == runtimeType && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( (o as ContextEntry).fieldsForEquality, @@ -28,7 +28,7 @@ abstract class ContextEntry { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( fieldsForEquality, @@ -41,21 +41,19 @@ abstract class ContextEntry { /// Context entries appear only once per type. @immutable class Context { - final Map _context; + final Map _context; /// Create an empty context. /// /// Entries may be added later using [withEntry]. const Context() : _context = const {}; - const Context._fromMap(Map context) - : _context = context, - assert(context != null); + const Context._fromMap(Map context) : _context = context; /// Creates a context from initial values represented as a map /// /// Every values runtime [Type] must be exactly the [Type] defined by the key. - factory Context.fromMap(Map context) { + factory Context.fromMap(Map context) { assert( context.entries.every( (entry) => entry.value == null || entry.value.runtimeType == entry.key, @@ -70,8 +68,7 @@ class Context { /// /// If more then one entry per type is provided, the last one is used. Context.fromList(List entries) - : assert(entries != null), - _context = entries.fold( + : _context = entries.fold>( {}, (ctx, e) => { ...ctx, @@ -80,7 +77,7 @@ class Context { ); /// Create a [Context] with [entry] added to the existing entries. - Context withEntry(T entry) { + Context withEntry(T? entry) { if (entry != null && T != entry.runtimeType) { throw ArgumentError.value( entry, @@ -90,7 +87,7 @@ class Context { } return Context.fromMap( - { + { ..._context, T: entry, }, @@ -99,7 +96,7 @@ class Context { /// Create a [Context] by updating entry of type [T] Context updateEntry( - ContextUpdater update, + ContextUpdater update, ) => withEntry( update( @@ -113,7 +110,7 @@ class Context { /// the [defaultValue] is returned. /// /// If provided, [defaultValue] must exactly match the return type [T]. - T entry([T defaultValue]) { + T? entry([T? defaultValue]) { if (defaultValue != null && T != defaultValue.runtimeType) { throw ArgumentError.value( defaultValue, @@ -121,7 +118,7 @@ class Context { "does not match the expected return type '${T}'", ); } - return _context.containsKey(T) ? _context[T] as T : defaultValue; + return _context.containsKey(T) ? _context[T] as T? : defaultValue; } List _getChildren() => [ @@ -132,7 +129,7 @@ class Context { bool operator ==(Object o) => identical(this, o) || (o is Context && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( o._getChildren(), @@ -140,7 +137,7 @@ class Context { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _getChildren(), diff --git a/links/gql_exec/lib/src/error.dart b/links/gql_exec/lib/src/error.dart index 570e06313..9a3c37297 100644 --- a/links/gql_exec/lib/src/error.dart +++ b/links/gql_exec/lib/src/error.dart @@ -8,22 +8,22 @@ class GraphQLError { final String message; /// Locations of the nodes in document which caused the error - final List locations; + final List? locations; /// Path of the error node in the query - final List path; + final List? path; /// Implementation-specific extensions to this error - final Map extensions; + final Map? extensions; const GraphQLError({ - @required this.message, + required this.message, this.locations, this.path, this.extensions, - }) : assert(message != null); + }); - List _getChildren() => [ + List _getChildren() => [ message, locations, path, @@ -38,7 +38,7 @@ class GraphQLError { bool operator ==(Object o) => identical(this, o) || (o is GraphQLError && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( o._getChildren(), @@ -46,7 +46,7 @@ class GraphQLError { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _getChildren(), @@ -60,10 +60,9 @@ class ErrorLocation { final int column; const ErrorLocation({ - @required this.line, - @required this.column, - }) : assert(line != null), - assert(column != null); + required this.line, + required this.column, + }); List _getChildren() => [ line, @@ -74,7 +73,7 @@ class ErrorLocation { bool operator ==(Object o) => identical(this, o) || (o is ErrorLocation && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( o._getChildren(), @@ -82,7 +81,7 @@ class ErrorLocation { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _getChildren(), diff --git a/links/gql_exec/lib/src/operation.dart b/links/gql_exec/lib/src/operation.dart index a4822e80b..8199fcc91 100644 --- a/links/gql_exec/lib/src/operation.dart +++ b/links/gql_exec/lib/src/operation.dart @@ -14,14 +14,14 @@ class Operation { /// Name of the executable definition /// /// Must be specified if [document] contains more than one [OperationDefinitionNode] - final String operationName; + final String? operationName; const Operation({ - @required this.document, + required this.document, this.operationName, - }) : assert(document != null); + }); - List _getChildren() => [ + List _getChildren() => [ document, operationName, ]; @@ -30,7 +30,7 @@ class Operation { bool operator ==(Object o) => identical(this, o) || (o is Operation && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( o._getChildren(), @@ -38,7 +38,7 @@ class Operation { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _getChildren(), diff --git a/links/gql_exec/lib/src/request.dart b/links/gql_exec/lib/src/request.dart index 16f512170..7b4dbcafc 100644 --- a/links/gql_exec/lib/src/request.dart +++ b/links/gql_exec/lib/src/request.dart @@ -16,11 +16,10 @@ class Request { final Context context; const Request({ - @required this.operation, + required this.operation, this.variables = const {}, this.context = const Context(), - }) : assert(operation != null), - assert(context != null); + }); /// Clone this request adding an [entry] to [context] Request withContextEntry(T entry) => Request( @@ -31,7 +30,7 @@ class Request { /// Clone this request updating an [entry] in the [context] Request updateContextEntry( - ContextUpdater update, + ContextUpdater update, ) => Request( operation: operation, @@ -49,7 +48,7 @@ class Request { bool operator ==(Object o) => identical(this, o) || (o is Request && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( o._getChildren(), @@ -57,7 +56,7 @@ class Request { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _getChildren(), diff --git a/links/gql_exec/lib/src/response.dart b/links/gql_exec/lib/src/response.dart index 0de811235..aab91421a 100644 --- a/links/gql_exec/lib/src/response.dart +++ b/links/gql_exec/lib/src/response.dart @@ -7,12 +7,12 @@ import "package:meta/meta.dart"; @immutable class Response { /// Error returned executing the [Request] - final List errors; + final List? errors; /// Data returned executing the [Request] /// /// Follows the shape of requested document. - final Map data; + final Map? data; /// A [Context] to be returned along with a [Response] final Context context; @@ -21,7 +21,7 @@ class Response { this.errors, this.data, this.context = const Context(), - }) : assert(context != null); + }); /// Clone this response adding an [entry] to [context] Response withContextEntry(T entry) => Response( @@ -32,7 +32,7 @@ class Response { /// Clone this response updating an [entry] to [context] Response updateContextEntry( - ContextUpdater update, + ContextUpdater update, ) => Response( errors: errors, @@ -40,7 +40,7 @@ class Response { context: context.updateEntry(update), ); - List _getChildren() => [ + List _getChildren() => [ errors, data, context, @@ -50,7 +50,7 @@ class Response { bool operator ==(Object o) => identical(this, o) || (o is Response && - const ListEquality( + const ListEquality( DeepCollectionEquality(), ).equals( o._getChildren(), @@ -58,7 +58,7 @@ class Response { )); @override - int get hashCode => const ListEquality( + int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash( _getChildren(), @@ -73,14 +73,14 @@ class Response { @immutable class ResponseExtensions extends ContextEntry { /// [Response] extensions - final dynamic extensions; + final dynamic? extensions; - const ResponseExtensions( + const ResponseExtensions([ this.extensions, - ); + ]); @override - List get fieldsForEquality => [ - extensions, + List get fieldsForEquality => [ + extensions as Object?, ]; } diff --git a/links/gql_exec/pubspec.yaml b/links/gql_exec/pubspec.yaml index f3e4a6904..8c7847ca0 100644 --- a/links/gql_exec/pubspec.yaml +++ b/links/gql_exec/pubspec.yaml @@ -1,13 +1,13 @@ name: gql_exec -version: 0.2.5 +version: 0.3.0-nullsafety.2 description: Basis for GraphQL execution layer to support Link and Client. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - gql: ^0.12.3 - meta: ^1.1.7 - collection: ^1.14.11 + collection: ^1.15.0 + meta: ^1.3.0 + gql: ^0.13.0-nullsafety.1 dev_dependencies: - test: ^1.0.0 + test: ^1.16.2 gql_pedantic: ^1.0.2 diff --git a/links/gql_http_link/.gitignore b/links/gql_http_link/.gitignore index 50602ac67..41ce92d94 100644 --- a/links/gql_http_link/.gitignore +++ b/links/gql_http_link/.gitignore @@ -4,6 +4,8 @@ # Remove the following pattern if you wish to check in your lock file pubspec.lock +test/**/*.mocks.dart + # Conventional directory for build outputs build/ diff --git a/links/gql_http_link/CHANGELOG.md b/links/gql_http_link/CHANGELOG.md index d3c060739..9ec58728d 100644 --- a/links/gql_http_link/CHANGELOG.md +++ b/links/gql_http_link/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.0-nullsafety.1 + +Null Safety Pre-release + ## 0.3.3 - Add `HttpResponseDecoder httpResponseDecoder` constructor parameter diff --git a/links/gql_http_link/analysis_options.yaml b/links/gql_http_link/analysis_options.yaml index 8dd3be2b1..c2fb402dc 100644 --- a/links/gql_http_link/analysis_options.yaml +++ b/links/gql_http_link/analysis_options.yaml @@ -1 +1,5 @@ include: package:gql_pedantic/analysis_options.yaml + +analyzer: + exclude: + - **/*.mocks.dart diff --git a/links/gql_http_link/lib/src/_utils.dart b/links/gql_http_link/lib/src/_utils.dart index 97ece8586..af2709a81 100644 --- a/links/gql_http_link/lib/src/_utils.dart +++ b/links/gql_http_link/lib/src/_utils.dart @@ -1,6 +1,4 @@ import "dart:convert"; -import "dart:typed_data"; -import "package:meta/meta.dart"; import "package:http/http.dart"; import "package:gql/ast.dart"; @@ -13,7 +11,7 @@ extension WithType on gql.Request { .toList(); if (operation.operationName != null) { definitions.removeWhere( - (node) => node.name.value != operation.operationName, + (node) => node.name!.value != operation.operationName, ); } // TODO differentiate error types, add exception @@ -38,7 +36,7 @@ extension WithType on gql.Request { /// ``` Map extractFlattenedFileMap( dynamic body, { - Map currentMap, + Map? currentMap, List currentPath = const [], }) { currentMap ??= {}; diff --git a/links/gql_http_link/lib/src/exceptions.dart b/links/gql_http_link/lib/src/exceptions.dart index 236fc6fff..ebce8d7b4 100644 --- a/links/gql_http_link/lib/src/exceptions.dart +++ b/links/gql_http_link/lib/src/exceptions.dart @@ -10,8 +10,8 @@ class HttpLinkParserException extends ResponseFormatException { final http.Response response; const HttpLinkParserException({ - @required dynamic originalException, - @required this.response, + required dynamic originalException, + required this.response, }) : super( originalException: originalException, ); @@ -25,8 +25,8 @@ class HttpLinkServerException extends ServerException { final http.Response response; const HttpLinkServerException({ - @required this.response, - @required Response parsedResponse, + required this.response, + required Response parsedResponse, }) : super( parsedResponse: parsedResponse, ); diff --git a/links/gql_http_link/lib/src/link.dart b/links/gql_http_link/lib/src/link.dart index be72cea30..8c30e33a1 100644 --- a/links/gql_http_link/lib/src/link.dart +++ b/links/gql_http_link/lib/src/link.dart @@ -9,7 +9,7 @@ import "package:meta/meta.dart"; import "./_utils.dart"; import "./exceptions.dart"; -typedef HttpResponseDecoder = FutureOr> Function( +typedef HttpResponseDecoder = FutureOr?> Function( http.Response httpResponse); /// HTTP link headers @@ -22,7 +22,7 @@ class HttpLinkHeaders extends ContextEntry { const HttpLinkHeaders({ this.headers = const {}, - }) : assert(headers != null); + }); @override List get fieldsForEquality => [ @@ -40,10 +40,9 @@ class HttpLinkResponseContext extends ContextEntry { final Map headers; const HttpLinkResponseContext({ - @required this.statusCode, - @required this.headers, - }) : assert(statusCode != null), - assert(headers != null); + required this.statusCode, + required this.headers, + }); @override List get fieldsForEquality => [ @@ -84,15 +83,15 @@ class HttpLink extends Link { /// ``` HttpResponseDecoder httpResponseDecoder; - static Map _defaultHttpResponseDecoder( + static Map? _defaultHttpResponseDecoder( http.Response httpResponse) => json.decode( utf8.decode( httpResponse.bodyBytes, ), - ) as Map; + ) as Map?; - http.Client _httpClient; + http.Client? _httpClient; /// Construct the Link /// @@ -101,7 +100,7 @@ class HttpLink extends Link { String uri, { this.defaultHeaders = const {}, this.useGETForQueries = false, - http.Client httpClient, + http.Client? httpClient, this.serializer = const RequestSerializer(), this.parser = const ResponseParser(), this.httpResponseDecoder = _defaultHttpResponseDecoder, @@ -112,7 +111,7 @@ class HttpLink extends Link { @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) async* { final httpResponse = await _executeRequest(request); @@ -154,7 +153,7 @@ class HttpLink extends Link { Future _parseHttpResponse(http.Response httpResponse) async { try { final responseBody = await httpResponseDecoder(httpResponse); - return parser.parseResponse(responseBody); + return parser.parseResponse(responseBody!); } catch (e) { throw HttpLinkParserException( originalException: e, @@ -166,7 +165,7 @@ class HttpLink extends Link { Future _executeRequest(Request request) async { final httpRequest = _prepareRequest(request); try { - final response = await _httpClient.send(httpRequest); + final response = await _httpClient!.send(httpRequest); return http.Response.fromStream(response); } catch (e) { throw ServerException( @@ -251,7 +250,7 @@ class HttpLink extends Link { Map _getHttpLinkHeaders(Request request) { try { - final HttpLinkHeaders linkHeaders = request.context.entry(); + final HttpLinkHeaders? linkHeaders = request.context.entry(); return { if (linkHeaders != null) ...linkHeaders.headers, diff --git a/links/gql_http_link/pubspec.yaml b/links/gql_http_link/pubspec.yaml index 839c12cd6..9271b260d 100644 --- a/links/gql_http_link/pubspec.yaml +++ b/links/gql_http_link/pubspec.yaml @@ -1,18 +1,18 @@ name: gql_http_link -version: 0.3.3 +version: 0.4.0-nullsafety.1 description: GQL Terminating Link to execute requests via HTTP using JSON. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - meta: ^1.1.7 - gql: ^0.12.3 - gql_exec: ^0.2.5 - gql_link: ^0.3.1 - http: ^0.12.1 - http_parser: ^3.1.4 + meta: ^1.3.0 + gql: ^0.13.0-nullsafety.1 + gql_exec: ^0.3.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.1 + http: ^0.13.0 + http_parser: ^4.0.0 dev_dependencies: - test: ^1.0.0 - mockito: ^4.1.1 + test: ^1.16.2 + mockito: ^5.0.0-nullsafety.7 gql_pedantic: ^1.0.2 - http_parser: ^3.1.4 + build_runner: ^1.11.1 diff --git a/links/gql_http_link/test/gql_http_link_test.dart b/links/gql_http_link/test/gql_http_link_test.dart index ca5574b26..f730dcca5 100644 --- a/links/gql_http_link/test/gql_http_link_test.dart +++ b/links/gql_http_link/test/gql_http_link_test.dart @@ -10,12 +10,7 @@ import "package:mockito/mockito.dart"; import "package:test/test.dart"; import "./helpers.dart"; - -class MockClient extends Mock implements http.Client {} - -class MockRequestSerializer extends Mock implements RequestSerializer {} - -class MockResponseParser extends Mock implements ResponseParser {} +import "./mocks/mocks.dart"; class CustomScalar { const CustomScalar(this.value); @@ -25,19 +20,19 @@ class CustomScalar { void main() { group("HttpLink", () { - MockClient client; - Request request; - HttpLink link; + late MockHttpClient client; + late Request request; + late HttpLink link; final Stream Function([ - Request customRequest, + Request? customRequest, ]) execute = ([ - Request customRequest, + Request? customRequest, ]) => link.request(customRequest ?? request); setUp(() { - client = MockClient(); + client = MockHttpClient(); request = Request( operation: Operation( document: parseString("query MyQuery {}"), @@ -194,7 +189,7 @@ void main() { }); test("adds default headers", () async { - final client = MockClient(); + final client = MockHttpClient(); final link = HttpLink( "/graphql-test", httpClient: client, @@ -446,7 +441,7 @@ void main() { ), ); - HttpLinkServerException exception; + HttpLinkServerException? exception; try { await execute().first; @@ -458,7 +453,7 @@ void main() { exception, TypeMatcher(), ); - expect(exception.response.body, data); + expect(exception!.response.body, data); expect( exception.parsedResponse, equals( @@ -485,12 +480,12 @@ void main() { ), ); - HttpLinkServerException exception; + HttpLinkServerException? exception; try { await execute().first; - } catch (e) { - exception = e as HttpLinkServerException; + } on HttpLinkServerException catch (e) { + exception = e; } expect( @@ -498,7 +493,7 @@ void main() { TypeMatcher(), ); expect( - exception.response.body, + exception!.response.body, data, ); expect( @@ -516,7 +511,7 @@ void main() { test("throws SerializerException when unable to serialize request", () async { - final client = MockClient(); + final client = MockHttpClient(); final serializer = MockRequestSerializer(); final link = HttpLink( "/graphql-test", @@ -545,7 +540,7 @@ void main() { ), ).thenThrow(originalException); - RequestFormatException exception; + RequestFormatException? exception; try { await link @@ -567,7 +562,7 @@ void main() { TypeMatcher(), ); expect( - exception.originalException, + exception!.originalException, originalException, ); }); @@ -584,7 +579,7 @@ void main() { ), ); - ResponseFormatException exception; + ResponseFormatException? exception; try { await link @@ -606,7 +601,7 @@ void main() { TypeMatcher(), ); expect( - exception.originalException, + exception!.originalException, TypeMatcher(), ); }); @@ -621,11 +616,11 @@ void main() { }); group("HttpLink useGETForQueries", () { - MockClient client; - HttpLink link; + late MockHttpClient client; + late HttpLink link; setUp(() { - client = MockClient(); + client = MockHttpClient(); link = HttpLink( "/graphql-test", httpClient: client, diff --git a/links/gql_http_link/test/helpers.dart b/links/gql_http_link/test/helpers.dart index c7e124cfe..0dc7928f3 100644 --- a/links/gql_http_link/test/helpers.dart +++ b/links/gql_http_link/test/helpers.dart @@ -5,7 +5,7 @@ import "package:http/http.dart" as http; http.StreamedResponse simpleResponse( String body, [ - int status, + int? status, Map headers = const {}, ]) { final List bytes = utf8.encode(body); diff --git a/links/gql_http_link/test/mocks/gql_exec.dart b/links/gql_http_link/test/mocks/gql_exec.dart new file mode 100644 index 000000000..8b3ba6be2 --- /dev/null +++ b/links/gql_http_link/test/mocks/gql_exec.dart @@ -0,0 +1,8 @@ +import "package:mockito/annotations.dart"; + +import "package:gql_link/gql_link.dart"; + +export "./gql_exec.mocks.dart"; + +@GenerateMocks([RequestSerializer, ResponseParser]) +void main() {} diff --git a/links/gql_http_link/test/mocks/http.dart b/links/gql_http_link/test/mocks/http.dart new file mode 100644 index 000000000..704902a69 --- /dev/null +++ b/links/gql_http_link/test/mocks/http.dart @@ -0,0 +1,9 @@ +import "package:mockito/annotations.dart"; +import "package:http/http.dart" as http; + +export "./http.mocks.dart"; + +@GenerateMocks([], customMocks: [ + MockSpec(returnNullOnMissingStub: true, as: #MockHttpClient) +]) +void main() {} diff --git a/links/gql_http_link/test/mocks/mocks.dart b/links/gql_http_link/test/mocks/mocks.dart new file mode 100644 index 000000000..6cbc93ef0 --- /dev/null +++ b/links/gql_http_link/test/mocks/mocks.dart @@ -0,0 +1,2 @@ +export "./gql_exec.dart" hide main; +export "./http.dart" hide main; diff --git a/links/gql_http_link/test/multipart_upload_test.dart b/links/gql_http_link/test/multipart_upload_test.dart index 5f5365002..dc8c83cd2 100644 --- a/links/gql_http_link/test/multipart_upload_test.dart +++ b/links/gql_http_link/test/multipart_upload_test.dart @@ -4,23 +4,17 @@ import "dart:typed_data"; import "package:gql_exec/gql_exec.dart"; import "package:gql/language.dart"; import "package:gql_http_link/gql_http_link.dart"; -import "package:gql_link/gql_link.dart"; import "package:http/http.dart" as http; import "package:http_parser/http_parser.dart"; import "package:mockito/mockito.dart"; import "package:test/test.dart"; import "./helpers.dart"; - -class MockClient extends Mock implements http.Client {} - -class MockRequestSerializer extends Mock implements RequestSerializer {} - -class MockResponseParser extends Mock implements ResponseParser {} +import "./mocks/mocks.dart"; void main() { - MockClient mockHttpClient; - HttpLink httpLink; + MockHttpClient? mockHttpClient; + late HttpLink httpLink; const String uploadMutation = r""" mutation($files: [Upload!]!) { @@ -82,9 +76,9 @@ void main() { ]; group("upload", () { - Request gqlRequest; + late Request gqlRequest; setUp(() { - mockHttpClient = MockClient(); + mockHttpClient = MockHttpClient(); httpLink = HttpLink( "http://localhost:3001/graphql", @@ -102,9 +96,9 @@ void main() { }); test("request encoding", () async { - Uint8List bodyBytes; + Uint8List? bodyBytes; when( - mockHttpClient.send(any), + mockHttpClient!.send(any), ).thenAnswer((i) async { bodyBytes = await (i.positionalArguments[0] as http.BaseRequest) .finalize() @@ -115,11 +109,11 @@ void main() { await httpLink.request(gqlRequest).first; final http.MultipartRequest request = verify( - mockHttpClient.send(captureAny), + mockHttpClient!.send(captureAny), ).captured.first as http.MultipartRequest; final List contentTypeStringSplit = - request.headers["content-type"].split("; boundary="); + request.headers["content-type"]!.split("; boundary="); expect(request.method, "POST"); expect(request.url.toString(), "http://localhost:3001/graphql"); @@ -169,14 +163,14 @@ void main() { test("response data", () async { when( - mockHttpClient.send(any), + mockHttpClient!.send(any), ).thenAnswer( (i) async => simpleResponse(expectedResponse), ); final response = await httpLink.request(gqlRequest).first; - final multipleUpload = (response.data["multipleUpload"] as List) + final multipleUpload = (response.data!["multipleUpload"] as List) .cast>(); expect(multipleUpload, >[ @@ -198,7 +192,7 @@ void main() { group("file upload useGETForQueries behavior", () { setUp(() { - mockHttpClient = MockClient(); + mockHttpClient = MockHttpClient(); httpLink = HttpLink( "http://localhost:3001/graphql", @@ -208,9 +202,9 @@ void main() { }); test("query request encoding with files", () async { - Uint8List bodyBytes; + Uint8List? bodyBytes; when( - mockHttpClient.send(any), + mockHttpClient!.send(any), ).thenAnswer((i) async { bodyBytes = await (i.positionalArguments[0] as http.BaseRequest) .finalize() @@ -230,11 +224,11 @@ void main() { await httpLink.request(gqlQueryWithFiles).first; final http.MultipartRequest request = verify( - mockHttpClient.send(captureAny), + mockHttpClient!.send(captureAny), ).captured.first as http.MultipartRequest; final List contentTypeStringSplit = - request.headers["content-type"].split("; boundary="); + request.headers["content-type"]!.split("; boundary="); expect(request.method, "POST"); expect(request.url.toString(), "http://localhost:3001/graphql"); diff --git a/links/gql_link/CHANGELOG.md b/links/gql_link/CHANGELOG.md index 50806d8a3..33e14a072 100644 --- a/links/gql_link/CHANGELOG.md +++ b/links/gql_link/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.4.0-nullsafety.3 + +- fix generated mockito testing + +## 0.4.0-nullsafety.2 + +Null Safety Pre-release + ## 0.3.1 - override toString in Exceptions for legibility (@Britannio) @@ -18,12 +26,12 @@ ## 0.2.1 -- use `package:gql_exec` +- use `package:gql_exec` ## 0.2.0 - rename `Exception` classes and extend from a new `LinkException` -- add various `Link` utils: `Link.function`, `Link.concat`, `Link.route` and `Link.split` +- add various `Link` utils: `Link.function`, `Link.concat`, `Link.route` and `Link.split` ## 0.1.0 diff --git a/links/gql_link/example/gql_link_example.dart b/links/gql_link/example/gql_link_example.dart index 0dcf06d5f..41409e7b9 100644 --- a/links/gql_link/example/gql_link_example.dart +++ b/links/gql_link/example/gql_link_example.dart @@ -8,7 +8,7 @@ class MyLinkContext extends ContextEntry { const MyLinkContext(this.value); @override - List get fieldsForEquality => null; + List get fieldsForEquality => []; } class MyLink extends Link { @@ -17,7 +17,7 @@ class MyLink extends Link { [ Response( data: { - "context": request.context.entry().value, + "context": request.context.entry()?.value, }, ), ], diff --git a/links/gql_link/lib/src/exceptions.dart b/links/gql_link/lib/src/exceptions.dart index 9a504867e..3f196be38 100644 --- a/links/gql_link/lib/src/exceptions.dart +++ b/links/gql_link/lib/src/exceptions.dart @@ -23,7 +23,7 @@ class RequestFormatException extends LinkException { final Request request; const RequestFormatException({ - @required this.request, + required this.request, dynamic originalException, }) : super(originalException); @@ -74,10 +74,10 @@ class ContextWriteException extends LinkException { @immutable class ServerException extends LinkException { /// The parsed response - final Response parsedResponse; + final Response? parsedResponse; const ServerException({ - @required this.parsedResponse, + this.parsedResponse, dynamic originalException, }) : super(originalException); diff --git a/links/gql_link/lib/src/link.dart b/links/gql_link/lib/src/link.dart index e86cafee4..71bc885a7 100644 --- a/links/gql_link/lib/src/link.dart +++ b/links/gql_link/lib/src/link.dart @@ -1,4 +1,5 @@ import "package:gql_exec/gql_exec.dart"; +import "package:meta/meta.dart"; /// Type of the `forward` function typedef NextLink = Stream Function( @@ -17,7 +18,7 @@ typedef LinkRouter = Link Function( /// Used by [Link.function] typedef LinkFunction = Stream Function( Request request, [ - NextLink forward, + NextLink? forward, ]); /// [DocumentNode]-based GraphQL execution interface @@ -56,7 +57,7 @@ abstract class Link { factory Link.split( bool Function(Request request) test, Link left, [ - Link right = const _PassthroughLink(), + Link right = const PassthroughLink(), ]) => _RouterLink((Request request) => test(request) ? left : right); @@ -76,7 +77,7 @@ abstract class Link { Link split( bool Function(Request request) test, Link left, [ - Link right = const _PassthroughLink(), + Link right = const PassthroughLink(), ]) => concat( _RouterLink( @@ -93,7 +94,7 @@ abstract class Link { /// the next [Link] /// /// Terminating [Link]s do not call this function. - NextLink forward, + NextLink? forward, ]); } @@ -105,7 +106,7 @@ class _FunctionLink extends Link { @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) => function(request, forward); } @@ -118,23 +119,24 @@ class _LinkChain extends Link { @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) => - links.reversed.fold( + links.reversed.fold( forward, (fw, link) => (op) => link.request(op, fw), - )(request); + )!(request); } -class _PassthroughLink extends Link { - const _PassthroughLink(); +@visibleForTesting +class PassthroughLink extends Link { + const PassthroughLink(); @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) => - forward(request); + forward!(request); } class _RouterLink extends Link { @@ -142,12 +144,12 @@ class _RouterLink extends Link { const _RouterLink( this.routeFn, - ) : assert(routeFn != null); + ); @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) async* { final link = routeFn(request); diff --git a/links/gql_link/lib/src/request_serializer.dart b/links/gql_link/lib/src/request_serializer.dart index 8c242aa6d..ce85854e1 100644 --- a/links/gql_link/lib/src/request_serializer.dart +++ b/links/gql_link/lib/src/request_serializer.dart @@ -9,7 +9,7 @@ class RequestSerializer { /// /// Extend this to add non-standard behavior Map serializeRequest(Request request) { - final RequestExtensionsThunk thunk = request.context.entry(); + final RequestExtensionsThunk? thunk = request.context.entry(); return { "operationName": request.operation.operationName, diff --git a/links/gql_link/lib/src/response_parser.dart b/links/gql_link/lib/src/response_parser.dart index 180502709..26d793cd1 100644 --- a/links/gql_link/lib/src/response_parser.dart +++ b/links/gql_link/lib/src/response_parser.dart @@ -8,12 +8,12 @@ class ResponseParser { /// /// Extend this to add non-standard behavior Response parseResponse(Map body) => Response( - errors: (body["errors"] as List) + errors: (body["errors"] as List?) ?.map( (dynamic error) => parseError(error as Map), ) - ?.toList(), - data: body["data"] as Map, + .toList(), + data: body["data"] as Map?, context: Context().withEntry( ResponseExtensions( body["extensions"], @@ -26,13 +26,14 @@ class ResponseParser { /// Extend this to add non-standard behavior GraphQLError parseError(Map error) => GraphQLError( message: error["message"] as String, - path: error["path"] as List, - locations: (error["locations"] as List) + path: error["path"] as List?, + locations: (error["locations"] as List?) ?.map( - (dynamic error) => parseLocation(error as Map), + (dynamic location) => + parseLocation(location as Map), ) - ?.toList(), - extensions: error["extensions"] as Map, + .toList(), + extensions: error["extensions"] as Map?, ); /// Parses a response error location diff --git a/links/gql_link/pubspec.yaml b/links/gql_link/pubspec.yaml index bb89ec3b2..d688efdfc 100644 --- a/links/gql_link/pubspec.yaml +++ b/links/gql_link/pubspec.yaml @@ -1,13 +1,13 @@ name: gql_link -version: 0.3.1 +version: 0.4.0-nullsafety.3 description: A simple and modular AST-based GraphQL request execution interface. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: meta: ^1.1.7 - gql: ^0.12.3 - gql_exec: ^0.2.5 + gql: ^0.13.0-nullsafety.1 + gql_exec: ^0.3.0-nullsafety.1 dev_dependencies: test: ^1.0.0 mockito: ^4.1.1 diff --git a/links/gql_transform_link/CHANGELOG.md b/links/gql_transform_link/CHANGELOG.md index 1a0db2bd6..d8f796489 100644 --- a/links/gql_transform_link/CHANGELOG.md +++ b/links/gql_transform_link/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.0-nullsafety.1 + +Null Safety Pre-release + ## 0.1.5 - remove `author` field from `pubspec.yaml` diff --git a/links/gql_transform_link/lib/gql_transform_link.dart b/links/gql_transform_link/lib/gql_transform_link.dart index 868f26e67..68d760889 100644 --- a/links/gql_transform_link/lib/gql_transform_link.dart +++ b/links/gql_transform_link/lib/gql_transform_link.dart @@ -11,8 +11,8 @@ typedef ResponseTransformer = Response Function(Response response); /// A [Link] to transform [Request]s and [Response]s class TransformLink extends Link { - final RequestTransformer requestTransformer; - final ResponseTransformer responseTransformer; + final RequestTransformer? requestTransformer; + final ResponseTransformer? responseTransformer; TransformLink({ this.requestTransformer, @@ -22,15 +22,15 @@ class TransformLink extends Link { @override Stream request( Request request, [ - NextLink forward, + NextLink? forward, ]) { final req = - requestTransformer != null ? requestTransformer(request) : request; + requestTransformer != null ? requestTransformer!(request) : request; if (responseTransformer == null) { - return forward(req); + return forward!(req); } - return forward(req).map(responseTransformer); + return forward!(req).map(responseTransformer!); } } diff --git a/links/gql_transform_link/pubspec.yaml b/links/gql_transform_link/pubspec.yaml index 2bde5caf9..8c371fe26 100644 --- a/links/gql_transform_link/pubspec.yaml +++ b/links/gql_transform_link/pubspec.yaml @@ -1,14 +1,14 @@ name: gql_transform_link -version: 0.1.5 +version: 0.2.0-nullsafety.1 description: GQL Link to transform Requests and Responses. May be used to update context, document, variables, data, errors, etc. repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - gql_exec: ^0.2.5 - gql_link: ^0.3.1 + gql_exec: ^0.3.0-nullsafety.1 + gql_link: ^0.4.0-nullsafety.1 dev_dependencies: - test: ^1.0.0 - mockito: ^4.1.1 - gql: ^0.12.3 + test: ^1.16.2 + mockito: ^5.0.0-nullsafety.7 + gql: ^0.13.0-nullsafety.1 gql_pedantic: ^1.0.2 diff --git a/links/gql_transform_link/test/gql_transform_link_test.dart b/links/gql_transform_link/test/gql_transform_link_test.dart index 51318e192..eb16cd8c4 100644 --- a/links/gql_transform_link/test/gql_transform_link_test.dart +++ b/links/gql_transform_link/test/gql_transform_link_test.dart @@ -7,7 +7,16 @@ import "package:gql_transform_link/gql_transform_link.dart"; import "package:mockito/mockito.dart"; import "package:test/test.dart"; -class MockLink extends Mock implements Link {} +class MockLink extends Mock implements Link { + @override + Stream request(Request? request, [NextLink? forward]) => + super.noSuchMethod( + Invocation.method(#request, [request, forward]), + returnValue: Stream.fromIterable( + [], + ), + ) as Stream; +} void main() { group("Transform Link", () { diff --git a/links/gql_websocket_link/CHANGELOG.md b/links/gql_websocket_link/CHANGELOG.md index 053886505..759f945e2 100644 --- a/links/gql_websocket_link/CHANGELOG.md +++ b/links/gql_websocket_link/CHANGELOG.md @@ -1,7 +1,12 @@ +## 0.3.0-nullsafety.1 + +- Migrate to null safety + ## 0.2.0 -* Add `autoReconnect` feature. -* Auto subscribe to active subscriptions after reconnect. -* *BREAKING*: removed `channel` from constructor, use `channelGenerator` instead. + +- Add `autoReconnect` feature. +- Auto subscribe to active subscriptions after reconnect. +- *BREAKING*: removed `channel` from constructor, use `channelGenerator` instead. ## 0.1.7 diff --git a/links/gql_websocket_link/lib/src/exceptions.dart b/links/gql_websocket_link/lib/src/exceptions.dart index a5e19f6ef..4488fc01b 100644 --- a/links/gql_websocket_link/lib/src/exceptions.dart +++ b/links/gql_websocket_link/lib/src/exceptions.dart @@ -9,8 +9,8 @@ class WebSocketLinkParserException extends ResponseFormatException { final GraphQLSocketMessage message; const WebSocketLinkParserException({ - @required dynamic originalException, - @required this.message, + Object? originalException, + required this.message, }) : super( originalException: originalException, ); @@ -20,12 +20,12 @@ class WebSocketLinkParserException extends ResponseFormatException { /// or parsed response is missing both `data` and `errors` @immutable class WebSocketLinkServerException extends ServerException { - final GraphQLSocketMessage requestMessage; + final GraphQLSocketMessage? requestMessage; const WebSocketLinkServerException({ - @required dynamic originalException, - @required Response parsedResponse, - @required this.requestMessage, + Object? originalException, + Response? parsedResponse, + this.requestMessage, }) : super( originalException: originalException, parsedResponse: parsedResponse, diff --git a/links/gql_websocket_link/lib/src/link.dart b/links/gql_websocket_link/lib/src/link.dart index 394957233..647431b17 100644 --- a/links/gql_websocket_link/lib/src/link.dart +++ b/links/gql_websocket_link/lib/src/link.dart @@ -6,12 +6,14 @@ import "package:gql_exec/gql_exec.dart"; import "package:gql_link/gql_link.dart"; import "package:meta/meta.dart"; import "package:rxdart/rxdart.dart"; -import "package:uuid_enhanced/uuid.dart"; +import "package:uuid/uuid.dart"; import "package:web_socket_channel/web_socket_channel.dart"; import "package:web_socket_channel/status.dart" as websocket_status; +final uuid = Uuid(); + typedef ChannelGenerator = FutureOr Function(); -typedef GraphQLSocketMessageDecoder = FutureOr> Function( +typedef GraphQLSocketMessageDecoder = FutureOr>? Function( dynamic message); typedef GraphQLSocketMessageEncoder = FutureOr Function( @@ -21,7 +23,7 @@ typedef GraphQLSocketMessageEncoder = FutureOr Function( class RequestId extends ContextEntry { final String id; - const RequestId(this.id) : assert(id != null); + const RequestId(this.id); @override List get fieldsForEquality => [id]; @@ -34,8 +36,7 @@ class RequestId extends ContextEntry { /// NOTE: the actual socket connection will only get established after /// a [Request] is handled by this [WebSocketLink]. class WebSocketLink extends Link { - String _uri; - WebSocketChannel _channel; + WebSocketChannel? _channel; // Current active subscriptions final _requests = []; @@ -45,7 +46,7 @@ class WebSocketLink extends Link { /// A function that returns a `WebSocketChannel`. /// This is useful if you have dynamic Auth token and want to regenerate it after the socket has disconnected. - ChannelGenerator _channelGenerator; + late ChannelGenerator _channelGenerator; /// Serializer used to serialize request final RequestSerializer serializer; @@ -68,15 +69,15 @@ class WebSocketLink extends Link { /// ``` final GraphQLSocketMessageDecoder graphQLSocketMessageDecoder; - static Map _defaultGraphQLSocketMessageDecoder( + static Map? _defaultGraphQLSocketMessageDecoder( dynamic message) => - json.decode(message as String) as Map; + json.decode(message as String) as Map?; /// Automatically recreate the channel when connection is lost, /// and re send all active subscriptions. `true` by default. bool autoReconnect; - Timer _reconnectTimer; + Timer? _reconnectTimer; /// The interval between reconnects, the default value is 10 seconds. final Duration reconnectInterval; @@ -89,7 +90,7 @@ class WebSocketLink extends Link { /// because no keep alive message was received from the server in the given time-frame. /// The connection to the server will be closed. /// If the value is null this is ignored, By default this is null. - final Duration inactivityTimeout; + final Duration? inactivityTimeout; // Possible states of the connection. static const int closed = 0; @@ -100,7 +101,7 @@ class WebSocketLink extends Link { final StreamController _messagesController = StreamController.broadcast(); - StreamSubscription _keepAliveSubscription; + StreamSubscription? _keepAliveSubscription; /// Initialize the [WebSocketLink] with a [uri]. /// You can customize the headers & protocols by passing [channelGenerator], @@ -109,8 +110,8 @@ class WebSocketLink extends Link { /// You can also pass custom [RequestSerializer serializer] & [ResponseParser parser]. /// Also [initialPayload] to be passed with the first request to the GraphQL server. WebSocketLink( - String uri, { - ChannelGenerator channelGenerator, + String? uri, { + ChannelGenerator? channelGenerator, this.autoReconnect = true, this.reconnectInterval = const Duration(seconds: 10), this.serializer = const RequestSerializer(), @@ -120,17 +121,13 @@ class WebSocketLink extends Link { this.initialPayload, this.inactivityTimeout, }) : assert(uri == null || (channelGenerator == null)) { - if (uri != null) { - _uri = uri; - } else { - _channelGenerator = - channelGenerator ?? () => WebSocketChannel.connect(Uri.parse(_uri)); - } + _channelGenerator = + channelGenerator ?? () => WebSocketChannel.connect(Uri.parse(uri!)); } @override Stream request(Request request, [forward]) async* { - final String id = Uuid.randomUuid().toString(); + final String id = uuid.v4(); final requestWithContext = request.withContextEntry( RequestId(id), ); @@ -140,7 +137,7 @@ class WebSocketLink extends Link { await _connect(); } final StreamController response = StreamController(); - StreamSubscription messagesSubscription; + StreamSubscription? messagesSubscription; response.onListen = () { final Stream waitForConnectedState = @@ -189,7 +186,7 @@ class WebSocketLink extends Link { response.onCancel = () { messagesSubscription?.cancel(); _write(StopOperation(id)).catchError(response.addError); - _requests.removeWhere((e) => e.context.entry().id == id); + _requests.removeWhere((e) => e.context.entry()!.id == id); }; yield* response.stream; @@ -201,7 +198,7 @@ class WebSocketLink extends Link { _connectionStateController.add(connecting); _channel = await _channelGenerator(); _reconnectTimer?.cancel(); - _channel.stream.listen((dynamic message) async { + _channel!.stream.listen((dynamic message) async { // Mark the connection as [open] and can be used. if (_connectionStateController.value != open) { _connectionStateController.add(open); @@ -213,7 +210,7 @@ class WebSocketLink extends Link { // Send the request. _write( StartOperation( - request.context.entry().id, + request.context.entry()!.id, serializer.serializeRequest(request), ), ).catchError(_messagesController.addError); @@ -235,7 +232,7 @@ class WebSocketLink extends Link { } else { _close(); } - }, onError: (dynamic error) { + }, onError: (Object error) { _messagesController.addError(error); }); @@ -256,8 +253,8 @@ class WebSocketLink extends Link { ) .map( (message) => message as ConnectionKeepAlive) - .timeout(inactivityTimeout, onTimeout: (_) { - _channel.sink.close(websocket_status.goingAway); + .timeout(inactivityTimeout!, onTimeout: (_) { + _channel!.sink.close(websocket_status.goingAway); }).listen(null); } } catch (e) { @@ -294,11 +291,12 @@ class WebSocketLink extends Link { ); } final encodedMessage = await graphQLSocketMessageEncoder(message.toJson()); - _channel.sink.add(encodedMessage); + _channel!.sink.add(encodedMessage); } Future _parseSocketMessage(dynamic message) async { - final Map map = await graphQLSocketMessageDecoder(message); + final Map map = + await graphQLSocketMessageDecoder(message)!; final String type = (map["type"] ?? "unknown") as String; final dynamic payload = map["payload"] ?? {}; final String id = (map["id"] ?? "none") as String; @@ -326,7 +324,7 @@ class WebSocketLink extends Link { /// Close the WebSocket channel. Future _close() async { await _keepAliveSubscription?.cancel(); - await _channel?.sink?.close(websocket_status.goingAway); + await _channel?.sink.close(websocket_status.goingAway); _connectionStateController.add(closed); await _connectionStateController.close(); await _messagesController.close(); diff --git a/links/gql_websocket_link/lib/src/messages.dart b/links/gql_websocket_link/lib/src/messages.dart index eb36986e8..211e072f8 100644 --- a/links/gql_websocket_link/lib/src/messages.dart +++ b/links/gql_websocket_link/lib/src/messages.dart @@ -2,7 +2,6 @@ // Adapted to `gql` by @iscriptology import "dart:convert"; -import "package:meta/meta.dart"; /// These messages represent the structures used for Client-server communication /// in a GraphQL web-socket subscription. Each message is represented in a JSON @@ -69,26 +68,6 @@ class InitOperation extends GraphQLSocketMessage { } } -/// Represent the payload used during a Start query operation. -/// The operationName should match one of the top level query definitions -/// defined in the query provided. Additional variables can be provided -/// and sent to the server for processing. -class QueryPayload extends JsonSerializable { - QueryPayload( - {this.operationName, @required this.query, @required this.variables}); - - final String operationName; - final String query; - final Map variables; - - @override - Map toJson() => { - "operationName": operationName, - "query": query, - "variables": variables, - }; -} - /// A message to tell the server to create a subscription. The contents of the /// query will be defined by the payload request. The id provided will be used /// to tag messages such that they can be identified for this subscription diff --git a/links/gql_websocket_link/pubspec.yaml b/links/gql_websocket_link/pubspec.yaml index 419c1dfb2..597ac752a 100644 --- a/links/gql_websocket_link/pubspec.yaml +++ b/links/gql_websocket_link/pubspec.yaml @@ -1,18 +1,18 @@ name: gql_websocket_link -version: 0.2.0 +version: 0.3.0-nullsafety.1 description: GQL Websocket Link repository: https://github.com/gql-dart/gql environment: - sdk: '>=2.7.2 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - gql: ^0.12.4 - gql_exec: ^0.2.5 - gql_link: ^0.3.1 - meta: ^1.1.8 - rxdart: ^0.25.0 - uuid_enhanced: ^3.0.2 - web_socket_channel: ^1.1.0 + gql: ^0.13.0-nullsafety.2 + gql_exec: ^0.3.0-nullsafety.2 + gql_link: ^0.4.0-nullsafety.3 + meta: ^1.3.0 + rxdart: ^0.26.0 + uuid: ^3.0.1 + web_socket_channel: ^2.0.0 dev_dependencies: gql_pedantic: ^1.0.2 - mockito: ^4.1.1 - test: ^1.14.3 + mockito: ^5.0.0 + test: ^1.16.6 diff --git a/links/gql_websocket_link/test/gql_websocket_link_test.dart b/links/gql_websocket_link/test/gql_websocket_link_test.dart index 5f18c1822..6a3808069 100644 --- a/links/gql_websocket_link/test/gql_websocket_link_test.dart +++ b/links/gql_websocket_link/test/gql_websocket_link_test.dart @@ -420,7 +420,7 @@ void main() { (Response response) { expect(response.data, null); expect( - response.errors[0], + response.errors![0], GraphQLError( message: responseError["message"] as String, locations: [ @@ -727,7 +727,7 @@ void main() { IOWebSocketChannel channel; WebSocketLink link; Request request; - StreamSubscription responseSub; + late StreamSubscription responseSub; request = Request( operation: Operation( @@ -740,28 +740,28 @@ void main() { server.transform(WebSocketTransformer()).listen( (webSocket) async { final channel = IOWebSocketChannel(webSocket); - var subId = ""; + String? subId = ""; var messageCount = 0; channel.stream.listen( expectAsyncUntil1( (dynamic message) { final map = - json.decode(message as String) as Map; + json.decode(message as String) as Map?; if (messageCount == 0) { - expect(map["type"], MessageTypes.connectionInit); + expect(map!["type"], MessageTypes.connectionInit); channel.sink.add( json.encode( ConnectionAck(), ), ); } else if (messageCount == 1) { - expect(map["id"], isA()); + expect(map!["id"], isA()); expect(map["type"], MessageTypes.start); - subId = map["id"] as String; + subId = map["id"] as String?; // cancel the request responseSub.cancel(); } else if (messageCount == 2) { - expect(map["id"], isA()); + expect(map!["id"], isA()); expect(map["id"], subId); expect(map["type"], MessageTypes.stop); } else { @@ -915,10 +915,10 @@ void main() { expectAsync1( (dynamic message) { final map = json.decode(message as String) - as Map; + as Map?; if (messageCount == 0) { expect( - map["type"], MessageTypes.connectionInit); + map!["type"], MessageTypes.connectionInit); channel.sink.add( json.encode( ConnectionAck(), @@ -958,7 +958,7 @@ void main() { WebSocketLink link; Request request; int connectToServer = 1; - String subId; + String? subId; request = Request( operation: Operation( @@ -979,18 +979,18 @@ void main() { expectAsync1( (dynamic message) { final map = json.decode(message as String) - as Map; + as Map?; if (messageCount == 0) { - expect(map["type"], MessageTypes.connectionInit); + expect(map!["type"], MessageTypes.connectionInit); channel.sink.add( json.encode( ConnectionAck(), ), ); } else if (messageCount == 1) { - expect(map["id"], isA()); + expect(map!["id"], isA()); expect(map["type"], MessageTypes.start); - subId = map["id"] as String; + subId = map["id"] as String?; // disconnect webSocket.close(websocket_status.goingAway); } @@ -1014,16 +1014,16 @@ void main() { expectAsync1( (dynamic message) { final map = json.decode(message as String) - as Map; + as Map?; if (messageCount == 0) { - expect(map["type"], MessageTypes.connectionInit); + expect(map!["type"], MessageTypes.connectionInit); channel.sink.add( json.encode( ConnectionAck(), ), ); } else if (messageCount == 1) { - expect(map["id"], isA()); + expect(map!["id"], isA()); expect(map["type"], MessageTypes.start); expect(map["id"], subId); // disconnect