From 77727e7ab00e521c4940ad69a79bd00456d65014 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Wed, 13 Sep 2023 17:00:26 +0200 Subject: [PATCH] test(dynamite): add openapi petstore as dynamite integration test Signed-off-by: Nikolas Rimikis --- .../dynamite_end_to_end_test/.gitignore | 7 + .../analysis_options.yaml | 5 + .../lib/petstore.dart | 1 + .../lib/src/petstore.openapi.dart | 1200 ++++++++++ .../lib/src/petstore.openapi.g.dart | 1933 +++++++++++++++++ .../lib/src/petstore.openapi.json | 1 + .../dynamite_end_to_end_test/pubspec.yaml | 30 + .../pubspec_overrides.yaml | 8 + tool/generate-dynamite-test.sh | 15 + 9 files changed, 3200 insertions(+) create mode 100644 packages/dynamite/dynamite_end_to_end_test/.gitignore create mode 100644 packages/dynamite/dynamite_end_to_end_test/analysis_options.yaml create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/petstore.dart create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.dart create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.g.dart create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.json create mode 100644 packages/dynamite/dynamite_end_to_end_test/pubspec.yaml create mode 100644 packages/dynamite/dynamite_end_to_end_test/pubspec_overrides.yaml create mode 100755 tool/generate-dynamite-test.sh diff --git a/packages/dynamite/dynamite_end_to_end_test/.gitignore b/packages/dynamite/dynamite_end_to_end_test/.gitignore new file mode 100644 index 00000000..3cceda55 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/dynamite/dynamite_end_to_end_test/analysis_options.yaml b/packages/dynamite/dynamite_end_to_end_test/analysis_options.yaml new file mode 100644 index 00000000..447af2a6 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/analysis_options.yaml @@ -0,0 +1,5 @@ +include: package:neon_lints/dart.yaml + +analyzer: + exclude: + - '**.g.dart' diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/petstore.dart b/packages/dynamite/dynamite_end_to_end_test/lib/petstore.dart new file mode 100644 index 00000000..4188c9d1 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/petstore.dart @@ -0,0 +1 @@ +export 'src/petstore.openapi.dart'; diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.dart new file mode 100644 index 00000000..3062b350 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.dart @@ -0,0 +1,1200 @@ +// ignore_for_file: camel_case_types +// ignore_for_file: public_member_api_docs +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/http_client.dart'; +import 'package:universal_io/io.dart'; + +export 'package:dynamite_runtime/http_client.dart'; + +part 'petstore.openapi.g.dart'; + +class SwaggerPetstoreOpenAPI30Response extends DynamiteResponse { + SwaggerPetstoreOpenAPI30Response( + super.data, + super.headers, + ); + + @override + String toString() => 'SwaggerPetstoreOpenAPI30Response(data: $data, headers: $headers)'; +} + +class SwaggerPetstoreOpenAPI30ApiException extends DynamiteApiException { + SwaggerPetstoreOpenAPI30ApiException( + super.statusCode, + super.headers, + super.body, + ); + + static Future fromResponse(final HttpClientResponse response) async { + String body; + try { + body = await response.body; + } on FormatException { + body = 'binary'; + } + + return SwaggerPetstoreOpenAPI30ApiException( + response.statusCode, + response.responseHeaders, + body, + ); + } + + @override + String toString() => 'SwaggerPetstoreOpenAPI30ApiException(statusCode: $statusCode, headers: $headers, body: $body)'; +} + +class SwaggerPetstoreOpenAPI30Client extends DynamiteClient { + SwaggerPetstoreOpenAPI30Client( + super.baseURL, { + super.baseHeaders, + super.userAgent, + super.httpClient, + super.cookieJar, + super.authentications, + }); + + SwaggerPetstoreOpenAPI30Client.fromClient(final DynamiteClient client) + : super( + client.baseURL, + baseHeaders: client.baseHeaders, + httpClient: client.httpClient, + cookieJar: client.cookieJar, + authentications: client.authentications, + ); + + SwaggerPetstoreOpenAPI30PetClient get pet => SwaggerPetstoreOpenAPI30PetClient(this); + SwaggerPetstoreOpenAPI30StoreClient get store => SwaggerPetstoreOpenAPI30StoreClient(this); + SwaggerPetstoreOpenAPI30UserClient get user => SwaggerPetstoreOpenAPI30UserClient(this); +} + +/// Everything about your Pets +class SwaggerPetstoreOpenAPI30PetClient { + SwaggerPetstoreOpenAPI30PetClient(this._rootClient); + + final SwaggerPetstoreOpenAPI30Client _rootClient; + + /// Update an existing pet + /// + /// Update an existing pet by Id + Future updatePet({required final SwaggerPetstoreOpenAPI30Pet pet}) async { + const path = '/pet'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + headers['Content-Type'] = 'application/json'; + body = utf8.encode( + json.encode(_jsonSerializers.serialize(pet, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet))), + ) as Uint8List; + final response = await _rootClient.doRequest( + 'put', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet), + )! as SwaggerPetstoreOpenAPI30Pet; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Add a new pet to the store + /// + /// Add a new pet to the store + Future addPet({required final SwaggerPetstoreOpenAPI30Pet pet}) async { + const path = '/pet'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + headers['Content-Type'] = 'application/json'; + body = utf8.encode( + json.encode(_jsonSerializers.serialize(pet, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet))), + ) as Uint8List; + final response = await _rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet), + )! as SwaggerPetstoreOpenAPI30Pet; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future> findPetsByStatus({ + final SwaggerPetstoreOpenAPI30FindPetsByStatusStatus status = + SwaggerPetstoreOpenAPI30FindPetsByStatusStatus.available, + }) async { + const path = '/pet/findByStatus'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + if (status != SwaggerPetstoreOpenAPI30FindPetsByStatusStatus.available) { + queryParameters['status'] = status.name; + } + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Pet)]), + )! as BuiltList; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future> findPetsByTags({final List? tags}) async { + const path = '/pet/findByTags'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + if (tags != null) { + queryParameters['tags'] = tags.map((final e) => e); + } + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Pet)]), + )! as BuiltList; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Find pet by ID + /// + /// Returns a single pet + Future getPetById({required final int petId}) async { + var path = '/pet/{petId}'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'apiKey' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'apiKey' && a.scheme == 'null').headers, + ); + } else if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for api_key or petstore_auth'); + } + // coverage:ignore-end + path = path.replaceAll('{petId}', Uri.encodeQueryComponent(petId.toString())); + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet), + )! as SwaggerPetstoreOpenAPI30Pet; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Updates a pet in the store with form data + Future updatePetWithForm({ + required final int petId, + final String? name, + final String? status, + }) async { + var path = '/pet/{petId}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + path = path.replaceAll('{petId}', Uri.encodeQueryComponent(petId.toString())); + if (name != null) { + queryParameters['name'] = name; + } + if (status != null) { + queryParameters['status'] = status; + } + final response = await _rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 405) { + return; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Deletes a pet + Future deletePet({ + required final int petId, + final String? apiKey, + }) async { + var path = '/pet/{petId}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + path = path.replaceAll('{petId}', Uri.encodeQueryComponent(petId.toString())); + if (apiKey != null) { + headers['api_key'] = apiKey; + } + final response = await _rootClient.doRequest( + 'delete', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 400) { + return; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// uploads an image + Future uploadFile({ + required final int petId, + final String? additionalMetadata, + final String? string, + }) async { + var path = '/pet/{petId}/uploadImage'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'oauth2' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'oauth2' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for petstore_auth'); + } + // coverage:ignore-end + path = path.replaceAll('{petId}', Uri.encodeQueryComponent(petId.toString())); + if (additionalMetadata != null) { + queryParameters['additionalMetadata'] = additionalMetadata; + } + headers['Content-Type'] = 'application/octet-stream'; + if (string != null) { + body = utf8.encode(string) as Uint8List; + } + final response = await _rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30ApiResponse), + )! as SwaggerPetstoreOpenAPI30ApiResponse; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } +} + +/// Access to Petstore orders +class SwaggerPetstoreOpenAPI30StoreClient { + SwaggerPetstoreOpenAPI30StoreClient(this._rootClient); + + final SwaggerPetstoreOpenAPI30Client _rootClient; + + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + Future> getInventory() async { + const path = '/store/inventory'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/json', + }; + Uint8List? body; + // coverage:ignore-start + if (_rootClient.authentications.where((final a) => a.type == 'apiKey' && a.scheme == 'null').isNotEmpty) { + headers.addAll( + _rootClient.authentications.singleWhere((final a) => a.type == 'apiKey' && a.scheme == 'null').headers, + ); + } else { + throw Exception('Missing authentication for api_key'); + } + // coverage:ignore-end + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(int)]), + )! as BuiltMap; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Place an order for a pet + /// + /// Place a new order in the store + Future placeOrder({final SwaggerPetstoreOpenAPI30Order? order}) async { + const path = '/store/order'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/json', + }; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + headers['Content-Type'] = 'application/json'; + if (order != null) { + body = utf8.encode( + json.encode(_jsonSerializers.serialize(order, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Order))), + ) as Uint8List; + } + final response = await _rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Order), + )! as SwaggerPetstoreOpenAPI30Order; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + Future getOrderById({required final int orderId}) async { + var path = '/store/order/{orderId}'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + path = path.replaceAll('{orderId}', Uri.encodeQueryComponent(orderId.toString())); + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Order), + )! as SwaggerPetstoreOpenAPI30Order; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Future deleteOrder({required final int orderId}) async { + var path = '/store/order/{orderId}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + path = path.replaceAll('{orderId}', Uri.encodeQueryComponent(orderId.toString())); + final response = await _rootClient.doRequest( + 'delete', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 400 || response.statusCode == 404) { + return; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } +} + +/// Operations about user +class SwaggerPetstoreOpenAPI30UserClient { + SwaggerPetstoreOpenAPI30UserClient(this._rootClient); + + final SwaggerPetstoreOpenAPI30Client _rootClient; + + /// Create user + /// + /// This can only be done by the logged in user. + Future createUser({final SwaggerPetstoreOpenAPI30User? user}) async { + const path = '/user'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + headers['Content-Type'] = 'application/json'; + if (user != null) { + body = utf8.encode( + json.encode( + _jsonSerializers.serialize(user, specifiedType: const FullType(SwaggerPetstoreOpenAPI30User)), + ), + ) as Uint8List; + } + await _rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + } + + /// Creates list of users with given input array + /// + /// Creates list of users with given input array + Future createUsersWithListInput({ + final BuiltList? builtListUser, + }) async { + const path = '/user/createWithList'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + headers['Content-Type'] = 'application/json'; + if (builtListUser != null) { + body = utf8.encode( + json.encode( + _jsonSerializers.serialize( + builtListUser, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30User)]), + ), + ), + ) as Uint8List; + } + final response = await _rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30User), + )! as SwaggerPetstoreOpenAPI30User; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Logs user into the system + Future> loginUser({ + final String? username, + final String? password, + }) async { + const path = '/user/login'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + if (username != null) { + queryParameters['username'] = username; + } + if (password != null) { + queryParameters['password'] = password; + } + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return SwaggerPetstoreOpenAPI30Response( + await response.body, + _jsonSerializers.deserialize( + response.responseHeaders, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30UserLoginUserHeaders), + )! as SwaggerPetstoreOpenAPI30UserLoginUserHeaders, + ); + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Logs out current logged in user session + Future logoutUser() async { + const path = '/user/logout'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + } + + /// Get user by user name + Future getUserByName({required final String username}) async { + var path = '/user/{username}'; + final queryParameters = {}; + final headers = { + 'Accept': 'application/xml,application/json', + }; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + path = path.replaceAll('{username}', Uri.encodeQueryComponent(username)); + final response = await _rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 200) { + return _jsonSerializers.deserialize( + await response.jsonBody, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30User), + )! as SwaggerPetstoreOpenAPI30User; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } + + /// Update user + /// + /// This can only be done by the logged in user. + Future updateUser({ + required final String username, + final SwaggerPetstoreOpenAPI30User? user, + }) async { + var path = '/user/{username}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + path = path.replaceAll('{username}', Uri.encodeQueryComponent(username)); + headers['Content-Type'] = 'application/json'; + if (user != null) { + body = utf8.encode( + json.encode( + _jsonSerializers.serialize(user, specifiedType: const FullType(SwaggerPetstoreOpenAPI30User)), + ), + ) as Uint8List; + } + await _rootClient.doRequest( + 'put', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + } + + /// Delete user + /// + /// This can only be done by the logged in user. + Future deleteUser({required final String username}) async { + var path = '/user/{username}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + // coverage:ignore-start + // coverage:ignore-end + path = path.replaceAll('{username}', Uri.encodeQueryComponent(username)); + final response = await _rootClient.doRequest( + 'delete', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null), + headers, + body, + ); + if (response.statusCode == 400 || response.statusCode == 404) { + return; + } + throw await SwaggerPetstoreOpenAPI30ApiException.fromResponse(response); // coverage:ignore-line + } +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30CategoryInterface { + int? get id; + String? get name; + SwaggerPetstoreOpenAPI30CategoryInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30CategoryInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30CategoryInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30Category + implements + SwaggerPetstoreOpenAPI30CategoryInterface, + Built { + factory SwaggerPetstoreOpenAPI30Category([final void Function(SwaggerPetstoreOpenAPI30CategoryBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30Category; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30Category._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30Category.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30CategorySerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30TagInterface { + int? get id; + String? get name; + SwaggerPetstoreOpenAPI30TagInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30TagInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30TagInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30Tag + implements + SwaggerPetstoreOpenAPI30TagInterface, + Built { + factory SwaggerPetstoreOpenAPI30Tag([final void Function(SwaggerPetstoreOpenAPI30TagBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30Tag; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30Tag._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30Tag.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30TagSerializer; +} + +class SwaggerPetstoreOpenAPI30Pet_Status extends EnumClass { + const SwaggerPetstoreOpenAPI30Pet_Status._(super.name); + + static const SwaggerPetstoreOpenAPI30Pet_Status available = _$swaggerPetstoreOpenAPI30PetStatusAvailable; + + static const SwaggerPetstoreOpenAPI30Pet_Status pending = _$swaggerPetstoreOpenAPI30PetStatusPending; + + static const SwaggerPetstoreOpenAPI30Pet_Status sold = _$swaggerPetstoreOpenAPI30PetStatusSold; + + // coverage:ignore-start + static BuiltSet get values => _$swaggerPetstoreOpenAPI30PetStatusValues; + // coverage:ignore-end + static SwaggerPetstoreOpenAPI30Pet_Status valueOf(final String name) => + _$valueOfSwaggerPetstoreOpenAPI30Pet_Status(name); + static Serializer get serializer => _$swaggerPetstoreOpenAPI30PetStatusSerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30PetInterface { + int? get id; + String get name; + SwaggerPetstoreOpenAPI30Category? get category; + BuiltList get photoUrls; + BuiltList? get tags; + + /// pet status in the store + SwaggerPetstoreOpenAPI30Pet_Status? get status; + SwaggerPetstoreOpenAPI30PetInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30PetInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30PetInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30Pet + implements + SwaggerPetstoreOpenAPI30PetInterface, + Built { + factory SwaggerPetstoreOpenAPI30Pet([final void Function(SwaggerPetstoreOpenAPI30PetBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30Pet; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30Pet._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30Pet.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30PetSerializer; +} + +class SwaggerPetstoreOpenAPI30FindPetsByStatusStatus extends EnumClass { + const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus._(super.name); + + static const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus available = + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusAvailable; + + static const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus pending = + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusPending; + + static const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus sold = + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusSold; + + // coverage:ignore-start + static BuiltSet get values => + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusValues; + // coverage:ignore-end + static SwaggerPetstoreOpenAPI30FindPetsByStatusStatus valueOf(final String name) => + _$valueOfSwaggerPetstoreOpenAPI30FindPetsByStatusStatus(name); + static Serializer get serializer => + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusSerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30ApiResponseInterface { + int? get code; + String? get type; + String? get message; + SwaggerPetstoreOpenAPI30ApiResponseInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30ApiResponseInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30ApiResponseInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30ApiResponse + implements + SwaggerPetstoreOpenAPI30ApiResponseInterface, + Built { + factory SwaggerPetstoreOpenAPI30ApiResponse([final void Function(SwaggerPetstoreOpenAPI30ApiResponseBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30ApiResponse; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30ApiResponse._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30ApiResponse.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => + _$swaggerPetstoreOpenAPI30ApiResponseSerializer; +} + +class SwaggerPetstoreOpenAPI30Order_Status extends EnumClass { + const SwaggerPetstoreOpenAPI30Order_Status._(super.name); + + static const SwaggerPetstoreOpenAPI30Order_Status placed = _$swaggerPetstoreOpenAPI30OrderStatusPlaced; + + static const SwaggerPetstoreOpenAPI30Order_Status approved = _$swaggerPetstoreOpenAPI30OrderStatusApproved; + + static const SwaggerPetstoreOpenAPI30Order_Status delivered = _$swaggerPetstoreOpenAPI30OrderStatusDelivered; + + // coverage:ignore-start + static BuiltSet get values => _$swaggerPetstoreOpenAPI30OrderStatusValues; + // coverage:ignore-end + static SwaggerPetstoreOpenAPI30Order_Status valueOf(final String name) => + _$valueOfSwaggerPetstoreOpenAPI30Order_Status(name); + static Serializer get serializer => + _$swaggerPetstoreOpenAPI30OrderStatusSerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30OrderInterface { + int? get id; + int? get petId; + int? get quantity; + String? get shipDate; + + /// Order Status + SwaggerPetstoreOpenAPI30Order_Status? get status; + bool? get complete; + SwaggerPetstoreOpenAPI30OrderInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30OrderInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30OrderInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30Order + implements + SwaggerPetstoreOpenAPI30OrderInterface, + Built { + factory SwaggerPetstoreOpenAPI30Order([final void Function(SwaggerPetstoreOpenAPI30OrderBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30Order; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30Order._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30Order.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30OrderSerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30UserInterface { + int? get id; + String? get username; + String? get firstName; + String? get lastName; + String? get email; + String? get password; + String? get phone; + + /// User Status + int? get userStatus; + SwaggerPetstoreOpenAPI30UserInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30UserInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30UserInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30User + implements + SwaggerPetstoreOpenAPI30UserInterface, + Built { + factory SwaggerPetstoreOpenAPI30User([final void Function(SwaggerPetstoreOpenAPI30UserBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30User; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30User._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30User.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30UserSerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterface { + @BuiltValueField(wireName: 'x-rate-limit') + int? get xRateLimit; + @BuiltValueField(wireName: 'x-expires-after') + String? get xExpiresAfter; + SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30UserLoginUserHeaders + implements + SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterface, + Built { + factory SwaggerPetstoreOpenAPI30UserLoginUserHeaders([ + final void Function(SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder)? b, + ]) = _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30UserLoginUserHeaders._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30UserLoginUserHeaders.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$SwaggerPetstoreOpenAPI30UserLoginUserHeadersSerializer(); +} + +class _$SwaggerPetstoreOpenAPI30UserLoginUserHeadersSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + SwaggerPetstoreOpenAPI30UserLoginUserHeaders, + _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders, + ]; + + @override + final String wireName = 'SwaggerPetstoreOpenAPI30UserLoginUserHeaders'; + + @override + Iterable serialize( + final Serializers serializers, + final SwaggerPetstoreOpenAPI30UserLoginUserHeaders object, { + final FullType specifiedType = FullType.unspecified, + }) { + throw UnimplementedError(); + } + + @override + SwaggerPetstoreOpenAPI30UserLoginUserHeaders deserialize( + final Serializers serializers, + final Iterable serialized, { + final FullType specifiedType = FullType.unspecified, + }) { + final result = SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final value = iterator.current! as String; + switch (key) { + case 'x-rate-limit': + result.xRateLimit = int.parse(value); + case 'x-expires-after': + result.xExpiresAfter = value; + } + } + + return result.build(); + } +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30AddressInterface { + String? get street; + String? get city; + String? get state; + String? get zip; + SwaggerPetstoreOpenAPI30AddressInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30AddressInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30AddressInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30Address + implements + SwaggerPetstoreOpenAPI30AddressInterface, + Built { + factory SwaggerPetstoreOpenAPI30Address([final void Function(SwaggerPetstoreOpenAPI30AddressBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30Address; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30Address._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30Address.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30AddressSerializer; +} + +@BuiltValue(instantiable: false) +abstract interface class SwaggerPetstoreOpenAPI30CustomerInterface { + int? get id; + String? get username; + BuiltList? get address; + SwaggerPetstoreOpenAPI30CustomerInterface rebuild( + final void Function(SwaggerPetstoreOpenAPI30CustomerInterfaceBuilder) updates, + ); + SwaggerPetstoreOpenAPI30CustomerInterfaceBuilder toBuilder(); +} + +abstract class SwaggerPetstoreOpenAPI30Customer + implements + SwaggerPetstoreOpenAPI30CustomerInterface, + Built { + factory SwaggerPetstoreOpenAPI30Customer([final void Function(SwaggerPetstoreOpenAPI30CustomerBuilder)? b]) = + _$SwaggerPetstoreOpenAPI30Customer; + + // coverage:ignore-start + const SwaggerPetstoreOpenAPI30Customer._(); + // coverage:ignore-end + + // coverage:ignore-start + factory SwaggerPetstoreOpenAPI30Customer.fromJson(final Map json) => + _jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + // coverage:ignore-start + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + static Serializer get serializer => _$swaggerPetstoreOpenAPI30CustomerSerializer; +} + +// coverage:ignore-start +final Serializers _serializers = (Serializers().toBuilder() + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30Pet), SwaggerPetstoreOpenAPI30Pet.new) + ..add(SwaggerPetstoreOpenAPI30Pet.serializer) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30Category), SwaggerPetstoreOpenAPI30Category.new) + ..add(SwaggerPetstoreOpenAPI30Category.serializer) + ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder.new) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30Tag), SwaggerPetstoreOpenAPI30Tag.new) + ..add(SwaggerPetstoreOpenAPI30Tag.serializer) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Tag)]), + ListBuilder.new, + ) + ..add(SwaggerPetstoreOpenAPI30Pet_Status.serializer) + ..add(SwaggerPetstoreOpenAPI30FindPetsByStatusStatus.serializer) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Pet)]), + ListBuilder.new, + ) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30ApiResponse), SwaggerPetstoreOpenAPI30ApiResponse.new) + ..add(SwaggerPetstoreOpenAPI30ApiResponse.serializer) + ..addBuilderFactory(const FullType(BuiltMap, [FullType(String), FullType(int)]), MapBuilder.new) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30Order), SwaggerPetstoreOpenAPI30Order.new) + ..add(SwaggerPetstoreOpenAPI30Order.serializer) + ..add(SwaggerPetstoreOpenAPI30Order_Status.serializer) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30User), SwaggerPetstoreOpenAPI30User.new) + ..add(SwaggerPetstoreOpenAPI30User.serializer) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30User)]), + ListBuilder.new, + ) + ..addBuilderFactory( + const FullType(SwaggerPetstoreOpenAPI30UserLoginUserHeaders), + SwaggerPetstoreOpenAPI30UserLoginUserHeaders.new, + ) + ..add(SwaggerPetstoreOpenAPI30UserLoginUserHeaders.serializer) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30Customer), SwaggerPetstoreOpenAPI30Customer.new) + ..add(SwaggerPetstoreOpenAPI30Customer.serializer) + ..addBuilderFactory(const FullType(SwaggerPetstoreOpenAPI30Address), SwaggerPetstoreOpenAPI30Address.new) + ..add(SwaggerPetstoreOpenAPI30Address.serializer) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Address)]), + ListBuilder.new, + )) + .build(); + +Serializers get swaggerPetstoreOpenAPI30Serializers => _serializers; + +final Serializers _jsonSerializers = (_serializers.toBuilder() + ..addPlugin(StandardJsonPlugin()) + ..addPlugin(const ContentStringPlugin())) + .build(); + +T deserializeSwaggerPetstoreOpenAPI30(final Object data) => + _serializers.deserialize(data, specifiedType: FullType(T))! as T; + +Object? serializeSwaggerPetstoreOpenAPI30(final T data) => _serializers.serialize(data, specifiedType: FullType(T)); +// coverage:ignore-end diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.g.dart b/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.g.dart new file mode 100644 index 00000000..79b46ae6 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.g.dart @@ -0,0 +1,1933 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'petstore.openapi.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +const SwaggerPetstoreOpenAPI30Pet_Status _$swaggerPetstoreOpenAPI30PetStatusAvailable = + SwaggerPetstoreOpenAPI30Pet_Status._('available'); +const SwaggerPetstoreOpenAPI30Pet_Status _$swaggerPetstoreOpenAPI30PetStatusPending = + SwaggerPetstoreOpenAPI30Pet_Status._('pending'); +const SwaggerPetstoreOpenAPI30Pet_Status _$swaggerPetstoreOpenAPI30PetStatusSold = + SwaggerPetstoreOpenAPI30Pet_Status._('sold'); + +SwaggerPetstoreOpenAPI30Pet_Status _$valueOfSwaggerPetstoreOpenAPI30Pet_Status(String name) { + switch (name) { + case 'available': + return _$swaggerPetstoreOpenAPI30PetStatusAvailable; + case 'pending': + return _$swaggerPetstoreOpenAPI30PetStatusPending; + case 'sold': + return _$swaggerPetstoreOpenAPI30PetStatusSold; + default: + throw ArgumentError(name); + } +} + +final BuiltSet _$swaggerPetstoreOpenAPI30PetStatusValues = + BuiltSet(const [ + _$swaggerPetstoreOpenAPI30PetStatusAvailable, + _$swaggerPetstoreOpenAPI30PetStatusPending, + _$swaggerPetstoreOpenAPI30PetStatusSold, +]); + +const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusAvailable = + SwaggerPetstoreOpenAPI30FindPetsByStatusStatus._('available'); +const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusPending = + SwaggerPetstoreOpenAPI30FindPetsByStatusStatus._('pending'); +const SwaggerPetstoreOpenAPI30FindPetsByStatusStatus _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusSold = + SwaggerPetstoreOpenAPI30FindPetsByStatusStatus._('sold'); + +SwaggerPetstoreOpenAPI30FindPetsByStatusStatus _$valueOfSwaggerPetstoreOpenAPI30FindPetsByStatusStatus(String name) { + switch (name) { + case 'available': + return _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusAvailable; + case 'pending': + return _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusPending; + case 'sold': + return _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusSold; + default: + throw ArgumentError(name); + } +} + +final BuiltSet _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusValues = + BuiltSet(const [ + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusAvailable, + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusPending, + _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusSold, +]); + +const SwaggerPetstoreOpenAPI30Order_Status _$swaggerPetstoreOpenAPI30OrderStatusPlaced = + SwaggerPetstoreOpenAPI30Order_Status._('placed'); +const SwaggerPetstoreOpenAPI30Order_Status _$swaggerPetstoreOpenAPI30OrderStatusApproved = + SwaggerPetstoreOpenAPI30Order_Status._('approved'); +const SwaggerPetstoreOpenAPI30Order_Status _$swaggerPetstoreOpenAPI30OrderStatusDelivered = + SwaggerPetstoreOpenAPI30Order_Status._('delivered'); + +SwaggerPetstoreOpenAPI30Order_Status _$valueOfSwaggerPetstoreOpenAPI30Order_Status(String name) { + switch (name) { + case 'placed': + return _$swaggerPetstoreOpenAPI30OrderStatusPlaced; + case 'approved': + return _$swaggerPetstoreOpenAPI30OrderStatusApproved; + case 'delivered': + return _$swaggerPetstoreOpenAPI30OrderStatusDelivered; + default: + throw ArgumentError(name); + } +} + +final BuiltSet _$swaggerPetstoreOpenAPI30OrderStatusValues = + BuiltSet(const [ + _$swaggerPetstoreOpenAPI30OrderStatusPlaced, + _$swaggerPetstoreOpenAPI30OrderStatusApproved, + _$swaggerPetstoreOpenAPI30OrderStatusDelivered, +]); + +Serializer _$swaggerPetstoreOpenAPI30CategorySerializer = + _$SwaggerPetstoreOpenAPI30CategorySerializer(); +Serializer _$swaggerPetstoreOpenAPI30TagSerializer = + _$SwaggerPetstoreOpenAPI30TagSerializer(); +Serializer _$swaggerPetstoreOpenAPI30PetStatusSerializer = + _$SwaggerPetstoreOpenAPI30Pet_StatusSerializer(); +Serializer _$swaggerPetstoreOpenAPI30PetSerializer = + _$SwaggerPetstoreOpenAPI30PetSerializer(); +Serializer _$swaggerPetstoreOpenAPI30FindPetsByStatusStatusSerializer = + _$SwaggerPetstoreOpenAPI30FindPetsByStatusStatusSerializer(); +Serializer _$swaggerPetstoreOpenAPI30ApiResponseSerializer = + _$SwaggerPetstoreOpenAPI30ApiResponseSerializer(); +Serializer _$swaggerPetstoreOpenAPI30OrderStatusSerializer = + _$SwaggerPetstoreOpenAPI30Order_StatusSerializer(); +Serializer _$swaggerPetstoreOpenAPI30OrderSerializer = + _$SwaggerPetstoreOpenAPI30OrderSerializer(); +Serializer _$swaggerPetstoreOpenAPI30UserSerializer = + _$SwaggerPetstoreOpenAPI30UserSerializer(); +Serializer _$swaggerPetstoreOpenAPI30AddressSerializer = + _$SwaggerPetstoreOpenAPI30AddressSerializer(); +Serializer _$swaggerPetstoreOpenAPI30CustomerSerializer = + _$SwaggerPetstoreOpenAPI30CustomerSerializer(); + +class _$SwaggerPetstoreOpenAPI30CategorySerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Category, _$SwaggerPetstoreOpenAPI30Category]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Category'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Category object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.id; + if (value != null) { + result + ..add('id') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.name; + if (value != null) { + result + ..add('name') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30Category deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30CategoryBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'name': + result.name = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30TagSerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Tag, _$SwaggerPetstoreOpenAPI30Tag]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Tag'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Tag object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.id; + if (value != null) { + result + ..add('id') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.name; + if (value != null) { + result + ..add('name') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30Tag deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30TagBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'name': + result.name = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30Pet_StatusSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Pet_Status]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Pet_Status'; + + @override + Object serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Pet_Status object, + {FullType specifiedType = FullType.unspecified}) => + object.name; + + @override + SwaggerPetstoreOpenAPI30Pet_Status deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) => + SwaggerPetstoreOpenAPI30Pet_Status.valueOf(serialized as String); +} + +class _$SwaggerPetstoreOpenAPI30PetSerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Pet, _$SwaggerPetstoreOpenAPI30Pet]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Pet'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Pet object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'name', + serializers.serialize(object.name, specifiedType: const FullType(String)), + 'photoUrls', + serializers.serialize(object.photoUrls, specifiedType: const FullType(BuiltList, [FullType(String)])), + ]; + Object? value; + value = object.id; + if (value != null) { + result + ..add('id') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.category; + if (value != null) { + result + ..add('category') + ..add(serializers.serialize(value, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Category))); + } + value = object.tags; + if (value != null) { + result + ..add('tags') + ..add(serializers.serialize(value, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Tag)]))); + } + value = object.status; + if (value != null) { + result + ..add('status') + ..add(serializers.serialize(value, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet_Status))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30Pet deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30PetBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'name': + result.name = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'category': + result.category.replace(serializers.deserialize(value, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Category))! as SwaggerPetstoreOpenAPI30Category); + break; + case 'photoUrls': + result.photoUrls.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(String)]))! as BuiltList); + break; + case 'tags': + result.tags.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Tag)]))! + as BuiltList); + break; + case 'status': + result.status = serializers.deserialize(value, + specifiedType: const FullType(SwaggerPetstoreOpenAPI30Pet_Status)) as SwaggerPetstoreOpenAPI30Pet_Status?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30FindPetsByStatusStatusSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30FindPetsByStatusStatus]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30FindPetsByStatusStatus'; + + @override + Object serialize(Serializers serializers, SwaggerPetstoreOpenAPI30FindPetsByStatusStatus object, + {FullType specifiedType = FullType.unspecified}) => + object.name; + + @override + SwaggerPetstoreOpenAPI30FindPetsByStatusStatus deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) => + SwaggerPetstoreOpenAPI30FindPetsByStatusStatus.valueOf(serialized as String); +} + +class _$SwaggerPetstoreOpenAPI30ApiResponseSerializer + implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30ApiResponse, _$SwaggerPetstoreOpenAPI30ApiResponse]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30ApiResponse'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30ApiResponse object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.code; + if (value != null) { + result + ..add('code') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.type; + if (value != null) { + result + ..add('type') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.message; + if (value != null) { + result + ..add('message') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30ApiResponse deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30ApiResponseBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'code': + result.code = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'type': + result.type = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'message': + result.message = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30Order_StatusSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Order_Status]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Order_Status'; + + @override + Object serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Order_Status object, + {FullType specifiedType = FullType.unspecified}) => + object.name; + + @override + SwaggerPetstoreOpenAPI30Order_Status deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) => + SwaggerPetstoreOpenAPI30Order_Status.valueOf(serialized as String); +} + +class _$SwaggerPetstoreOpenAPI30OrderSerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Order, _$SwaggerPetstoreOpenAPI30Order]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Order'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Order object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.id; + if (value != null) { + result + ..add('id') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.petId; + if (value != null) { + result + ..add('petId') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.quantity; + if (value != null) { + result + ..add('quantity') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.shipDate; + if (value != null) { + result + ..add('shipDate') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.status; + if (value != null) { + result + ..add('status') + ..add(serializers.serialize(value, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Order_Status))); + } + value = object.complete; + if (value != null) { + result + ..add('complete') + ..add(serializers.serialize(value, specifiedType: const FullType(bool))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30Order deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30OrderBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'petId': + result.petId = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'quantity': + result.quantity = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'shipDate': + result.shipDate = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'status': + result.status = + serializers.deserialize(value, specifiedType: const FullType(SwaggerPetstoreOpenAPI30Order_Status)) + as SwaggerPetstoreOpenAPI30Order_Status?; + break; + case 'complete': + result.complete = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30UserSerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30User, _$SwaggerPetstoreOpenAPI30User]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30User'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30User object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.id; + if (value != null) { + result + ..add('id') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.username; + if (value != null) { + result + ..add('username') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.firstName; + if (value != null) { + result + ..add('firstName') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.lastName; + if (value != null) { + result + ..add('lastName') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.email; + if (value != null) { + result + ..add('email') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.password; + if (value != null) { + result + ..add('password') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.phone; + if (value != null) { + result + ..add('phone') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.userStatus; + if (value != null) { + result + ..add('userStatus') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30User deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30UserBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'username': + result.username = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'firstName': + result.firstName = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'lastName': + result.lastName = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'email': + result.email = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'password': + result.password = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'phone': + result.phone = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'userStatus': + result.userStatus = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30AddressSerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Address, _$SwaggerPetstoreOpenAPI30Address]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Address'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Address object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.street; + if (value != null) { + result + ..add('street') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.city; + if (value != null) { + result + ..add('city') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.state; + if (value != null) { + result + ..add('state') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.zip; + if (value != null) { + result + ..add('zip') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30Address deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30AddressBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'street': + result.street = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'city': + result.city = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'state': + result.state = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'zip': + result.zip = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$SwaggerPetstoreOpenAPI30CustomerSerializer implements StructuredSerializer { + @override + final Iterable types = const [SwaggerPetstoreOpenAPI30Customer, _$SwaggerPetstoreOpenAPI30Customer]; + @override + final String wireName = 'SwaggerPetstoreOpenAPI30Customer'; + + @override + Iterable serialize(Serializers serializers, SwaggerPetstoreOpenAPI30Customer object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.id; + if (value != null) { + result + ..add('id') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.username; + if (value != null) { + result + ..add('username') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.address; + if (value != null) { + result + ..add('address') + ..add(serializers.serialize(value, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Address)]))); + } + return result; + } + + @override + SwaggerPetstoreOpenAPI30Customer deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = SwaggerPetstoreOpenAPI30CustomerBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'id': + result.id = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'username': + result.username = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'address': + result.address.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(SwaggerPetstoreOpenAPI30Address)]))! + as BuiltList); + break; + } + } + + return result.build(); + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30CategoryInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30CategoryInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30CategoryInterfaceBuilder) updates); + int? get id; + set id(int? id); + + String? get name; + set name(String? name); +} + +class _$SwaggerPetstoreOpenAPI30Category extends SwaggerPetstoreOpenAPI30Category { + @override + final int? id; + @override + final String? name; + + factory _$SwaggerPetstoreOpenAPI30Category([void Function(SwaggerPetstoreOpenAPI30CategoryBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30CategoryBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30Category._({this.id, this.name}) : super._(); + + @override + SwaggerPetstoreOpenAPI30Category rebuild(void Function(SwaggerPetstoreOpenAPI30CategoryBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30CategoryBuilder toBuilder() => SwaggerPetstoreOpenAPI30CategoryBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30Category && id == other.id && name == other.name; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30Category') + ..add('id', id) + ..add('name', name)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30CategoryBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30CategoryInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30Category? _$v; + + int? _id; + int? get id => _$this._id; + set id(covariant int? id) => _$this._id = id; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + SwaggerPetstoreOpenAPI30CategoryBuilder(); + + SwaggerPetstoreOpenAPI30CategoryBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _name = $v.name; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30Category other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30Category; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30CategoryBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30Category build() => _build(); + + _$SwaggerPetstoreOpenAPI30Category _build() { + final _$result = _$v ?? _$SwaggerPetstoreOpenAPI30Category._(id: id, name: name); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30TagInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30TagInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30TagInterfaceBuilder) updates); + int? get id; + set id(int? id); + + String? get name; + set name(String? name); +} + +class _$SwaggerPetstoreOpenAPI30Tag extends SwaggerPetstoreOpenAPI30Tag { + @override + final int? id; + @override + final String? name; + + factory _$SwaggerPetstoreOpenAPI30Tag([void Function(SwaggerPetstoreOpenAPI30TagBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30TagBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30Tag._({this.id, this.name}) : super._(); + + @override + SwaggerPetstoreOpenAPI30Tag rebuild(void Function(SwaggerPetstoreOpenAPI30TagBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30TagBuilder toBuilder() => SwaggerPetstoreOpenAPI30TagBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30Tag && id == other.id && name == other.name; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30Tag') + ..add('id', id) + ..add('name', name)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30TagBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30TagInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30Tag? _$v; + + int? _id; + int? get id => _$this._id; + set id(covariant int? id) => _$this._id = id; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + SwaggerPetstoreOpenAPI30TagBuilder(); + + SwaggerPetstoreOpenAPI30TagBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _name = $v.name; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30Tag other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30Tag; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30TagBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30Tag build() => _build(); + + _$SwaggerPetstoreOpenAPI30Tag _build() { + final _$result = _$v ?? _$SwaggerPetstoreOpenAPI30Tag._(id: id, name: name); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30PetInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30PetInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30PetInterfaceBuilder) updates); + int? get id; + set id(int? id); + + String? get name; + set name(String? name); + + SwaggerPetstoreOpenAPI30CategoryBuilder get category; + set category(SwaggerPetstoreOpenAPI30CategoryBuilder? category); + + ListBuilder get photoUrls; + set photoUrls(ListBuilder? photoUrls); + + ListBuilder get tags; + set tags(ListBuilder? tags); + + SwaggerPetstoreOpenAPI30Pet_Status? get status; + set status(SwaggerPetstoreOpenAPI30Pet_Status? status); +} + +class _$SwaggerPetstoreOpenAPI30Pet extends SwaggerPetstoreOpenAPI30Pet { + @override + final int? id; + @override + final String name; + @override + final SwaggerPetstoreOpenAPI30Category? category; + @override + final BuiltList photoUrls; + @override + final BuiltList? tags; + @override + final SwaggerPetstoreOpenAPI30Pet_Status? status; + + factory _$SwaggerPetstoreOpenAPI30Pet([void Function(SwaggerPetstoreOpenAPI30PetBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30PetBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30Pet._( + {this.id, required this.name, this.category, required this.photoUrls, this.tags, this.status}) + : super._() { + BuiltValueNullFieldError.checkNotNull(name, r'SwaggerPetstoreOpenAPI30Pet', 'name'); + BuiltValueNullFieldError.checkNotNull(photoUrls, r'SwaggerPetstoreOpenAPI30Pet', 'photoUrls'); + } + + @override + SwaggerPetstoreOpenAPI30Pet rebuild(void Function(SwaggerPetstoreOpenAPI30PetBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30PetBuilder toBuilder() => SwaggerPetstoreOpenAPI30PetBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30Pet && + id == other.id && + name == other.name && + category == other.category && + photoUrls == other.photoUrls && + tags == other.tags && + status == other.status; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, category.hashCode); + _$hash = $jc(_$hash, photoUrls.hashCode); + _$hash = $jc(_$hash, tags.hashCode); + _$hash = $jc(_$hash, status.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30Pet') + ..add('id', id) + ..add('name', name) + ..add('category', category) + ..add('photoUrls', photoUrls) + ..add('tags', tags) + ..add('status', status)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30PetBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30PetInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30Pet? _$v; + + int? _id; + int? get id => _$this._id; + set id(covariant int? id) => _$this._id = id; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + SwaggerPetstoreOpenAPI30CategoryBuilder? _category; + SwaggerPetstoreOpenAPI30CategoryBuilder get category => + _$this._category ??= SwaggerPetstoreOpenAPI30CategoryBuilder(); + set category(covariant SwaggerPetstoreOpenAPI30CategoryBuilder? category) => _$this._category = category; + + ListBuilder? _photoUrls; + ListBuilder get photoUrls => _$this._photoUrls ??= ListBuilder(); + set photoUrls(covariant ListBuilder? photoUrls) => _$this._photoUrls = photoUrls; + + ListBuilder? _tags; + ListBuilder get tags => _$this._tags ??= ListBuilder(); + set tags(covariant ListBuilder? tags) => _$this._tags = tags; + + SwaggerPetstoreOpenAPI30Pet_Status? _status; + SwaggerPetstoreOpenAPI30Pet_Status? get status => _$this._status; + set status(covariant SwaggerPetstoreOpenAPI30Pet_Status? status) => _$this._status = status; + + SwaggerPetstoreOpenAPI30PetBuilder(); + + SwaggerPetstoreOpenAPI30PetBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _name = $v.name; + _category = $v.category?.toBuilder(); + _photoUrls = $v.photoUrls.toBuilder(); + _tags = $v.tags?.toBuilder(); + _status = $v.status; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30Pet other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30Pet; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30PetBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30Pet build() => _build(); + + _$SwaggerPetstoreOpenAPI30Pet _build() { + _$SwaggerPetstoreOpenAPI30Pet _$result; + try { + _$result = _$v ?? + _$SwaggerPetstoreOpenAPI30Pet._( + id: id, + name: BuiltValueNullFieldError.checkNotNull(name, r'SwaggerPetstoreOpenAPI30Pet', 'name'), + category: _category?.build(), + photoUrls: photoUrls.build(), + tags: _tags?.build(), + status: status); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'category'; + _category?.build(); + _$failedField = 'photoUrls'; + photoUrls.build(); + _$failedField = 'tags'; + _tags?.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'SwaggerPetstoreOpenAPI30Pet', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30ApiResponseInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30ApiResponseInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30ApiResponseInterfaceBuilder) updates); + int? get code; + set code(int? code); + + String? get type; + set type(String? type); + + String? get message; + set message(String? message); +} + +class _$SwaggerPetstoreOpenAPI30ApiResponse extends SwaggerPetstoreOpenAPI30ApiResponse { + @override + final int? code; + @override + final String? type; + @override + final String? message; + + factory _$SwaggerPetstoreOpenAPI30ApiResponse([void Function(SwaggerPetstoreOpenAPI30ApiResponseBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30ApiResponseBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30ApiResponse._({this.code, this.type, this.message}) : super._(); + + @override + SwaggerPetstoreOpenAPI30ApiResponse rebuild(void Function(SwaggerPetstoreOpenAPI30ApiResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30ApiResponseBuilder toBuilder() => SwaggerPetstoreOpenAPI30ApiResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30ApiResponse && + code == other.code && + type == other.type && + message == other.message; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, code.hashCode); + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jc(_$hash, message.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30ApiResponse') + ..add('code', code) + ..add('type', type) + ..add('message', message)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30ApiResponseBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30ApiResponseInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30ApiResponse? _$v; + + int? _code; + int? get code => _$this._code; + set code(covariant int? code) => _$this._code = code; + + String? _type; + String? get type => _$this._type; + set type(covariant String? type) => _$this._type = type; + + String? _message; + String? get message => _$this._message; + set message(covariant String? message) => _$this._message = message; + + SwaggerPetstoreOpenAPI30ApiResponseBuilder(); + + SwaggerPetstoreOpenAPI30ApiResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _code = $v.code; + _type = $v.type; + _message = $v.message; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30ApiResponse other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30ApiResponse; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30ApiResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30ApiResponse build() => _build(); + + _$SwaggerPetstoreOpenAPI30ApiResponse _build() { + final _$result = _$v ?? _$SwaggerPetstoreOpenAPI30ApiResponse._(code: code, type: type, message: message); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30OrderInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30OrderInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30OrderInterfaceBuilder) updates); + int? get id; + set id(int? id); + + int? get petId; + set petId(int? petId); + + int? get quantity; + set quantity(int? quantity); + + String? get shipDate; + set shipDate(String? shipDate); + + SwaggerPetstoreOpenAPI30Order_Status? get status; + set status(SwaggerPetstoreOpenAPI30Order_Status? status); + + bool? get complete; + set complete(bool? complete); +} + +class _$SwaggerPetstoreOpenAPI30Order extends SwaggerPetstoreOpenAPI30Order { + @override + final int? id; + @override + final int? petId; + @override + final int? quantity; + @override + final String? shipDate; + @override + final SwaggerPetstoreOpenAPI30Order_Status? status; + @override + final bool? complete; + + factory _$SwaggerPetstoreOpenAPI30Order([void Function(SwaggerPetstoreOpenAPI30OrderBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30OrderBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30Order._({this.id, this.petId, this.quantity, this.shipDate, this.status, this.complete}) + : super._(); + + @override + SwaggerPetstoreOpenAPI30Order rebuild(void Function(SwaggerPetstoreOpenAPI30OrderBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30OrderBuilder toBuilder() => SwaggerPetstoreOpenAPI30OrderBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30Order && + id == other.id && + petId == other.petId && + quantity == other.quantity && + shipDate == other.shipDate && + status == other.status && + complete == other.complete; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, petId.hashCode); + _$hash = $jc(_$hash, quantity.hashCode); + _$hash = $jc(_$hash, shipDate.hashCode); + _$hash = $jc(_$hash, status.hashCode); + _$hash = $jc(_$hash, complete.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30Order') + ..add('id', id) + ..add('petId', petId) + ..add('quantity', quantity) + ..add('shipDate', shipDate) + ..add('status', status) + ..add('complete', complete)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30OrderBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30OrderInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30Order? _$v; + + int? _id; + int? get id => _$this._id; + set id(covariant int? id) => _$this._id = id; + + int? _petId; + int? get petId => _$this._petId; + set petId(covariant int? petId) => _$this._petId = petId; + + int? _quantity; + int? get quantity => _$this._quantity; + set quantity(covariant int? quantity) => _$this._quantity = quantity; + + String? _shipDate; + String? get shipDate => _$this._shipDate; + set shipDate(covariant String? shipDate) => _$this._shipDate = shipDate; + + SwaggerPetstoreOpenAPI30Order_Status? _status; + SwaggerPetstoreOpenAPI30Order_Status? get status => _$this._status; + set status(covariant SwaggerPetstoreOpenAPI30Order_Status? status) => _$this._status = status; + + bool? _complete; + bool? get complete => _$this._complete; + set complete(covariant bool? complete) => _$this._complete = complete; + + SwaggerPetstoreOpenAPI30OrderBuilder(); + + SwaggerPetstoreOpenAPI30OrderBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _petId = $v.petId; + _quantity = $v.quantity; + _shipDate = $v.shipDate; + _status = $v.status; + _complete = $v.complete; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30Order other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30Order; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30OrderBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30Order build() => _build(); + + _$SwaggerPetstoreOpenAPI30Order _build() { + final _$result = _$v ?? + _$SwaggerPetstoreOpenAPI30Order._( + id: id, petId: petId, quantity: quantity, shipDate: shipDate, status: status, complete: complete); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30UserInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30UserInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30UserInterfaceBuilder) updates); + int? get id; + set id(int? id); + + String? get username; + set username(String? username); + + String? get firstName; + set firstName(String? firstName); + + String? get lastName; + set lastName(String? lastName); + + String? get email; + set email(String? email); + + String? get password; + set password(String? password); + + String? get phone; + set phone(String? phone); + + int? get userStatus; + set userStatus(int? userStatus); +} + +class _$SwaggerPetstoreOpenAPI30User extends SwaggerPetstoreOpenAPI30User { + @override + final int? id; + @override + final String? username; + @override + final String? firstName; + @override + final String? lastName; + @override + final String? email; + @override + final String? password; + @override + final String? phone; + @override + final int? userStatus; + + factory _$SwaggerPetstoreOpenAPI30User([void Function(SwaggerPetstoreOpenAPI30UserBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30UserBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30User._( + {this.id, this.username, this.firstName, this.lastName, this.email, this.password, this.phone, this.userStatus}) + : super._(); + + @override + SwaggerPetstoreOpenAPI30User rebuild(void Function(SwaggerPetstoreOpenAPI30UserBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30UserBuilder toBuilder() => SwaggerPetstoreOpenAPI30UserBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30User && + id == other.id && + username == other.username && + firstName == other.firstName && + lastName == other.lastName && + email == other.email && + password == other.password && + phone == other.phone && + userStatus == other.userStatus; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, username.hashCode); + _$hash = $jc(_$hash, firstName.hashCode); + _$hash = $jc(_$hash, lastName.hashCode); + _$hash = $jc(_$hash, email.hashCode); + _$hash = $jc(_$hash, password.hashCode); + _$hash = $jc(_$hash, phone.hashCode); + _$hash = $jc(_$hash, userStatus.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30User') + ..add('id', id) + ..add('username', username) + ..add('firstName', firstName) + ..add('lastName', lastName) + ..add('email', email) + ..add('password', password) + ..add('phone', phone) + ..add('userStatus', userStatus)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30UserBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30UserInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30User? _$v; + + int? _id; + int? get id => _$this._id; + set id(covariant int? id) => _$this._id = id; + + String? _username; + String? get username => _$this._username; + set username(covariant String? username) => _$this._username = username; + + String? _firstName; + String? get firstName => _$this._firstName; + set firstName(covariant String? firstName) => _$this._firstName = firstName; + + String? _lastName; + String? get lastName => _$this._lastName; + set lastName(covariant String? lastName) => _$this._lastName = lastName; + + String? _email; + String? get email => _$this._email; + set email(covariant String? email) => _$this._email = email; + + String? _password; + String? get password => _$this._password; + set password(covariant String? password) => _$this._password = password; + + String? _phone; + String? get phone => _$this._phone; + set phone(covariant String? phone) => _$this._phone = phone; + + int? _userStatus; + int? get userStatus => _$this._userStatus; + set userStatus(covariant int? userStatus) => _$this._userStatus = userStatus; + + SwaggerPetstoreOpenAPI30UserBuilder(); + + SwaggerPetstoreOpenAPI30UserBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _username = $v.username; + _firstName = $v.firstName; + _lastName = $v.lastName; + _email = $v.email; + _password = $v.password; + _phone = $v.phone; + _userStatus = $v.userStatus; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30User other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30User; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30UserBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30User build() => _build(); + + _$SwaggerPetstoreOpenAPI30User _build() { + final _$result = _$v ?? + _$SwaggerPetstoreOpenAPI30User._( + id: id, + username: username, + firstName: firstName, + lastName: lastName, + email: email, + password: password, + phone: phone, + userStatus: userStatus); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterfaceBuilder) updates); + int? get xRateLimit; + set xRateLimit(int? xRateLimit); + + String? get xExpiresAfter; + set xExpiresAfter(String? xExpiresAfter); +} + +class _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders extends SwaggerPetstoreOpenAPI30UserLoginUserHeaders { + @override + final int? xRateLimit; + @override + final String? xExpiresAfter; + + factory _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders( + [void Function(SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders._({this.xRateLimit, this.xExpiresAfter}) : super._(); + + @override + SwaggerPetstoreOpenAPI30UserLoginUserHeaders rebuild( + void Function(SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder toBuilder() => + SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30UserLoginUserHeaders && + xRateLimit == other.xRateLimit && + xExpiresAfter == other.xExpiresAfter; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, xRateLimit.hashCode); + _$hash = $jc(_$hash, xExpiresAfter.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30UserLoginUserHeaders') + ..add('xRateLimit', xRateLimit) + ..add('xExpiresAfter', xExpiresAfter)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30UserLoginUserHeadersInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders? _$v; + + int? _xRateLimit; + int? get xRateLimit => _$this._xRateLimit; + set xRateLimit(covariant int? xRateLimit) => _$this._xRateLimit = xRateLimit; + + String? _xExpiresAfter; + String? get xExpiresAfter => _$this._xExpiresAfter; + set xExpiresAfter(covariant String? xExpiresAfter) => _$this._xExpiresAfter = xExpiresAfter; + + SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder(); + + SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder get _$this { + final $v = _$v; + if ($v != null) { + _xRateLimit = $v.xRateLimit; + _xExpiresAfter = $v.xExpiresAfter; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30UserLoginUserHeaders other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30UserLoginUserHeadersBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30UserLoginUserHeaders build() => _build(); + + _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders _build() { + final _$result = + _$v ?? _$SwaggerPetstoreOpenAPI30UserLoginUserHeaders._(xRateLimit: xRateLimit, xExpiresAfter: xExpiresAfter); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30AddressInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30AddressInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30AddressInterfaceBuilder) updates); + String? get street; + set street(String? street); + + String? get city; + set city(String? city); + + String? get state; + set state(String? state); + + String? get zip; + set zip(String? zip); +} + +class _$SwaggerPetstoreOpenAPI30Address extends SwaggerPetstoreOpenAPI30Address { + @override + final String? street; + @override + final String? city; + @override + final String? state; + @override + final String? zip; + + factory _$SwaggerPetstoreOpenAPI30Address([void Function(SwaggerPetstoreOpenAPI30AddressBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30AddressBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30Address._({this.street, this.city, this.state, this.zip}) : super._(); + + @override + SwaggerPetstoreOpenAPI30Address rebuild(void Function(SwaggerPetstoreOpenAPI30AddressBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30AddressBuilder toBuilder() => SwaggerPetstoreOpenAPI30AddressBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30Address && + street == other.street && + city == other.city && + state == other.state && + zip == other.zip; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, street.hashCode); + _$hash = $jc(_$hash, city.hashCode); + _$hash = $jc(_$hash, state.hashCode); + _$hash = $jc(_$hash, zip.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30Address') + ..add('street', street) + ..add('city', city) + ..add('state', state) + ..add('zip', zip)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30AddressBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30AddressInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30Address? _$v; + + String? _street; + String? get street => _$this._street; + set street(covariant String? street) => _$this._street = street; + + String? _city; + String? get city => _$this._city; + set city(covariant String? city) => _$this._city = city; + + String? _state; + String? get state => _$this._state; + set state(covariant String? state) => _$this._state = state; + + String? _zip; + String? get zip => _$this._zip; + set zip(covariant String? zip) => _$this._zip = zip; + + SwaggerPetstoreOpenAPI30AddressBuilder(); + + SwaggerPetstoreOpenAPI30AddressBuilder get _$this { + final $v = _$v; + if ($v != null) { + _street = $v.street; + _city = $v.city; + _state = $v.state; + _zip = $v.zip; + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30Address other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30Address; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30AddressBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30Address build() => _build(); + + _$SwaggerPetstoreOpenAPI30Address _build() { + final _$result = _$v ?? _$SwaggerPetstoreOpenAPI30Address._(street: street, city: city, state: state, zip: zip); + replace(_$result); + return _$result; + } +} + +abstract mixin class SwaggerPetstoreOpenAPI30CustomerInterfaceBuilder { + void replace(SwaggerPetstoreOpenAPI30CustomerInterface other); + void update(void Function(SwaggerPetstoreOpenAPI30CustomerInterfaceBuilder) updates); + int? get id; + set id(int? id); + + String? get username; + set username(String? username); + + ListBuilder get address; + set address(ListBuilder? address); +} + +class _$SwaggerPetstoreOpenAPI30Customer extends SwaggerPetstoreOpenAPI30Customer { + @override + final int? id; + @override + final String? username; + @override + final BuiltList? address; + + factory _$SwaggerPetstoreOpenAPI30Customer([void Function(SwaggerPetstoreOpenAPI30CustomerBuilder)? updates]) => + (SwaggerPetstoreOpenAPI30CustomerBuilder()..update(updates))._build(); + + _$SwaggerPetstoreOpenAPI30Customer._({this.id, this.username, this.address}) : super._(); + + @override + SwaggerPetstoreOpenAPI30Customer rebuild(void Function(SwaggerPetstoreOpenAPI30CustomerBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + SwaggerPetstoreOpenAPI30CustomerBuilder toBuilder() => SwaggerPetstoreOpenAPI30CustomerBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is SwaggerPetstoreOpenAPI30Customer && + id == other.id && + username == other.username && + address == other.address; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, username.hashCode); + _$hash = $jc(_$hash, address.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'SwaggerPetstoreOpenAPI30Customer') + ..add('id', id) + ..add('username', username) + ..add('address', address)) + .toString(); + } +} + +class SwaggerPetstoreOpenAPI30CustomerBuilder + implements + Builder, + SwaggerPetstoreOpenAPI30CustomerInterfaceBuilder { + _$SwaggerPetstoreOpenAPI30Customer? _$v; + + int? _id; + int? get id => _$this._id; + set id(covariant int? id) => _$this._id = id; + + String? _username; + String? get username => _$this._username; + set username(covariant String? username) => _$this._username = username; + + ListBuilder? _address; + ListBuilder get address => + _$this._address ??= ListBuilder(); + set address(covariant ListBuilder? address) => _$this._address = address; + + SwaggerPetstoreOpenAPI30CustomerBuilder(); + + SwaggerPetstoreOpenAPI30CustomerBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _username = $v.username; + _address = $v.address?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant SwaggerPetstoreOpenAPI30Customer other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$SwaggerPetstoreOpenAPI30Customer; + } + + @override + void update(void Function(SwaggerPetstoreOpenAPI30CustomerBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + SwaggerPetstoreOpenAPI30Customer build() => _build(); + + _$SwaggerPetstoreOpenAPI30Customer _build() { + _$SwaggerPetstoreOpenAPI30Customer _$result; + try { + _$result = _$v ?? _$SwaggerPetstoreOpenAPI30Customer._(id: id, username: username, address: _address?.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'address'; + _address?.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'SwaggerPetstoreOpenAPI30Customer', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.json b/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.json new file mode 100644 index 00000000..2d1dcd41 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/src/petstore.openapi.json @@ -0,0 +1 @@ +{"openapi":"3.0.2","info":{"title":"Swagger Petstore - OpenAPI 3.0","description":"This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"version":"1.0.17"},"externalDocs":{"description":"Find out more about Swagger","url":"http://swagger.io"},"servers":[{"url":"/api/v3"}],"tags":[{"name":"pet","description":"Everything about your Pets","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"store","description":"Access to Petstore orders","externalDocs":{"description":"Find out more about our store","url":"http://swagger.io"}},{"name":"user","description":"Operations about user"}],"paths":{"/pet":{"put":{"tags":["pet"],"summary":"Update an existing pet","description":"Update an existing pet by Id","operationId":"updatePet","requestBody":{"description":"Update an existent pet in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Pet"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"400":{"description":"Invalid ID supplied"},"404":{"description":"Pet not found"},"405":{"description":"Validation exception"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]},"post":{"tags":["pet"],"summary":"Add a new pet to the store","description":"Add a new pet to the store","operationId":"addPet","requestBody":{"description":"Create a new pet in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Pet"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"405":{"description":"Invalid input"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet/findByStatus":{"get":{"tags":["pet"],"summary":"Finds Pets by status","description":"Multiple status values can be provided with comma separated strings","operationId":"findPetsByStatus","parameters":[{"name":"status","in":"query","description":"Status values that need to be considered for filter","required":false,"explode":true,"schema":{"type":"string","default":"available","enum":["available","pending","sold"]}}],"responses":{"200":{"description":"successful operation","content":{"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pet"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pet"}}}}},"400":{"description":"Invalid status value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet/findByTags":{"get":{"tags":["pet"],"summary":"Finds Pets by tags","description":"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.","operationId":"findPetsByTags","parameters":[{"name":"tags","in":"query","description":"Tags to filter by","required":false,"explode":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"successful operation","content":{"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pet"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pet"}}}}},"400":{"description":"Invalid tag value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet/{petId}":{"get":{"tags":["pet"],"summary":"Find pet by ID","description":"Returns a single pet","operationId":"getPetById","parameters":[{"name":"petId","in":"path","description":"ID of pet to return","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"successful operation","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"400":{"description":"Invalid ID supplied"},"404":{"description":"Pet not found"}},"security":[{"api_key":[]},{"petstore_auth":["write:pets","read:pets"]}]},"post":{"tags":["pet"],"summary":"Updates a pet in the store with form data","description":"","operationId":"updatePetWithForm","parameters":[{"name":"petId","in":"path","description":"ID of pet that needs to be updated","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"name","in":"query","description":"Name of pet that needs to be updated","schema":{"type":"string"}},{"name":"status","in":"query","description":"Status of pet that needs to be updated","schema":{"type":"string"}}],"responses":{"405":{"description":"Invalid input"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]},"delete":{"tags":["pet"],"summary":"Deletes a pet","description":"","operationId":"deletePet","parameters":[{"name":"api_key","in":"header","description":"","required":false,"schema":{"type":"string"}},{"name":"petId","in":"path","description":"Pet id to delete","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"400":{"description":"Invalid pet value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet/{petId}/uploadImage":{"post":{"tags":["pet"],"summary":"uploads an image","description":"","operationId":"uploadFile","parameters":[{"name":"petId","in":"path","description":"ID of pet to update","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"additionalMetadata","in":"query","description":"Additional Metadata","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/store/inventory":{"get":{"tags":["store"],"summary":"Returns pet inventories by status","description":"Returns a map of status codes to quantities","operationId":"getInventory","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}}}}}},"security":[{"api_key":[]}]}},"/store/order":{"post":{"tags":["store"],"summary":"Place an order for a pet","description":"Place a new order in the store","operationId":"placeOrder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Order"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Order"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"405":{"description":"Invalid input"}}}},"/store/order/{orderId}":{"get":{"tags":["store"],"summary":"Find purchase order by ID","description":"For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.","operationId":"getOrderById","parameters":[{"name":"orderId","in":"path","description":"ID of order that needs to be fetched","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"successful operation","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/Order"}},"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid ID supplied"},"404":{"description":"Order not found"}}},"delete":{"tags":["store"],"summary":"Delete purchase order by ID","description":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","operationId":"deleteOrder","parameters":[{"name":"orderId","in":"path","description":"ID of the order that needs to be deleted","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"400":{"description":"Invalid ID supplied"},"404":{"description":"Order not found"}}}},"/user":{"post":{"tags":["user"],"summary":"Create user","description":"This can only be done by the logged in user.","operationId":"createUser","requestBody":{"description":"Created user object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}},"application/xml":{"schema":{"$ref":"#/components/schemas/User"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"default":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}},"application/xml":{"schema":{"$ref":"#/components/schemas/User"}}}}}}},"/user/createWithList":{"post":{"tags":["user"],"summary":"Creates list of users with given input array","description":"Creates list of users with given input array","operationId":"createUsersWithListInput","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"responses":{"200":{"description":"Successful operation","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/User"}},"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"default":{"description":"successful operation"}}}},"/user/login":{"get":{"tags":["user"],"summary":"Logs user into the system","description":"","operationId":"loginUser","parameters":[{"name":"username","in":"query","description":"The user name for login","required":false,"schema":{"type":"string"}},{"name":"password","in":"query","description":"The password for login in clear text","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","headers":{"X-Rate-Limit":{"description":"calls per hour allowed by the user","schema":{"type":"integer","format":"int32"}},"X-Expires-After":{"description":"date in UTC when token expires","schema":{"type":"string","format":"date-time"}}},"content":{"application/xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Invalid username/password supplied"}}}},"/user/logout":{"get":{"tags":["user"],"summary":"Logs out current logged in user session","description":"","operationId":"logoutUser","parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/user/{username}":{"get":{"tags":["user"],"summary":"Get user by user name","description":"","operationId":"getUserByName","parameters":[{"name":"username","in":"path","description":"The name that needs to be fetched. Use user1 for testing. ","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/User"}},"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid username supplied"},"404":{"description":"User not found"}}},"put":{"tags":["user"],"summary":"Update user","description":"This can only be done by the logged in user.","operationId":"updateUser","parameters":[{"name":"username","in":"path","description":"name that need to be deleted","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Update an existent user in the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}},"application/xml":{"schema":{"$ref":"#/components/schemas/User"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"default":{"description":"successful operation"}}},"delete":{"tags":["user"],"summary":"Delete user","description":"This can only be done by the logged in user.","operationId":"deleteUser","parameters":[{"name":"username","in":"path","description":"The name that needs to be deleted","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Invalid username supplied"},"404":{"description":"User not found"}}}}},"components":{"schemas":{"Order":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":10},"petId":{"type":"integer","format":"int64","example":198772},"quantity":{"type":"integer","format":"int32","example":7},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","example":"approved","enum":["placed","approved","delivered"]},"complete":{"type":"boolean"}},"xml":{"name":"order"}},"Customer":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":100000},"username":{"type":"string","example":"fehguy"},"address":{"type":"array","xml":{"name":"addresses","wrapped":true},"items":{"$ref":"#/components/schemas/Address"}}},"xml":{"name":"customer"}},"Address":{"type":"object","properties":{"street":{"type":"string","example":"437 Lytton"},"city":{"type":"string","example":"Palo Alto"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"94301"}},"xml":{"name":"address"}},"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":1},"name":{"type":"string","example":"Dogs"}},"xml":{"name":"category"}},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":10},"username":{"type":"string","example":"theUser"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"James"},"email":{"type":"string","example":"john@email.com"},"password":{"type":"string","example":"12345"},"phone":{"type":"string","example":"12345"},"userStatus":{"type":"integer","description":"User Status","format":"int32","example":1}},"xml":{"name":"user"}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"tag"}},"Pet":{"required":["name","photoUrls"],"type":"object","properties":{"id":{"type":"integer","format":"int64","example":10},"name":{"type":"string","example":"doggie"},"category":{"$ref":"#/components/schemas/Category"},"photoUrls":{"type":"array","xml":{"wrapped":true},"items":{"type":"string","xml":{"name":"photoUrl"}}},"tags":{"type":"array","xml":{"wrapped":true},"items":{"$ref":"#/components/schemas/Tag"}},"status":{"type":"string","description":"pet status in the store","enum":["available","pending","sold"]}},"xml":{"name":"pet"}},"ApiResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"type":{"type":"string"},"message":{"type":"string"}},"xml":{"name":"##default"}}},"requestBodies":{"Pet":{"description":"Pet object that needs to be added to the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"UserArray":{"description":"List of user object","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}},"securitySchemes":{"petstore_auth":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://petstore3.swagger.io/oauth/authorize","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},"api_key":{"type":"apiKey","name":"api_key","in":"header"}}}} \ No newline at end of file diff --git a/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml b/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml new file mode 100644 index 00000000..86df73b5 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/pubspec.yaml @@ -0,0 +1,30 @@ +name: dynamite_end_to_end_test +publish_to: none +description: Tests for dynamite. Not meant for publishing. +version: 1.0.0 + +environment: + sdk: '>=3.1.1 <4.0.0' + +dependencies: + built_collection: ^5.1.1 + built_value: ^8.6.2 + dynamite_runtime: + git: + url: https://github.com/nextcloud/neon + path: packages/dynamite/dynamite_runtime + universal_io: ^2.2.2 + +dev_dependencies: + build_runner: ^2.4.6 + built_value_generator: ^8.6.2 + dynamite: + git: + url: https://github.com/nextcloud/neon + path: packages/dynamite/dynamite + lints: ^2.0.0 + neon_lints: + git: + url: https://github.com/nextcloud/neon + path: packages/neon_lints + test: ^1.21.0 diff --git a/packages/dynamite/dynamite_end_to_end_test/pubspec_overrides.yaml b/packages/dynamite/dynamite_end_to_end_test/pubspec_overrides.yaml new file mode 100644 index 00000000..6271ab73 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/pubspec_overrides.yaml @@ -0,0 +1,8 @@ +# melos_managed_dependency_overrides: dynamite,dynamite_runtime,neon_lints +dependency_overrides: + dynamite: + path: ../dynamite + dynamite_runtime: + path: ../dynamite_runtime + neon_lints: + path: ../../neon_lints diff --git a/tool/generate-dynamite-test.sh b/tool/generate-dynamite-test.sh new file mode 100755 index 00000000..29a8bddb --- /dev/null +++ b/tool/generate-dynamite-test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -euxo pipefail +cd "$(dirname "$0")/.." + +( + cd packages/dynamite/dynamite_end_to_end_test + wget https://petstore3.swagger.io/api/v3/openapi.json -O lib/src/petstore.openapi.json + rm -rf .dart_tool/build + fvm dart pub run build_runner build --delete-conflicting-outputs + # For some reason we need to fix and format twice, otherwise not everything gets fixed + fvm dart fix --apply lib/src/ + melos run format + fvm dart fix --apply lib/src/ + melos run format +)